|
brazos-trapezoidal
|
Header file of Tsp. More...


Go to the source code of this file.
Classes | |
| struct | TSP_TYPE |
| struct | TSP_PARSER_TYPE |
Typedefs | |
| typedef void(*const | TSP_PARSER_RECEIVE_FUNCTION_TYPE) (TSP_TYPE *) |
Functions | |
| void | Tsp__Initialize (void) |
| It Initializes the module Tsp and its variables. More... | |
| void | Tsp__FastHandler (void) |
| void | Tsp__SlowHandler (void) |
| BOOL_TYPE | Tsp__Send (BOOL_TYPE is_retry) |
| Method to send Tsp message. More... | |
| void | Tsp__LoadData (unsigned char adress, unsigned char num_of_bytes, unsigned char api, unsigned char *data) |
| typedef void(*const TSP_PARSER_RECEIVE_FUNCTION_TYPE) (TSP_TYPE *) |
| void Tsp__FastHandler | ( | void | ) |
@brief Fast Handler for the module @details Must be called at a fast rate (1ms)
Checks if there is a new message in the Serial buffer.
Check pass_phrase in the package (last 2 bytes before the CRC)
Checks if the message is for this node or if it is a broadcast
If message was not for this node ignore it
Check CRC, if bad crc cleans the message
If is a discovery package
If the control pass phrase is wrong, send a bad ACK
If the version pass phrase is wrong, send a bad ACK
If the message was for this node and the crc is ok, Send AcK Also runs the APIs parsed functions
Runs the APIs receive functions defined in the prv file
Load ACK data to RX
If the message is an ack
| void Tsp__Initialize | ( | void | ) |
| void Tsp__LoadData | ( | unsigned char | adress, |
| unsigned char | num_of_bytes, | ||
| unsigned char | api, | ||
| unsigned char * | data | ||
| ) |
| BOOL_TYPE Tsp__Send | ( | BOOL_TYPE | wait_ack | ) |
Method to send Tsp message.
This method will send the data previously loaded to TX_Tsp_Data, it will check first if there is free space in the Ack Buffer before sending the message. Also it is necessary to define if this is a retry message, so it will not create another Ack.
| _Bool | wait_ack: TRUE_T for wait to receiving an Ack, FALSE_T if this is not to wait for an ack retry message. |
Find free buffer space
If there Ack Buffer is Full the new message will not be loaded.
If not sending Ack and there is space in the Ack Buffer, wait for Ack