Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
lisa_stm_gps_passthrough_main.c File Reference
#include "mcu.h"
#include "mcu_periph/sys_time.h"
#include "lisa/lisa_overo_link.h"
#include "lisa/lisa_spistream.h"
#include "generated/airframe.h"
#include "mcu_periph/uart.h"
#include "led.h"
+ Include dependency graph for lisa_stm_gps_passthrough_main.c:

Go to the source code of this file.

Data Structures

struct  spistream_uart_msg
 
struct  uart_state
 

Functions

static void main_init (void)
 
static void main_periodic (void)
 
static void main_event (void)
 
static void uart_transfer_event (void)
 spistream stress test: Send big (500-700 bytes) messages with different message lengths for every channel and length varying in every message. More...
 
static void on_spistream_msg_received (uint8_t msg_id, uint8_t *data, uint16_t num_bytes)
 Handler for commands (messages from Overo->STM). More...
 
static void on_spistream_msg_sent (uint8_t msg_id)
 
static void on_overo_link_msg_received (void)
 Every SPI transfer contains exactly two packages of type AutopilotMessagePTStream, one for each direction (up: STM->Overo, down: Overo->STM). More...
 
static void on_overo_link_lost (void)
 
static void on_overo_link_crc_failed (void)
 
int main (void)
 

Variables

static struct spistream_uart_msg spistream_uart1_msg
 
static struct spistream_uart_msg spistream_uart2_msg
 
static struct spistream_uart_msg spistream_uart3_msg
 
static uint8_t spistream_wait_for_num_transfers = 0
 

Function Documentation

int main ( void  )

Definition at line 77 of file lisa_stm_gps_passthrough_main.c.

References main_event(), main_init(), main_periodic(), and sys_time_check_and_ack_timer().

+ Here is the call graph for this function:

static void main_event ( void  )
inlinestatic

Definition at line 163 of file lisa_stm_gps_passthrough_main.c.

References on_overo_link_crc_failed(), on_overo_link_msg_received(), OveroLinkEvent, and uart_transfer_event().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void main_init ( void  )
inlinestatic
static void main_periodic ( void  )
inlinestatic

Definition at line 132 of file lisa_stm_gps_passthrough_main.c.

References LED_PERIODIC, on_overo_link_lost(), and OveroLinkPeriodic.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void on_overo_link_crc_failed ( void  )
inlinestatic

Definition at line 160 of file lisa_stm_gps_passthrough_main.c.

Referenced by main_event().

+ Here is the caller graph for this function:

static void on_overo_link_lost ( void  )
inlinestatic

Definition at line 157 of file lisa_stm_gps_passthrough_main.c.

Referenced by main_periodic().

+ Here is the caller graph for this function:

static void on_overo_link_msg_received ( void  )
inlinestatic

Every SPI transfer contains exactly two packages of type AutopilotMessagePTStream, one for each direction (up: STM->Overo, down: Overo->STM).

As we delegate SPI message handling to spistream, the SPI event just passes both packages to spistream_read_pkg(down_pkg) and spistream_write_pkg(up_pkg). Apart from that, we just don't care about the SPI driver itself.

Definition at line 151 of file lisa_stm_gps_passthrough_main.c.

References LisaOveroLink::down, LisaOveroLink::msg, overo_link, spistream_read_pkg(), spistream_write_pkg(), and LisaOveroLink::up.

Referenced by main_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void on_spistream_msg_received ( uint8_t  msg_id,
uint8_t data,
uint16_t  num_bytes 
)
inlinestatic

Handler for commands (messages from Overo->STM).

Right now, it is just sending the command back for debugging purposes.

Definition at line 119 of file lisa_stm_gps_passthrough_main.c.

References SPISTREAM_NO_WAIT, and spistream_send_msg().

Referenced by main_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void on_spistream_msg_sent ( uint8_t  msg_id)
inlinestatic

Definition at line 126 of file lisa_stm_gps_passthrough_main.c.

References spistream_wait_for_num_transfers.

Referenced by main_init().

+ Here is the caller graph for this function:

static void uart_transfer_event ( void  )
inlinestatic

spistream stress test: Send big (500-700 bytes) messages with different message lengths for every channel and length varying in every message.

Fool around with timeout to increase/decrease message rate to see when it can't keep up any more.

Definition at line 229 of file lisa_stm_gps_passthrough_main.c.

References LED_OFF, LED_ON, SPISTREAM_MAX_MESSAGE_LENGTH, spistream_send_msg(), spistream_uart1_msg, spistream_uart2_msg, spistream_uart3_msg, spistream_wait_for_num_transfers, SPISTREAM_WAIT_FOR_READ, uart_char_available(), spistream_uart_msg::uart_data, and uart_getch().

Referenced by main_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct spistream_uart_msg spistream_uart1_msg
static

Definition at line 65 of file lisa_stm_gps_passthrough_main.c.

Referenced by main_init(), and uart_transfer_event().

struct spistream_uart_msg spistream_uart2_msg
static

Definition at line 66 of file lisa_stm_gps_passthrough_main.c.

Referenced by main_init(), and uart_transfer_event().

struct spistream_uart_msg spistream_uart3_msg
static

Definition at line 67 of file lisa_stm_gps_passthrough_main.c.

Referenced by main_init(), and uart_transfer_event().

uint8_t spistream_wait_for_num_transfers = 0
static

Definition at line 75 of file lisa_stm_gps_passthrough_main.c.

Referenced by on_spistream_msg_sent(), and uart_transfer_event().