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); \
Communication between fbw and ap processes.
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
transaction successfully finished by I2C driver
#define FillBufWith16bit(_buf, _index, _value)
uint16_t flight_time
flight time in seconds
static float stateGetAirspeed_f(void)
Get airspeed (float).
struct pprz_autopilot autopilot
Global autopilot structure.
void generic_com_periodic(void)
int32_t alt
in millimeters above WGS84 reference ellipsoid
float energy
Energy consumption (mAh) This is the ap copy of the measurement from fbw FIXME use electrical module ...
transaction set to done by user level
Interface for electrical status: supply voltage, current, battery status, etc.
Device independent GPS code (interface)
int32_t lon
in degrees*1e7
#define GENERIC_COM_SLAVE_ADDR
struct i2c_transaction com_trans
I2C transaction structure.
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.
Core autopilot interface common to all firmwares.
API to get/set the generic vehicle states.
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
uint16_t vsupply
supply voltage in decivolts
uint16_t gspeed
norm of 2d ground speed in cm/s
struct Electrical electrical
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
void generic_com_event(void)
void generic_com_init(void)
int32_t lat
in degrees*1e7
#define FillBufWith32bit(_buf, _index, _value)
struct GpsState gps
global GPS state
#define GENERIC_COM_I2C_DEV
uint8_t autopilot_get_mode(void)
get autopilot mode
Architecture independent I2C (Inter-Integrated Circuit Bus) API.