This is where the framing/deframing and transmission happens for UART frames. More...
Data Structures | |
struct | UART_MSG_RX_OBJ |
UART msg receive object. More... | |
struct | UART_MSG_TX_OBJ |
UART msg Transmit object. More... | |
Macros | |
#define | PBV_CRC_POLYNOM 0x8005 |
Standard PBV CRC Polynomial. For documentation, as it is not used in calculation in this file. | |
#define | PBV_CRC_POLYNOM_REV 0xA001 |
Reversed polynomial. needed for odd byte in the data stream. | |
#define | PBV_ReadyToSend UART1_IsTxReady |
linking functions with UART mcc driver functions | |
#define | PBV_Write UART1_Write |
linking functions with UART mcc driver functions | |
#define | PBV_IsRxReady UART1_IsRxReady |
linking functions with UART mcc driver functions | |
#define | PBV_Read UART1_Read |
linking functions with UART mcc driver functions | |
Typedefs | |
typedef struct UART_MSG_RX_OBJ | UART_MSG_RX_OBJ_t |
UART msg receive object. | |
typedef struct UART_MSG_TX_OBJ | UART_MSG_TX_OBJ_t |
UART msg Transmit object. | |
Functions | |
void | PBV_UART_Init (PBV_Datatype_TX_t *Board_To_PBV, PBV_Datatype_TX_t *Board_To_PBVAscii, PBV_Datatype_RX_t *Pbv_To_Board) |
uint8_t | PBV_UART_Receive_from_GUI () |
implements the state machine for UART Frame receiving from PBV. | |
uint8_t | PBV_UART_Transmit_Ascii_to_GUI () |
uint8_t | PBV_UART_Transmit_to_GUI () |
Variables | |
UART_MSG_TX_OBJ_t | PBV_UART_Object_TX |
UART object for numeric tx. | |
UART_MSG_RX_OBJ_t | PBV_UART_Object_RX |
UART object for numeric rx. | |
UART_MSG_TX_OBJ_t | PBV_UART_Object_ASCII |
UART object for ascii tx. | |
This is where the framing/deframing and transmission happens for UART frames. The fundamental difference between this and CAN-FD frames is that CAN-FD defines a strategy for framing and deframing data, and PBV follows that strategy. UART is a point to point byte by byte transfer of data. To build a frame on top of it, another layer is needed where the data is framed/deframed and trasnmitted. It defines an additional statemachine
#define PBV_CRC_POLYNOM 0x8005 |
Definition at line 23 of file app_PBV_UART.c.
#define PBV_CRC_POLYNOM_REV 0xA001 |
Definition at line 30 of file app_PBV_UART.c.
#define PBV_IsRxReady UART1_IsRxReady |
Definition at line 51 of file app_PBV_UART.c.
#define PBV_Read UART1_Read |
Definition at line 58 of file app_PBV_UART.c.
#define PBV_ReadyToSend UART1_IsTxReady |
Definition at line 37 of file app_PBV_UART.c.
#define PBV_Write UART1_Write |
Definition at line 44 of file app_PBV_UART.c.
typedef struct UART_MSG_RX_OBJ UART_MSG_RX_OBJ_t |
UART RX Object data type
typedef struct UART_MSG_TX_OBJ UART_MSG_TX_OBJ_t |
UART TX Object data type
void PBV_UART_Init | ( | PBV_Datatype_TX_t * | Board_To_PBV, |
PBV_Datatype_TX_t * | Board_To_PBVAscii, | ||
PBV_Datatype_RX_t * | Pbv_To_Board ) |
PBV_Datatype_TX_t | * - ptr to numerical data |
PBV_Datatype_TX_t | * - ptr to ascii data |
PBV_Datatype_TX_t | * - ptr to received data ( for completeness, not used now) |
initializes UART objects with application objects. Also initializes uartActiveTx and uartActiveTxAscii
Definition at line 171 of file app_PBV_UART.c.
uint8_t PBV_UART_Receive_from_GUI | ( | ) |
implements the state machine for message RX. maintains internal state machine states as defined in RCV_<STATES>
< local copy created to pass to CRC function. TODO: could use the UART RX object, i.e. data, and header as they are stored regardless. but the CRC implementation would then require some work.
< calculating CRC. data for CRC [header][data]
Definition at line 197 of file app_PBV_UART.c.
uint8_t PBV_UART_Transmit_Ascii_to_GUI | ( | ) |
uint8_t PBV_UART_Transmit_to_GUI | ( | ) |
implements the state machine for numerical TX
Definition at line 410 of file app_PBV_UART.c.
UART_MSG_TX_OBJ_t PBV_UART_Object_ASCII |
Definition at line 159 of file app_PBV_UART.c.
UART_MSG_RX_OBJ_t PBV_UART_Object_RX |
Definition at line 153 of file app_PBV_UART.c.
UART_MSG_TX_OBJ_t PBV_UART_Object_TX |
Definition at line 147 of file app_PBV_UART.c.