36 #include "pprzlink/messages.h"
41 #define MLX_I2C_DEV i2c0
56 #define MLX90614_ADDR 0x06
59 #define MLX90614_GENERAL_ADDR 0
63 void ir_mlx_crc(
unsigned char addr,
volatile unsigned char *data)
65 unsigned char i, bit,
crc = 0;
67 for (i = 0; i < 4; i++) {
68 if (i != 0) {
crc ^= (data[i - 1]); }
70 for (bit = 8; bit > 0; bit--) {
85 #ifdef IR_MLX_ONE_TIME_CONFIG
86 #warning Starting MLX90614 in CONFIGURATION MODE, do this only once for
87 #warning setup, then turn this MODE off again and recompile/flash
96 #ifdef IR_MLX_ONE_TIME_CONFIG
115 #ifdef IR_MLX_ONE_TIME_CONFIG
Common code for AP and FBW telemetry.
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
enum I2CTransactionStatus status
Transaction status.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransDone
transaction set to done by user level
I2C transaction structure.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
void ir_mlx_periodic(void)
#define MLX90614_GENERAL_ADDR
struct i2c_transaction mlx_trans
uint16_t ir_mlx_itemp_case
void ir_mlx_crc(unsigned char addr, volatile unsigned char *data)
uint16_t ir_mlx_itemp_obj
arch independent LED (Light Emitting Diodes) API
Architecture independent timing functions.
volatile uint32_t nb_sec
full seconds since startup
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.