dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
MSP to UAVO Bridge

Bridges MSP (Multiwii Serial Protocol) telemetry to UAVOs. More...

Data Structures

struct  msp_bridge
 
struct  msp_message_list_item
 

Macros

#define STACK_SIZE_BYTES   800
 
#define THREAD_PRIORITY   PIOS_THREAD_PRIO_LOW
 
#define MSP_TIMEOUT   10
 
#define MSP_BRIDGE_MAGIC   0x97a4dc58
 

Functions

static bool msp_bridge_validate (struct msp_bridge *m)
 
static bool msp_unpack_attitude (void *data, uint8_t len)
 
static bool msp_unpack_raw_imu (void *data, uint8_t len)
 
static bool msp_unpack_analog (void *data, uint8_t len)
 
static void set_baudrate (struct msp_bridge *m)
 
static bool msp_handler (enum msp_message_id msg_id, void *data, uint8_t len, void *context)
 
static enum msp_message_id get_next_message (void)
 
static void mspUavoBridge_Task (void *parameters)
 MSP to UAVO bridge main task. More...
 
static int32_t mspUavoBridge_Start (void)
 Start the MSP to UAVO bridge module. More...
 
static int32_t mspUavoBridge_Init (void)
 Initialize the MSP to UAVO bridge module. More...
 

Variables

static struct msp_message_list_item message_list []
 
static bool module_enabled = false
 
static struct msp_bridgemsp
 
uintptr_t pios_com_msp_id
 

Detailed Description

Bridges MSP (Multiwii Serial Protocol) telemetry to UAVOs.

Macro Definition Documentation

#define MSP_BRIDGE_MAGIC   0x97a4dc58

Definition at line 52 of file mspuavobridge.c.

#define MSP_TIMEOUT   10

Definition at line 51 of file mspuavobridge.c.

#define STACK_SIZE_BYTES   800

Definition at line 46 of file mspuavobridge.c.

#define THREAD_PRIORITY   PIOS_THREAD_PRIO_LOW

Definition at line 48 of file mspuavobridge.c.

Function Documentation

static enum msp_message_id get_next_message ( void  )
static

Definition at line 205 of file mspuavobridge.c.

static bool msp_bridge_validate ( struct msp_bridge m)
static

Definition at line 83 of file mspuavobridge.c.

static bool msp_handler ( enum msp_message_id  msg_id,
void *  data,
uint8_t  len,
void *  context 
)
static

Definition at line 178 of file mspuavobridge.c.

static bool msp_unpack_analog ( void *  data,
uint8_t  len 
)
static
Todo:
check scaling

Definition at line 143 of file mspuavobridge.c.

static bool msp_unpack_attitude ( void *  data,
uint8_t  len 
)
static

Definition at line 88 of file mspuavobridge.c.

static bool msp_unpack_raw_imu ( void *  data,
uint8_t  len 
)
static

Definition at line 118 of file mspuavobridge.c.

static int32_t mspUavoBridge_Init ( void  )
static

Initialize the MSP to UAVO bridge module.

Return values
0success
-1failed to allocate memory
-2failed to initialize MSP parser
-3one or more UAVOs not available
Todo:
make pios_com use real pointer

Definition at line 279 of file mspuavobridge.c.

static int32_t mspUavoBridge_Start ( void  )
static

Start the MSP to UAVO bridge module.

Return values
0success
-1module not enabled
-2invalid msp bridge state, somebody else blew stack?
-3failed to create task

Definition at line 253 of file mspuavobridge.c.

static void mspUavoBridge_Task ( void *  parameters)
static

MSP to UAVO bridge main task.

Parameters
[in]parametersUnused

Definition at line 221 of file mspuavobridge.c.

static void set_baudrate ( struct msp_bridge m)
static
Todo:
teach pios_com to take a real pointer

Definition at line 166 of file mspuavobridge.c.

Variable Documentation

struct msp_message_list_item message_list[]
static
Initial value:
= {
{ .msg_id = MSP_MSG_ATTITUDE, .period = 20 },
{ .msg_id = MSP_MSG_ANALOG, .period = 100 },
{ .msg_id = MSP_MSG_RAW_IMU, .period = 50 },
}
bool module_enabled = false
static

Definition at line 76 of file mspuavobridge.c.

struct msp_bridge* msp
static

Definition at line 77 of file mspuavobridge.c.

uintptr_t pios_com_msp_id