Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
generic_com.c File Reference
#include "std.h"
#include "modules/com/generic_com.h"
#include "mcu_periph/i2c.h"
#include "estimator.h"
#include "subsystems/gps.h"
#include "subsystems/electrical.h"
#include "generated/airframe.h"
#include "inter_mcu.h"
#include "firmwares/fixedwing/autopilot.h"
#include "subsystems/navigation/common_nav.h"
+ Include dependency graph for generic_com.c:

Go to the source code of this file.

Macros

#define NB_DATA   24
 
#define GENERIC_COM_I2C_DEV   i2c0
 
#define GENERIC_COM_SLAVE_ADDR   0x26
 
#define FillBufWith32bit(_buf, _index, _value)
 
#define FillBufWith16bit(_buf, _index, _value)
 

Functions

void generic_com_init (void)
 
void generic_com_periodic (void)
 
void generic_com_event (void)
 
void start_com (void)
 
void stop_com (void)
 

Variables

struct i2c_transaction com_trans
 
bool_t active_com
 

Macro Definition Documentation

#define FillBufWith16bit (   _buf,
  _index,
  _value 
)
Value:
{ \
_buf[_index] = (uint8_t) (_value); \
_buf[_index+1] = (uint8_t) ((_value) >> 8); \
}
unsigned char uint8_t
Definition: types.h:14

Definition at line 64 of file generic_com.c.

Referenced by generic_com_periodic().

#define FillBufWith32bit (   _buf,
  _index,
  _value 
)
Value:
{ \
_buf[_index] = (uint8_t) (_value); \
_buf[_index+1] = (uint8_t) ((_value) >> 8); \
_buf[_index+2] = (uint8_t) ((_value) >> 16); \
_buf[_index+3] = (uint8_t) ((_value) >> 24); \
}
unsigned char uint8_t
Definition: types.h:14

Definition at line 57 of file generic_com.c.

Referenced by generic_com_periodic().

#define GENERIC_COM_I2C_DEV   i2c0

Definition at line 41 of file generic_com.c.

Referenced by generic_com_periodic(), and stop_com().

#define GENERIC_COM_SLAVE_ADDR   0x26

Definition at line 45 of file generic_com.c.

Referenced by generic_com_periodic(), and stop_com().

#define NB_DATA   24

Definition at line 38 of file generic_com.c.

Referenced by generic_com_periodic(), MPPT_ask(), MPPT_init(), and MPPT_periodic().

Function Documentation

void generic_com_event ( void  )
void generic_com_init ( void  )

Definition at line 52 of file generic_com.c.

References active_com, com_trans, FALSE, I2CTransDone, and i2c_transaction::status.

void start_com ( void  )

Definition at line 97 of file generic_com.c.

References active_com, com_trans, I2CTransDone, i2c_transaction::status, and TRUE.

void stop_com ( void  )

Variable Documentation

bool_t active_com

Definition at line 50 of file generic_com.c.

Referenced by generic_com_init(), generic_com_periodic(), start_com(), and stop_com().

struct i2c_transaction com_trans