Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
ami601.c
Go to the documentation of this file.
1 #include "peripherals/ami601.h"
2 
7 
11 
12 void ami601_init(void)
13 {
14 
15  uint8_t i;
16  for (i = 0; i < AMI601_NB_CHAN; i++) {
17  ami601_values[i] = 0;
18  }
21  ami601_nb_err = 0;
23 
24 }
25 
26 void ami601_read(void)
27 {
28  if (ami601_status != AMI601_IDLE) {
29  ami601_nb_err++;
31  } else {
35  ami601_i2c_trans.buf[0] = 0x55;
36  ami601_i2c_trans.buf[1] = 0xAA;
37  ami601_i2c_trans.buf[2] = 0x14;
39  }
40 }
ami601_foo3
uint8_t ami601_foo3
Definition: ami601.c:5
uint16_t
unsigned short uint16_t
Definition: types.h:16
i2c_transaction::buf
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
Definition: i2c.h:122
I2CTransTx
@ I2CTransTx
transmit only transaction
Definition: i2c.h:47
ami601_values
uint16_t ami601_values[AMI601_NB_CHAN]
Definition: ami601.c:6
uint32_t
unsigned long uint32_t
Definition: types.h:18
ami601_init
void ami601_init(void)
Definition: ami601.c:12
i2c_transaction::len_w
uint8_t len_w
Number of bytes to write/transmit.
Definition: i2c.h:116
I2CTransSuccess
@ I2CTransSuccess
transaction successfully finished by I2C driver
Definition: i2c.h:57
ami601_read
void ami601_read(void)
Definition: ami601.c:26
ami601_foo2
uint8_t ami601_foo2
Definition: ami601.c:4
uint8_t
unsigned char uint8_t
Definition: types.h:14
ami601_i2c_trans
struct i2c_transaction ami601_i2c_trans
Definition: ami601.c:9
i2c_transaction::status
enum I2CTransactionStatus status
Transaction status.
Definition: i2c.h:126
ami601_status
volatile uint8_t ami601_status
Definition: ami601.c:8
ami601.h
i2c_transaction
I2C transaction structure.
Definition: i2c.h:93
i2c_transaction::slave_addr
uint8_t slave_addr
Slave address.
Definition: i2c.h:104
AMI601_SENDING_REQ
#define AMI601_SENDING_REQ
Definition: ami601.h:20
AMI601_NB_CHAN
#define AMI601_NB_CHAN
Definition: ami601.h:13
AMI601_SLAVE_ADDR
#define AMI601_SLAVE_ADDR
Definition: ami601.h:28
ami601_foo1
uint8_t ami601_foo1
Definition: ami601.c:3
AMI601_IDLE
#define AMI601_IDLE
Definition: ami601.h:19
i2c_submit
static bool i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
Submit a I2C transaction.
Definition: i2c.h:266
ami601_nb_err
volatile uint32_t ami601_nb_err
Definition: ami601.c:10
i2c_transaction::type
enum I2CTransactionType type
Transaction type.
Definition: i2c.h:98