AFBR-S50 API Reference Manual v1.5.6
AFBR-S50 Time-of-Flight Sensor SDK for Embedded Software
|
SCI Data Frames. More...
Functions | |
int32_t | SCI_Frame_TotalFrameLength (sci_frame_t const *frame) |
Returns the total number of bytes within a specified frame. | |
uint8_t | SCI_Frame_IsStartFrame (sci_frame_t const *frame) |
Determines whether the frame is a start frame. | |
uint32_t | SCI_Frame_BytesToRead (sci_frame_t const *frame) |
Returns the bytes that have been written from the buffer and not read yet. | |
void | SCI_Frame_PutChar (char c, void *frame) |
Inserts a char into the TX buffer. | |
void | SCI_Frame_SetByte (sci_frame_t *frame, uint8_t byte) |
Function for inserting a byte in a SCI frame. | |
void | SCI_Frame_Queue08s (sci_frame_t *frame, int8_t data) |
Inserts a signed byte (8-bit) into the TX buffer. | |
void | SCI_Frame_Queue16s (sci_frame_t *frame, int16_t data) |
Inserts a signed halfword (16-bit) into the TX buffer. | |
void | SCI_Frame_Queue24s (sci_frame_t *frame, int32_t data) |
Inserts a signed 3/4-word (24-bit) into the TX buffer. | |
void | SCI_Frame_Queue32s (sci_frame_t *frame, int32_t data) |
Inserts a signed word (32-bit) into the TX buffer. | |
void | SCI_Frame_Queue_Time (sci_frame_t *frame, ltc_t const *t) |
Inserts a ltc_t time stamp type into the TX buffer. | |
void | SCI_Frame_Queue08u (sci_frame_t *frame, uint8_t data) |
Inserts a unsigned byte (8-bit) into the TX buffer. | |
void | SCI_Frame_Queue16u (sci_frame_t *frame, uint16_t data) |
Inserts a unsigned halfword (16-bit) into the TX buffer. | |
void | SCI_Frame_Queue24u (sci_frame_t *frame, uint32_t data) |
Inserts a unsigned 3/4-word (24-bit) into the TX buffer. | |
void | SCI_Frame_Queue32u (sci_frame_t *frame, uint32_t data) |
Inserts a unsigned word (32-bit) into the TX buffer. | |
int8_t | SCI_Frame_Dequeue08s (sci_frame_t *frame) |
Takes a signed byte (8-bit) from the RX buffer. | |
int16_t | SCI_Frame_Dequeue16s (sci_frame_t *frame) |
Takes a signed halfword (16-bit) from the RX buffer. | |
int32_t | SCI_Frame_Dequeue24s (sci_frame_t *frame) |
Takes a signed 3/4-word (24-bit) from the RX buffer. | |
int32_t | SCI_Frame_Dequeue32s (sci_frame_t *frame) |
Takes a signed word (32-bit) from the RX buffer. | |
uint8_t | SCI_Frame_Dequeue08u (sci_frame_t *frame) |
Takes a unsigned byte (8-bit) from the RX buffer. | |
uint16_t | SCI_Frame_Dequeue16u (sci_frame_t *frame) |
Takes a unsigned halfword (16-bit) from the RX buffer. | |
uint32_t | SCI_Frame_Dequeue24u (sci_frame_t *frame) |
Takes a unsigned 3/4-word (24-bit) from the RX buffer. | |
uint32_t | SCI_Frame_Dequeue32u (sci_frame_t *frame) |
Takes a unsigned word (32-bit) from the RX buffer. | |
SCI Data Frames.
The SCI Data Frame Interface. Contains functionality to enqueue/dequeue different data types to/from an specified sci_frame_t object. This is mainly used to define the SCI commands and implement the data serialization.
uint32_t SCI_Frame_BytesToRead | ( | sci_frame_t const * | frame | ) |
Returns the bytes that have been written from the buffer and not read yet.
Does calculate the total number of bytes to be read in the buffer. Especially it does not heed the byte stuffing and counts escape bytes as well as normal bytes.
frame | The frame to count the data bytes. |
int8_t SCI_Frame_Dequeue08s | ( | sci_frame_t * | frame | ) |
Takes a signed byte (8-bit) from the RX buffer.
frame | The frame to take the data from. |
uint8_t SCI_Frame_Dequeue08u | ( | sci_frame_t * | frame | ) |
Takes a unsigned byte (8-bit) from the RX buffer.
frame | The frame to take the data from. |
int16_t SCI_Frame_Dequeue16s | ( | sci_frame_t * | frame | ) |
Takes a signed halfword (16-bit) from the RX buffer.
frame | The frame to take the data from. |
uint16_t SCI_Frame_Dequeue16u | ( | sci_frame_t * | frame | ) |
Takes a unsigned halfword (16-bit) from the RX buffer.
frame | The frame to take the data from. |
int32_t SCI_Frame_Dequeue24s | ( | sci_frame_t * | frame | ) |
Takes a signed 3/4-word (24-bit) from the RX buffer.
frame | The frame to take the data from. |
uint32_t SCI_Frame_Dequeue24u | ( | sci_frame_t * | frame | ) |
Takes a unsigned 3/4-word (24-bit) from the RX buffer.
frame | The frame to take the data from. |
int32_t SCI_Frame_Dequeue32s | ( | sci_frame_t * | frame | ) |
Takes a signed word (32-bit) from the RX buffer.
frame | The frame to take the data from. |
uint32_t SCI_Frame_Dequeue32u | ( | sci_frame_t * | frame | ) |
Takes a unsigned word (32-bit) from the RX buffer.
frame | The frame to take the data from. |
uint8_t SCI_Frame_IsStartFrame | ( | sci_frame_t const * | frame | ) |
Determines whether the frame is a start frame.
If the specified frame is a start frame, i.e. the first frame of a sequence of multiple frames that starts with a start byte, the function returns true. False elsewise.
frame | The frame to check for the start byte. |
void SCI_Frame_PutChar | ( | char | c, |
void * | frame | ||
) |
Inserts a char into the TX buffer.
The char is checked for byte stuffing and thus it might additionally add an escape byte to the buffer.
c | The char to append. |
frame | The frame to put the data. |
void SCI_Frame_Queue08s | ( | sci_frame_t * | frame, |
int8_t | data | ||
) |
Inserts a signed byte (8-bit) into the TX buffer.
The byte is checked for byte stuffing and thus it might additionally add an escape byte to the buffer.
frame | The frame to put the data. |
data | The byte to append. |
void SCI_Frame_Queue08u | ( | sci_frame_t * | frame, |
uint8_t | data | ||
) |
Inserts a unsigned byte (8-bit) into the TX buffer.
The byte is checked for byte stuffing and thus it might additionally add an escape byte to the buffer.
frame | The frame to put the data. |
data | The byte to append. |
void SCI_Frame_Queue16s | ( | sci_frame_t * | frame, |
int16_t | data | ||
) |
Inserts a signed halfword (16-bit) into the TX buffer.
The two bytes are checked for byte stuffing and thus it might additionally add escape bytes to the buffer.
frame | The frame to put the data. |
data | The data to append. |
void SCI_Frame_Queue16u | ( | sci_frame_t * | frame, |
uint16_t | data | ||
) |
Inserts a unsigned halfword (16-bit) into the TX buffer.
The two bytes are checked for byte stuffing and thus it might additionally add escape bytes to the buffer.
frame | The frame to put the data. |
data | The data to append. |
void SCI_Frame_Queue24s | ( | sci_frame_t * | frame, |
int32_t | data | ||
) |
Inserts a signed 3/4-word (24-bit) into the TX buffer.
The three least significant bytes are added to the buffer. They are checked for byte stuffing and thus it might additionally add escape bytes to the buffer.
frame | The frame to put the data. |
data | The data to append. |
void SCI_Frame_Queue24u | ( | sci_frame_t * | frame, |
uint32_t | data | ||
) |
Inserts a unsigned 3/4-word (24-bit) into the TX buffer.
The three least significant bytes are added to the buffer. They are checked for byte stuffing and thus it might additionally add escape bytes to the buffer.
frame | The frame to put the data. |
data | The data to append. |
void SCI_Frame_Queue32s | ( | sci_frame_t * | frame, |
int32_t | data | ||
) |
Inserts a signed word (32-bit) into the TX buffer.
The four bytes are checked for byte stuffing and thus it might additionally add escape bytes to the buffer.
frame | The frame to put the data. |
data | The data to append. |
void SCI_Frame_Queue32u | ( | sci_frame_t * | frame, |
uint32_t | data | ||
) |
Inserts a unsigned word (32-bit) into the TX buffer.
The four bytes are checked for byte stuffing and thus it might additionally add escape bytes to the buffer.
frame | The frame to put the data. |
data | The data to append. |
void SCI_Frame_Queue_Time | ( | sci_frame_t * | frame, |
ltc_t const * | t | ||
) |
Inserts a ltc_t time stamp type into the TX buffer.
The time stamp is added as 6 byte wide value, i.e.
The four bytes are checked for byte stuffing and thus it might additionally add escape bytes to the buffer.
frame | The frame to put the data. |
t | The time stamp data to append. |
void SCI_Frame_SetByte | ( | sci_frame_t * | frame, |
uint8_t | byte | ||
) |
Function for inserting a byte in a SCI frame.
frame | The frame to insert the byte. |
byte | The byte to insert. |
int32_t SCI_Frame_TotalFrameLength | ( | sci_frame_t const * | frame | ) |
Returns the total number of bytes within a specified frame.
Does calculate the total number of bytes that have been written into the buffer. Especially it does not heed the byte stuffing and counts escape bytes as well as normal bytes.
frame | The frame to count the data bytes. |