Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ami601.c
Go to the documentation of this file.
1 #include "peripherals/ami601.h"
2 
7 
11 
12 void ami601_init( void ) {
13 
14  uint8_t i;
15  for (i=0; i< AMI601_NB_CHAN; i++) {
16  ami601_values[i] = 0;
17  }
20  ami601_nb_err = 0;
22 
23 }
24 
25 void ami601_read( void ) {
26  if (ami601_status != AMI601_IDLE) {
27  ami601_nb_err++;
29  }
30  else {
34  ami601_i2c_trans.buf[0] = 0x55;
35  ami601_i2c_trans.buf[1] = 0xAA;
36  ami601_i2c_trans.buf[2] = 0x14;
38  }
39 }
void ami601_init(void)
Definition: ami601.c:12
#define AMI601_NB_CHAN
Definition: ami601.h:13
unsigned short uint16_t
Definition: types.h:16
bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
Definition: i2c_arch.c:333
#define AMI601_SENDING_REQ
Definition: ami601.h:20
#define AMI601_SLAVE_ADDR
Definition: ami601.h:28
uint8_t ami601_foo1
Definition: ami601.c:3
#define AMI601_IDLE
Definition: ami601.h:19
struct i2c_transaction ami601_i2c_trans
Definition: ami601.c:9
volatile uint8_t ami601_status
Definition: ami601.c:8
uint8_t ami601_foo3
Definition: ami601.c:5
uint8_t slave_addr
Definition: i2c.h:79
uint16_t ami601_values[AMI601_NB_CHAN]
Definition: ami601.c:6
unsigned long uint32_t
Definition: types.h:18
enum I2CTransactionStatus status
Definition: i2c.h:83
uint8_t ami601_foo2
Definition: ami601.c:4
volatile uint32_t ami601_nb_err
Definition: ami601.c:10
volatile uint8_t buf[I2C_BUF_LEN]
Definition: i2c.h:82
uint8_t len_w
Definition: i2c.h:81
unsigned char uint8_t
Definition: types.h:14
void ami601_read(void)
Definition: ami601.c:25
Definition: i2c.h:45
enum I2CTransactionType type
Definition: i2c.h:78