33 #include "generated/airframe.h"
40 #ifndef GENERIC_COM_I2C_DEV
41 #define GENERIC_COM_I2C_DEV i2c0
44 #ifndef GENERIC_COM_SLAVE_ADDR
45 #define GENERIC_COM_SLAVE_ADDR 0x26
58 #define FillBufWith32bit(_buf, _index, _value) { \
59 _buf[_index] = (uint8_t) (_value); \
60 _buf[_index+1] = (uint8_t) ((_value) >> 8); \
61 _buf[_index+2] = (uint8_t) ((_value) >> 16); \
62 _buf[_index+3] = (uint8_t) ((_value) >> 24); \
65 #define FillBufWith16bit(_buf, _index, _value) { \
66 _buf[_index] = (uint8_t) (_value); \
67 _buf[_index+1] = (uint8_t) ((_value) >> 8); \
uint8_t autopilot_get_mode(void)
get autopilot mode
struct pprz_autopilot autopilot
Global autopilot structure.
Core autopilot interface common to all firmwares.
uint16_t flight_time
flight time in seconds
uint16_t charge[CHARGE_NB]
Hardware independent code for commands handling.
struct Electrical electrical
Interface for electrical status: supply voltage, current, battery status, etc.
float vsupply
supply voltage in V
#define GENERIC_COM_I2C_DEV
#define FillBufWith16bit(_buf, _index, _value)
void generic_com_init(void)
#define FillBufWith32bit(_buf, _index, _value)
void generic_com_periodic(void)
void generic_com_event(void)
struct i2c_transaction com_trans
#define GENERIC_COM_SLAVE_ADDR
struct GpsState gps
global GPS state
Device independent GPS code (interface)
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
uint16_t gspeed
norm of 2d ground speed in cm/s
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.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransDone
transaction set to done by user level
I2C transaction structure.
int32_t lat
in degrees*1e7
int32_t alt
in millimeters above WGS84 reference ellipsoid
int32_t lon
in degrees*1e7
static float stateGetAirspeed_f(void)
Get airspeed (float).
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
API to get/set the generic vehicle states.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.