This module provides configuration and utils for the serialization of protocols in PLC.
Data Structures | |
struct | cmd_params_t |
struct | map_buffers_t |
struct | map_ports_t |
struct | map_protocols_t |
struct | USI_param_t |
struct | x_usi_serial_cmd_params_t |
Macros | |
#define | CMD_PRIME_PROTOCOL(A) ((A)&CMD_PRIME_PROTOCOL_MSK) |
#define | CMD_PRIME_PROTOCOL_MSK 0x3F |
#define | MIN_OVERHEAD 5 |
#define | MNGP_PRIME_EN_PIBQRY 0x06 |
#define | MNGP_PRIME_EN_PIBRSP 0x07 |
#define | MNGP_PRIME_FU 0x05 |
#define | MNGP_PRIME_GETQRY 0x00 |
#define | MNGP_PRIME_GETRSP 0x01 |
#define | MNGP_PRIME_PROT 0x00 |
#define | MNGP_PRIME_REBOOT 0x04 |
#define | MNGP_PRIME_RESET 0x03 |
#define | MNGP_PRIME_SET 0x02 |
#define | UART_TYPE 0 |
#define | USART_TYPE 1 |
Typedefs | |
typedef uint8_t(* | pf_usi_decode_cmd )(uint8_t *, uint16_t) |
Enumerations | |
enum | { RX_IDLE, RX_MSG, RX_ESC, RX_EORX } |
enum | { TX_IDLE, TX_MSG } |
enum | usi_protocol_t { PROTOCOL_SNIF_PRIME = 0x13, PROTOCOL_MAC_PRIME = 0x17, PROTOCOL_MLME_PRIME = 0x18, PROTOCOL_PLME_PRIME = 0x19, PROTOCOL_432_PRIME = 0x1A, PROTOCOL_BASEMNG_PRIME = 0x1D, PROTOCOL_PRIME_SERIAL = 0x1F, PROTOCOL_ATPL230 = 0x22, PROTOCOL_USER_DEFINED = 0xFE, PROTOCOL_INVALID = 0xFF } |
enum | usi_status_t { USI_STATUS_PROTOCOL_NOT_FOUND = 0xFF, USI_STATUS_TX_BUFFER_OVERFLOW, USI_STATUS_TX_BUSY, USI_STATUS_TX_BLOCKED, USI_STATUS_RX_BUFFER_OVERFLOW, USI_STATUS_RX_BLOCKED, USI_STATUS_UART_ERROR, USI_STATUS_FORMAT_ERROR, USI_STATUS_OK, USI_STATUS_INVALID } |
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))) |
Received message. More... | |
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))) |
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... | |
USI flow control internal protocol | |
#define | PROTOCOL_INTERNAL 0x3F |
#define | CMD_LOCK_PORT 0 |
#define | CMD_UNLOCK_PORT 1 |
#define | INTERNAL_MSG_LEN 1 |
#define | MAX_ESCAPED_INTERNAL_MSG_LEN 10 |
#define | TX_BLOCK_TIMEOUT 50 |
#define | RX_BLOCK_TIMEOUT 50 |
#define | TXRX_BLOCK_UPDATE 1 |
#define | TYPE_PROTOCOL_OFFSET 1 |
#define | TYPE_PROTOCOL_MSK 0x3F |
#define | LEN_PROTOCOL_HI_OFFSET 0 |
#define | LEN_PROTOCOL_HI_MSK 0xFF |
#define | LEN_PROTOCOL_HI_SHIFT 2 |
#define | LEN_PROTOCOL_LO_OFFSET 1 |
#define | LEN_PROTOCOL_LO_MSK 0xC0 |
#define | LEN_PROTOCOL_LO_SHIFT 6 |
#define | XLEN_PROTOCOL_OFFSET 2 |
#define | XLEN_PROTOCOL_MSK 0xC0 |
#define | XLEN_PROTOCOL_SHIFT_L 4 |
#define | XLEN_PROTOCOL_SHIFT_R 10 |
#define | PAYLOAD_OFFSET 2 |
#define | CMD_PROTOCOL_OFFSET 2 |
#define | CMD_PROTOCOL_MSK 0x3F |
Macro operators | |
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 |
#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) |
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] |
Protocol Mapping. Configured with the values provided in conf_usi.h: | |
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] |
#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 |
typedef uint8_t(* | pf_usi_get_cmd )(void) |
typedef void(* | pf_usi_set_cmd )(uint8_t) |
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... | |
#define CMD_LOCK_PORT 0 |
Referenced by _cbInternalProtocol().
#define CMD_PRIME_PROTOCOL | ( | A | ) | ((A)&CMD_PRIME_PROTOCOL_MSK) |
#define CMD_PRIME_PROTOCOL_MSK 0x3F |
#define CMD_PROTOCOL | ( | A | ) | ((A)&CMD_PROTOCOL_MSK) |
Referenced by _usi_encode_and_send().
#define CMD_PROTOCOL_MSK 0x3F |
#define CMD_PROTOCOL_OFFSET 2 |
Referenced by _usi_encode_and_send().
#define CMD_UNLOCK_PORT 1 |
Referenced by _cbInternalProtocol().
#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 CRC16_LEN 2 |
#define CRC32_LEN 4 |
#define CRC8_LEN 1 |
#define ESC_ESCMARK 0x5d |
Referenced by _decode_copy(), and _usi_encode_and_send().
#define ESC_MSGMARK 0x5e |
Referenced by _decode_copy(), and _usi_encode_and_send().
#define ESCMARK 0x7d |
Referenced by _decode_copy(), and _usi_encode_and_send().
#define HEADER_LEN 2 |
#define INTERNAL_MSG_LEN 1 |
Referenced by usi_init().
#define LEN_EX_PROTOCOL | ( | A | ) | (((uint16_t)(A & 0x0c00)) >> 4) |
Referenced by _usi_encode_and_send().
#define LEN_HI_PROTOCOL | ( | A | ) | (((uint16_t)(A) >> LEN_PROTOCOL_HI_SHIFT) & LEN_PROTOCOL_HI_MSK) |
Referenced by _usi_encode_and_send().
#define LEN_LO_PROTOCOL | ( | A | ) | (((uint16_t)(A) << LEN_PROTOCOL_LO_SHIFT) & LEN_PROTOCOL_LO_MSK) |
Referenced by _usi_encode_and_send().
#define LEN_PROTOCOL | ( | A, | |
B | |||
) | ((((uint16_t)(A)) << LEN_PROTOCOL_HI_SHIFT) + ((B) >> LEN_PROTOCOL_LO_SHIFT)) |
Referenced by _doEoMsg(), and _process_msg().
#define LEN_PROTOCOL_HI_MSK 0xFF |
#define LEN_PROTOCOL_HI_OFFSET 0 |
Referenced by _doEoMsg(), and _process_msg().
#define LEN_PROTOCOL_HI_SHIFT 2 |
#define LEN_PROTOCOL_LO_MSK 0xC0 |
#define LEN_PROTOCOL_LO_OFFSET 1 |
Referenced by _doEoMsg(), and _process_msg().
#define LEN_PROTOCOL_LO_SHIFT 6 |
#define MAX_ESCAPED_INTERNAL_MSG_LEN 10 |
#define MIN_OVERHEAD 5 |
Referenced by usi_send_cmd().
#define MNGP_PRIME_EN_PIBQRY 0x06 |
Referenced by _doEoMsg(), _process_msg(), and _usi_encode_and_send().
#define MNGP_PRIME_EN_PIBRSP 0x07 |
Referenced by _doEoMsg(), _process_msg(), and _usi_encode_and_send().
#define MNGP_PRIME_FU 0x05 |
Referenced by _doEoMsg(), _process_msg(), and _usi_encode_and_send().
#define MNGP_PRIME_GETQRY 0x00 |
Referenced by _doEoMsg(), _process_msg(), and _usi_encode_and_send().
#define MNGP_PRIME_GETRSP 0x01 |
Referenced by _doEoMsg(), _process_msg(), and _usi_encode_and_send().
#define MNGP_PRIME_PROT 0x00 |
Referenced by _getPortFromProtocol().
#define MNGP_PRIME_REBOOT 0x04 |
Referenced by _doEoMsg(), _process_msg(), and _usi_encode_and_send().
#define MNGP_PRIME_RESET 0x03 |
Referenced by _doEoMsg(), _process_msg(), and _usi_encode_and_send().
#define MNGP_PRIME_SET 0x02 |
Referenced by _doEoMsg(), _process_msg(), and _usi_encode_and_send().
#define MSG_END 0 |
Referenced by usi_init(), and usi_process().
#define MSG_START 1 |
Referenced by usi_process().
#define MSGMARK 0x7e |
Referenced by _decode_copy(), _usi_encode_and_send(), and usi_process().
#define PAYLOAD_OFFSET 2 |
Referenced by _process_msg().
#define PROTOCOL_INTERNAL 0x3F |
Referenced by _process_msg(), _usi_encode_and_send(), and usi_init().
#define RX_BLOCK_TIMEOUT 50 |
Referenced by usi_process().
#define TX_BLOCK_TIMEOUT 50 |
Referenced by _cbInternalProtocol().
#define TXAUX_SIZE 0 |
#define TXAUX_SIZE PORT_0 |
#define TXRX_BLOCK_UPDATE 1 |
#define TYPE_PROTOCOL | ( | A | ) | ((A)&TYPE_PROTOCOL_MSK) |
Referenced by _doEoMsg(), _process_msg(), and _usi_encode_and_send().
#define TYPE_PROTOCOL_MSK 0x3F |
#define TYPE_PROTOCOL_OFFSET 1 |
Referenced by _doEoMsg(), and _process_msg().
#define UART_TYPE 0 |
Referenced by _usi_encode_and_send(), usi_init(), and usi_process().
#define USART_TYPE 1 |
Referenced by _usi_encode_and_send(), usi_init(), and usi_process().
#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)) |
Referenced by _doEoMsg(), and _process_msg().
#define XLEN_PROTOCOL_MSK 0xC0 |
#define XLEN_PROTOCOL_OFFSET 2 |
Referenced by _doEoMsg(), and _process_msg().
#define XLEN_PROTOCOL_SHIFT_L 4 |
#define XLEN_PROTOCOL_SHIFT_R 10 |
typedef uint8_t(* pf_usi_decode_cmd)(uint8_t *, uint16_t) |
typedef uint8_t(* pf_usi_get_cmd)(void) |
typedef void(* pf_usi_set_cmd)(uint8_t) |
enum usi_protocol_t |
enum usi_status_t |
|
static |
This function decodes internal protocol messages.
uc_port_idx | Port on which message is received |
uc_cmd | Command identifier |
References CMD_LOCK_PORT, CMD_UNLOCK_PORT, TX_BLOCK_TIMEOUT, and USI_param_t::us_tx_block_timer.
Referenced by _process_msg().
|
static |
Decodes the escape sequences and copies the result into the destination buffer.
puc_dest | pointer to the destination buffer |
puc_orig | pointer to the source buffer |
us_size | size of the data to process |
References ESC_ESCMARK, ESC_MSGMARK, ESCMARK, MSGMARK, and USI_STATUS_FORMAT_ERROR.
Referenced by usi_process().
|
static |
This function processes received message.
uc_port | Communication Port |
References LEN_PROTOCOL, LEN_PROTOCOL_HI_OFFSET, LEN_PROTOCOL_LO_OFFSET, MNGP_PRIME_EN_PIBQRY, MNGP_PRIME_EN_PIBRSP, MNGP_PRIME_FU, MNGP_PRIME_GETQRY, MNGP_PRIME_GETRSP, MNGP_PRIME_REBOOT, MNGP_PRIME_RESET, MNGP_PRIME_SET, pcrc_calculate_prime_crc(), PCRC_CRC_TYPE_16, PCRC_CRC_TYPE_32, PCRC_CRC_TYPE_8, PCRC_HT_USI, PROTOCOL_432_PRIME, PROTOCOL_ATPL230, PROTOCOL_BASEMNG_PRIME, PROTOCOL_MAC_PRIME, PROTOCOL_MLME_PRIME, PROTOCOL_PLME_PRIME, PROTOCOL_PRIME_SERIAL, PROTOCOL_SNIF_PRIME, PROTOCOL_USER_DEFINED, map_buffers_t::puc_buf, TYPE_PROTOCOL, TYPE_PROTOCOL_OFFSET, map_buffers_t::us_size, XLEN_PROTOCOL, and XLEN_PROTOCOL_OFFSET.
Referenced by usi_process().
|
static |
This function extracts the port where the protocol is mapped to.
uc_p_type | Protocol Type |
USI_STATUS_PROTOCOL_NOT_FOUND,if | protocol is not found number of port for the protocol, otherwise |
References MNGP_PRIME_PROT, NUM_PROTOCOLS, map_protocols_t::uc_port, and USI_STATUS_PROTOCOL_NOT_FOUND.
Referenced by usi_send_cmd().
|
static |
This function processes the complete received message.
uc_port | Port where message is received |
References _cbInternalProtocol(), baseMng_receivedCmd(), LEN_PROTOCOL, LEN_PROTOCOL_HI_OFFSET, LEN_PROTOCOL_LO_OFFSET, mngl_rcv_cmd(), MNGP_PRIME_EN_PIBQRY, MNGP_PRIME_EN_PIBRSP, MNGP_PRIME_FU, MNGP_PRIME_GETQRY, MNGP_PRIME_GETRSP, MNGP_PRIME_REBOOT, MNGP_PRIME_RESET, MNGP_PRIME_SET, PAYLOAD_OFFSET, phySerial_receivedCmd(), PROTOCOL_432_PRIME, PROTOCOL_ATPL230, PROTOCOL_BASEMNG_PRIME, PROTOCOL_INTERNAL, PROTOCOL_MAC_PRIME, PROTOCOL_MLME_PRIME, PROTOCOL_PLME_PRIME, PROTOCOL_PRIME_SERIAL, PROTOCOL_SNIF_PRIME, PROTOCOL_USER_DEFINED, map_buffers_t::puc_buf, serial_432_if_api_parser(), serial_if_api_parser(), serial_if_mac_api_parser(), serial_if_mlme_api_parser(), serial_if_plme_api_parser(), serial_if_sniffer_api_parser(), serial_if_user_def_api_parser(), TYPE_PROTOCOL, TYPE_PROTOCOL_OFFSET, XLEN_PROTOCOL, and XLEN_PROTOCOL_OFFSET.
Referenced by usi_process().
|
static |
Encodes the escape characters and transmits the message.
uc_port_idx | Port to transmit through |
msg | Pointer to data to be transmitted |
References buart_if_write(), busart_if_write(), CMD_PROTOCOL, CMD_PROTOCOL_OFFSET, ESC_ESCMARK, ESC_MSGMARK, ESCMARK, LEN_EX_PROTOCOL, LEN_HI_PROTOCOL, LEN_LO_PROTOCOL, MNGP_PRIME_EN_PIBQRY, MNGP_PRIME_EN_PIBRSP, MNGP_PRIME_FU, MNGP_PRIME_GETQRY, MNGP_PRIME_GETRSP, MNGP_PRIME_REBOOT, MNGP_PRIME_RESET, MNGP_PRIME_SET, MSGMARK, pcrc_calculate_prime_crc(), PCRC_CRC_TYPE_16, PCRC_CRC_TYPE_32, PCRC_CRC_TYPE_8, PCRC_HT_USI, PROTOCOL_432_PRIME, PROTOCOL_ATPL230, PROTOCOL_BASEMNG_PRIME, PROTOCOL_INTERNAL, PROTOCOL_MAC_PRIME, PROTOCOL_MLME_PRIME, PROTOCOL_PLME_PRIME, PROTOCOL_PRIME_SERIAL, PROTOCOL_SNIF_PRIME, PROTOCOL_USER_DEFINED, cmd_params_t::puc_buf, map_buffers_t::puc_buf, TYPE_PROTOCOL, UART_TYPE, cmd_params_t::uc_p_type, USI_param_t::us_idx_in, cmd_params_t::us_len, USART_TYPE, USI_STATUS_OK, USI_STATUS_TX_BLOCKED, USI_STATUS_TX_BUFFER_OVERFLOW, and USI_STATUS_UART_ERROR.
Referenced by usi_process(), and usi_send_cmd().
uint8_t baseMng_receivedCmd | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Referenced by _process_msg().
uint8_t Dummy_serial_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Dummy serialization function.
References UNUSED.
uint8_t mngl_rcv_cmd | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Referenced by _process_msg().
uint8_t phySerial_receivedCmd | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Referenced by _process_msg().
uint8_t serial_432_if_api_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Referenced by _process_msg().
uint8_t serial_if_api_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Received message.
puc_rx_msg | Pointer to the data attached to the connection request |
us_len | Data length of the data attached to the request |
true | if there is no error |
false | if length is invalid or serial command is wrong |
References _memcpy_rev(), ATPL230_TXRXBUF_NOISECONF_EBN_Msk, ATPL230_TXRXBUF_NOISECONF_FTN_Msk, ATPL230_TXRXBUF_NOISECONF_NS_Msk, xPhyMsgTx_t::att_level, xPhyMsgTx_t::data_buf, xPhyMsgTx_t::data_len, xPhyMsgTx_t::disable_rx, xPhyMsgTx_t::mode, MODE_TYPE_A, PHY_CFG_SUCCESS, PHY_CMD_CFG_OR, phy_cmd_cfg_param(), phy_get_cfg_param(), phy_reset(), PHY_RESET_HARD_TYPE, PHY_RESET_SOFT_TYPE, phy_set_cfg_param(), phy_tx_frame(), x_usi_serial_cmd_params::ptr_buf, REG_ATPL230_TXRXBUF_NOISECONF, REG_ATPL230_TXRXBUF_RECTIME_NOISE1, REG_ATPL230_VHIGH_TIMER_BEACON_REF, xPhyMsgTx_t::scheme, SERIAL_IF_PHY_COMMAND_CMD_CFG, SERIAL_IF_PHY_COMMAND_CMD_CFG_RSP, SERIAL_IF_PHY_COMMAND_GET_CFG, SERIAL_IF_PHY_COMMAND_GET_CFG_LIST, SERIAL_IF_PHY_COMMAND_GET_CFG_LIST_RSP, SERIAL_IF_PHY_COMMAND_GET_CFG_RSP, SERIAL_IF_PHY_COMMAND_NOISE_REQ, SERIAL_IF_PHY_COMMAND_NOISE_RSP, SERIAL_IF_PHY_COMMAND_RESET_PHY_LAYER, SERIAL_IF_PHY_COMMAND_SEND_MSG, SERIAL_IF_PHY_COMMAND_SEND_MSG_RSP, SERIAL_IF_PHY_COMMAND_SET_CFG, SERIAL_IF_PHY_COMMAND_SET_CFG_RSP, xPhyMsgTx_t::tdelay, xPhyMsgTx_t::tmode, xPhyMsgTx_t::uc_buff_id, uc_serial_data_buf, x_usi_serial_cmd_params::us_len, and usi_send_cmd().
Referenced by _process_msg().
uint8_t serial_if_mac_api_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Referenced by _process_msg().
uint8_t serial_if_mlme_api_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Referenced by _process_msg().
uint8_t serial_if_plme_api_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Referenced by _process_msg().
uint8_t serial_if_sniffer_api_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Referenced by _process_msg().
uint8_t serial_if_user_def_api_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Referenced by _process_msg().
void usi_init | ( | void | ) |
Create RX and TX USI tasks, and timer to update internal counters.
References buart_if_open(), busart_if_open(), INTERNAL_MSG_LEN, MSG_END, NUM_PORTS, PROTOCOL_INTERNAL, UART_TYPE, cmd_params_t::uc_p_type, USI_param_t::us_idx_in, cmd_params_t::us_len, USI_param_t::us_rx_block_timer, USI_param_t::us_tx_block_timer, and USART_TYPE.
Referenced by main().
void usi_process | ( | void | ) |
Function to perform the USI RX process.
References _decode_copy(), _doEoMsg(), _process_msg(), _usi_encode_and_send(), buart_if_read(), busart_if_read(), MSG_END, MSG_START, MSGMARK, NUM_PORTS, cmd_params_t::puc_buf, map_buffers_t::puc_buf, RX_BLOCK_TIMEOUT, UART_TYPE, uc_int_cmd_lock, uc_int_cmd_unlock, uc_message_status, USI_param_t::us_rx_block_timer, map_buffers_t::us_size, and USART_TYPE.
Referenced by main().
usi_status_t usi_send_cmd | ( | void * | msg | ) |
Function to transmit data through USI.
msg | Pointer to message to be transmitted. |
References _getPortFromProtocol(), _usi_encode_and_send(), MIN_OVERHEAD, USI_param_t::us_idx_in, map_buffers_t::us_size, USI_STATUS_PROTOCOL_NOT_FOUND, USI_STATUS_RX_BLOCKED, and USI_STATUS_RX_BUFFER_OVERFLOW.
Referenced by _serial_if_get_rx_task(), _serial_if_get_tx_result_task(), and serial_if_api_parser().
void usi_txrx_block_timer | ( | void | ) |
Function that updates the USI flow control timers.
References NUM_PORTS, USI_param_t::us_rx_block_timer, and USI_param_t::us_tx_block_timer.
pf_usi_decode_cmd cbFnPhySerial = NULL |
cmd_params_t internal_command |
uint8_t* x_usi_serial_cmd_params_t::ptr_buf |
|
static |
|
static |
|
static |
|
static |
uint8_t uc_int_cmd_lock = CMD_LOCK_PORT |
Referenced by usi_process().
uint8_t uc_int_cmd_unlock = CMD_UNLOCK_PORT |
Referenced by usi_process().
|
static |
Referenced by usi_process().
uint8_t x_usi_serial_cmd_params_t::uc_protocol_type |
uint16_t x_usi_serial_cmd_params_t::us_len |
|
static |
|
static |
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 |
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] |
|
static |
|
static |
|
static |
|
static |