Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stereoprotocol.h File Reference

standard protocol for TUDelft stereocamera data transfer More...

#include <inttypes.h>
#include "mcu_periph/link_device.h"
+ Include dependency graph for stereoprotocol.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MsgProperties
 

Typedefs

typedef struct MsgProperties MsgProperties
 

Functions

uint16_t stereoprot_add (uint16_t counter, uint16_t i, uint16_t buffer_size)
 Increment circular buffer counter by i. More...
 
uint16_t stereoprot_diff (uint16_t counter, uint16_t i, uint16_t buffer_size)
 Decrement circular buffer counter by i. More...
 
uint8_t stereoprot_isEndOfMsg (uint8_t *stack, uint16_t i, uint16_t buffer_size)
 Checks if the sequence in the array is equal to 255-0-0-171, as this means that this is the end of an image. More...
 
uint8_t stereoprot_isStartOfMsg (uint8_t *stack, uint16_t i, uint16_t buffer_size)
 Checks if the sequence in the array is equal to 255-0-0-171, as this means a new image is starting from here. More...
 
void WritePart (struct link_device *, uint8_t *, uint8_t)
 
void stereoprot_sendArray (struct link_device *fd, uint8_t *b, uint8_t array_width, uint8_t array_height)
 
uint8_t handleStereoPackage (uint8_t newByte, uint16_t buffer_size, uint16_t *insert_loc, uint16_t *extract_loc, uint16_t *msg_start, uint8_t *msg_buf, uint8_t *ser_read_buf, uint8_t *stereocam_datadata_new, uint8_t *stereocam_datalen, uint8_t *stereocam_data_matrix_width, uint8_t *stereocam_data_matrix_height)
 Get all available data from stereo com link and decode any complete messages. More...
 
void stereoprot_get_msg_properties (uint8_t *raw, MsgProperties *properties, uint16_t start, uint16_t buffer_size)
 Retrieve size of image from message. More...
 

Detailed Description

standard protocol for TUDelft stereocamera data transfer

Definition in file stereoprotocol.h.


Data Structure Documentation

struct MsgProperties

Definition at line 33 of file stereoprotocol.h.

Data Fields
uint8_t height
uint16_t positionImageStart
uint8_t width

Typedef Documentation

typedef struct MsgProperties MsgProperties

Definition at line 38 of file stereoprotocol.h.

Function Documentation

uint8_t handleStereoPackage ( uint8_t  newByte,
uint16_t  buffer_size,
uint16_t insert_loc,
uint16_t extract_loc,
uint16_t msg_start,
uint8_t msg_buf,
uint8_t ser_read_buf,
uint8_t stereocam_datadata_new,
uint8_t stereocam_datalen,
uint8_t stereocam_data_matrix_width,
uint8_t stereocam_data_matrix_height 
)

Get all available data from stereo com link and decode any complete messages.

Returns as soon as a complete message is found. Messages placed in msg_buf

Definition at line 114 of file stereoprotocol.c.

References extract_loc, MsgProperties::height, insert_loc, msgProperties, stereoprot_add(), stereoprot_diff(), stereoprot_get_msg_properties(), stereoprot_isEndOfMsg(), stereoprot_isStartOfMsg(), and MsgProperties::width.

Referenced by stereocam_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint16_t stereoprot_add ( uint16_t  counter,
uint16_t  i,
uint16_t  buffer_size 
)

Increment circular buffer counter by i.

Definition at line 32 of file stereoprotocol.c.

Referenced by handleStereoPackage(), stereocam_periodic(), stereoprot_get_msg_properties(), stereoprot_isEndOfMsg(), and stereoprot_isStartOfMsg().

+ Here is the caller graph for this function:

uint16_t stereoprot_diff ( uint16_t  counter,
uint16_t  i,
uint16_t  buffer_size 
)

Decrement circular buffer counter by i.

Definition at line 41 of file stereoprotocol.c.

Referenced by handleStereoPackage(), and stereoprot_get_msg_properties().

+ Here is the caller graph for this function:

void stereoprot_get_msg_properties ( uint8_t raw,
MsgProperties properties,
uint16_t  start,
uint16_t  buffer_size 
)

Retrieve size of image from message.

Definition at line 169 of file stereoprotocol.c.

References MsgProperties::height, stereoprot_add(), stereoprot_diff(), and MsgProperties::width.

Referenced by handleStereoPackage().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t stereoprot_isEndOfMsg ( uint8_t stack,
uint16_t  i,
uint16_t  buffer_size 
)

Checks if the sequence in the array is equal to 255-0-0-171, as this means that this is the end of an image.

Definition at line 50 of file stereoprotocol.c.

References stereoprot_add().

Referenced by handleStereoPackage().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t stereoprot_isStartOfMsg ( uint8_t stack,
uint16_t  i,
uint16_t  buffer_size 
)

Checks if the sequence in the array is equal to 255-0-0-171, as this means a new image is starting from here.

Definition at line 64 of file stereoprotocol.c.

References stereoprot_add().

Referenced by handleStereoPackage().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void stereoprot_sendArray ( struct link_device fd,
uint8_t b,
uint8_t  array_width,
uint8_t  array_height 
)

Definition at line 85 of file stereoprotocol.c.

References WritePart().

Referenced by write_serial_rot().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WritePart ( struct link_device ,
uint8_t ,
uint8_t   
)

Definition at line 77 of file stereoprotocol.c.

References link_device::check_free_space, link_device::periph, and link_device::put_byte.

Referenced by stereoprot_sendArray().

+ Here is the caller graph for this function: