PLC Service Universal Serial Interface.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | cmd_params_t |
struct | map_buffers_t |
struct | map_ports_t |
struct | map_protocols_t |
struct | USI_param_t |
Enumerations | |
enum | { RX_IDLE, RX_MSG, RX_ESC, RX_EORX } |
enum | { TX_IDLE, TX_MSG } |
Functions | |
static void | _cbInternalProtocol (uint8_t uc_port_idx, uint8_t uc_cmd) |
This function decodes internal protocol messages. More... | |
static uint16_t | _decode_copy (uint8_t *puc_dest, uint8_t *puc_orig, uint16_t us_size) |
Decodes the escape sequences and copies the result into the destination buffer. More... | |
static uint8_t | _doEoMsg (uint8_t uc_port) |
This function processes received message. More... | |
static uint8_t | _getPortFromProtocol (uint8_t uc_p_type) |
This function extracts the port where the protocol is mapped to. More... | |
static uint8_t | _process_msg (uint8_t uc_port) |
This function processes the complete received message. More... | |
static usi_status_t | _usi_encode_and_send (uint8_t uc_port_idx, cmd_params_t *msg) |
Encodes the escape characters and transmits the message. More... | |
uint8_t | baseMng_receivedCmd (uint8_t *puc_rx_msg, uint16_t us_len))) |
uint8_t | Dummy_serial_parser (uint8_t *puc_rx_msg, uint16_t us_len) |
Dummy serialization function. More... | |
uint8_t | mngl_rcv_cmd (uint8_t *puc_rx_msg, uint16_t us_len))) |
uint8_t | phySerial_receivedCmd (uint8_t *puc_rx_msg, uint16_t us_len))) |
uint8_t | serial_432_if_api_parser (uint8_t *puc_rx_msg, uint16_t us_len))) |
uint8_t | serial_if_api_parser (uint8_t *puc_rx_msg, uint16_t us_len))) |
uint8_t | serial_if_mac_api_parser (uint8_t *puc_rx_msg, uint16_t us_len))) |
uint8_t | serial_if_mlme_api_parser (uint8_t *puc_rx_msg, uint16_t us_len))) |
uint8_t | serial_if_plme_api_parser (uint8_t *puc_rx_msg, uint16_t us_len))) |
uint8_t | serial_if_sniffer_api_parser (uint8_t *puc_rx_msg, uint16_t us_len))) |
Received message. More... | |
uint8_t | serial_if_user_def_api_parser (uint8_t *puc_rx_msg, uint16_t us_len))) |
usi_status_t | usi_send_cmd (void *msg) |
Function to transmit data through USI. More... | |
Universal Serial Interface API functions | |
void | usi_txrx_block_timer (void) |
Function that updates the USI flow control timers. More... | |
void | usi_process (void) |
Function to perform the USI RX process. More... | |
void | usi_init (void) |
Create RX and TX USI tasks, and timer to update internal counters. More... | |
Variables | |
pf_usi_decode_cmd | cbFnPhySerial = NULL |
static uint8_t | puc_rx_aux_buf [TXAUX_SIZE+2] |
static uint8_t | puc_tx_aux_buf [TXAUX_SIZE+2] |
static const map_buffers_t | usi_aux_rx_buf = {2 * TXAUX_SIZE + 2, &puc_rx_aux_buf[0]} |
static const map_buffers_t | usi_aux_tx_buf = {TXAUX_SIZE + 2, &puc_tx_aux_buf[0]} |
const map_buffers_t *const | usi_cfg_aux_rx_buf = &usi_aux_rx_buf |
const map_buffers_t *const | usi_cfg_aux_tx_buf = &usi_aux_tx_buf |
const map_ports_t *const | usi_cfg_map_ports = &usiMapPorts[0] |
const map_protocols_t *const | usi_cfg_map_protocols = &usi_map_protocols[0] |
static USI_param_t | usi_cfg_param [NUM_PORTS] |
map_buffers_t *const | usi_cfg_rx_buf = &usi_rx_buf[0] |
const map_buffers_t *const | usi_cfg_tx_buf = &usi_tx_buf[0] |
Port Mapping. Configured with the values provided in conf_usi.h: | |
MapPorts[PORT TYPE, PORT CHANNEL, PORT SPEED, TX BUFFER SIZE, RX BUFFER SIZE] | |
static const map_ports_t | usiMapPorts [NUM_PORTS+1] |
Macro operators | |
#define | TYPE_PROTOCOL(A) ((A)&TYPE_PROTOCOL_MSK) |
#define | LEN_PROTOCOL(A, B) ((((uint16_t)(A)) << LEN_PROTOCOL_HI_SHIFT) + ((B) >> LEN_PROTOCOL_LO_SHIFT)) |
#define | XLEN_PROTOCOL(A, B, C) ((((uint16_t)(A)) << LEN_PROTOCOL_HI_SHIFT) + ((B) >> LEN_PROTOCOL_LO_SHIFT) + (((uint16_t)(C)&XLEN_PROTOCOL_MSK) << XLEN_PROTOCOL_SHIFT_L)) |
#define | LEN_HI_PROTOCOL(A) (((uint16_t)(A) >> LEN_PROTOCOL_HI_SHIFT) & LEN_PROTOCOL_HI_MSK) |
#define | LEN_LO_PROTOCOL(A) (((uint16_t)(A) << LEN_PROTOCOL_LO_SHIFT) & LEN_PROTOCOL_LO_MSK) |
#define | LEN_EX_PROTOCOL(A) (((uint16_t)(A & 0x0c00)) >> 4) |
#define | CMD_PROTOCOL(A) ((A)&CMD_PROTOCOL_MSK) |
static uint8_t | uc_message_status |
cmd_params_t | internal_command |
uint8_t | uc_int_cmd_lock = CMD_LOCK_PORT |
uint8_t | uc_int_cmd_unlock = CMD_UNLOCK_PORT |
Protocol Mapping. Configured with the values provided in conf_usi.h: | |
#define | CONF_PORT(type, channel, speed, tx_size, rx_size) {type, channel, speed, tx_size, rx_size} |
#define | CONF_PORT(type, channel, speed, tx_size, rx_size) rx_size |
#define | CONF_PORT(type, channel, speed, tx_size, rx_size) tx_size |
#define | TXAUX_SIZE 0 |
#define | TXAUX_SIZE PORT_0 |
static const map_protocols_t | usi_map_protocols [NUM_PROTOCOLS+1] |
static uint8_t | puc_rxbuf0 [PORT_0] |
static map_buffers_t | usi_rx_buf [NUM_PORTS+1] |
static uint8_t | puc_txbuf0 [PORT_0] |
static const map_buffers_t | usi_tx_buf [NUM_PORTS+1] |