91 #include "ti_msp_dl_config.h" 100 #define PREAMBLE_BYTE (0xFE) 102 #define PREAMBLE_BYTE_SIZE (0) 105 #define TARGET_ADDR (0xAD) 107 #define BROADCAST_ADDR (0xFF) 111 #define START_IDX (0) 113 #define START_BYTE_SIZE (1) 115 #define FRAME_START_BYTE (0x68) 119 #define TARGET_ADDR_IDX (START_IDX + START_BYTE_SIZE) 121 #define TARGET_ADDR_SIZE (1) 125 #define CTRL_IDX (TARGET_ADDR_IDX + TARGET_ADDR_SIZE) 127 #define CTRL_SIZE (1) 129 #define CMD_MASK (0x80) 131 #define CRC_MASK (0x40) 133 #define LEN_MASK (0x1F) 135 #define WRITE_CMD (0x80) 137 #define READ_CMD (0x00) 140 #define HEADER_SIZE (START_BYTE_SIZE + TARGET_ADDR_SIZE + CTRL_SIZE) 144 #define MEM_ADDR_IDX (CTRL_IDX + CTRL_SIZE) 146 #define MEM_ADDR_SIZE (4) 149 #define MEM_ADDR_RANGE_START (0x0) 151 #define MEM_ADDR_RANGE_END (0xFFFFFFFF) 155 #define DATA_IDX (MEM_ADDR_IDX + MEM_ADDR_SIZE) 157 #define MAX_DATA_SIZE (32) 160 #define ACK_WRITE (0xAC) 165 #define CRC_OFFSET (END_OFFSET + CRC_SIZE) 171 #define END_OFFSET (1) 173 #define FRAME_END_BYTE (0x16) 175 #define END_BYTE_SIZE (1) 181 #define TRAILER_SIZE (END_BYTE_SIZE) 183 #define MAX_BUFFER_SIZE (HEADER_SIZE + MEM_ADDR_SIZE + MAX_DATA_SIZE + CRC_SIZE + TRAILER_SIZE) 185 #define ERROR_OFFSET (7) 187 #define DMA_RX_TRANSFER_SIZE (71) Definition: uart_comm.h:203
Definition: uart_comm.h:220
Definition: uart_comm.h:218
UART_Status status
Definition: uart_comm.h:243
Definition: uart_comm.h:226
_Bool isCrc
Definition: uart_comm.h:240
UART instance.
Definition: uart_comm.h:230
uint8_t ptr
Definition: uart_comm.h:194
#define MAX_BUFFER_SIZE
Maximum buffer size.
Definition: uart_comm.h:183
ErrorType
UART ERROR types.
Definition: uart_comm.h:213
BufferInfo txMsg
Definition: uart_comm.h:233
UART_Status
UART status.
Definition: uart_comm.h:200
Definition: uart_comm.h:216
Buffer info structure.
Definition: uart_comm.h:190
UART_Instance * pUART
Extern UART instance.
void UART_init(UART_Instance *UART_handle)
Initializes the UART module.
Definition: uart_comm.c:167
Definition: uart_comm.h:205
void DMA_RX_init(UART_Instance *UART_handle)
Initializes DMA to store the command in RX Buffer.
Definition: uart_comm.c:491
Definition: uart_comm.h:224
Definition: uart_comm.h:209
BufferInfo rxMsg
Definition: uart_comm.h:235
uint8_t len
Definition: uart_comm.h:196
ErrorType error
Definition: uart_comm.h:245
void UART_getFrameLength(UART_Instance *UART_handle)
Decodes frame length from buffer.
Definition: uart_comm.c:242
Definition: uart_comm.h:207
uint8_t dataLen
Definition: uart_comm.h:238
void UART_checkForCommand(UART_Instance *UART_handle)
Checks the Rx Buffer for commands.
Definition: uart_comm.c:180
Definition: uart_comm.h:222