Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PLC PHY Serial Interface

This module provides configuration and utils to serialize the PLC PHY layer.

Data Structures

struct  x_usi_serial_cmd_params
 

Macros

#define IFACE_SERIAL_ENABLE   0x1
 
#define IFACE_SNIFFER_ENABLE   0x2
 
#define SERIAL_IF_PHY_COMMAND_CMD_CFG   4 /* Get reception configuration query */
 
#define SERIAL_IF_PHY_COMMAND_CMD_CFG_RSP   5 /* Get reception configuration response */
 
#define SERIAL_IF_PHY_COMMAND_GET_CFG   0 /* Get reception configuration query */
 
#define SERIAL_IF_PHY_COMMAND_GET_CFG_LIST   11 /* Get parameter list */
 
#define SERIAL_IF_PHY_COMMAND_GET_CFG_LIST_RSP   12 /* Parameter list response */
 
#define SERIAL_IF_PHY_COMMAND_GET_CFG_RSP   1 /* Get reception configuration response */
 
#define SERIAL_IF_PHY_COMMAND_NOISE_REQ   9 /* Set noise capture mode */
 
#define SERIAL_IF_PHY_COMMAND_NOISE_RSP   10 /* Get noise capture */
 
#define SERIAL_IF_PHY_COMMAND_RECEIVE_MSG   8 /* Receive message data */
 
#define SERIAL_IF_PHY_COMMAND_RESET_PHY_LAYER   13 /* Reset phy layer */
 
#define SERIAL_IF_PHY_COMMAND_SEND_MSG   6 /* Send message data */
 
#define SERIAL_IF_PHY_COMMAND_SEND_MSG_RSP   7 /* Send message data response */
 
#define SERIAL_IF_PHY_COMMAND_SET_CFG   2 /* Set reception configuration command */
 
#define SERIAL_IF_PHY_COMMAND_SET_CFG_RSP   3 /* Set reception configuration response */
 
#define TASK_SERIAL_IF_GET_RX_PRIO   (tskIDLE_PRIORITY + 1)
 
#define TASK_SERIAL_IF_GET_RX_STACK   (configMINIMAL_STACK_SIZE * 1)
 
#define TASK_SERIAL_IF_GET_TX_RESULT_PRIO   (tskIDLE_PRIORITY + 1)
 
#define TASK_SERIAL_IF_GET_TX_RESULT_STACK   (configMINIMAL_STACK_SIZE * 1)
 

Functions

static void _memcpy_rev (uint8_t *puc_dst, uint8_t *puc_buf, uint16_t us_len)
 Memcopy with byte order reversal. More...
 
static void _serial_if_get_rx_task (void *pvParameters)
 Task to manage the serialization of the reception message through USI. More...
 
static void _serial_if_get_tx_result_task (void *pvParameters)
 Task to manage the serialization of the result of transmission through USI. More...
 
int8_t Dummy_serial_send_cmd (void *msg)
 Default serial interface for unused USI. More...
 
uint8_t serial_if_api_parser (uint8_t *puc_rx_msg, uint16_t us_len)
 Received message. More...
 
void serial_if_check_rx_msg (void)
 Interface to manage the serialization of the reception message through USI. More...
 
void serial_if_check_tx_result (void)
 Interface to manage the serialization of the reception message through USI. More...
 
void serial_if_init (void)
 Initialize serial interface. More...
 
static uint8_t uc_serial_rsp_buf [808]
 
static uint8_t uc_serial_data_buf [808]
 
static x_usi_serial_cmd_params x_phy_serial_msg
 

#define IFACE_SERIAL_ENABLE   0x1
#define IFACE_SNIFFER_ENABLE   0x2
#define SERIAL_IF_PHY_COMMAND_CMD_CFG   4 /* Get reception configuration query */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_CMD_CFG_RSP   5 /* Get reception configuration response */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_GET_CFG   0 /* Get reception configuration query */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_GET_CFG_LIST   11 /* Get parameter list */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_GET_CFG_LIST_RSP   12 /* Parameter list response */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_GET_CFG_RSP   1 /* Get reception configuration response */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_NOISE_REQ   9 /* Set noise capture mode */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_NOISE_RSP   10 /* Get noise capture */
#define SERIAL_IF_PHY_COMMAND_RECEIVE_MSG   8 /* Receive message data */

Referenced by _serial_if_get_rx_task().

#define SERIAL_IF_PHY_COMMAND_RESET_PHY_LAYER   13 /* Reset phy layer */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_SEND_MSG   6 /* Send message data */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_SEND_MSG_RSP   7 /* Send message data response */
#define SERIAL_IF_PHY_COMMAND_SET_CFG   2 /* Set reception configuration command */

Referenced by serial_if_api_parser().

#define SERIAL_IF_PHY_COMMAND_SET_CFG_RSP   3 /* Set reception configuration response */

Referenced by serial_if_api_parser().

#define TASK_SERIAL_IF_GET_RX_PRIO   (tskIDLE_PRIORITY + 1)
#define TASK_SERIAL_IF_GET_RX_STACK   (configMINIMAL_STACK_SIZE * 1)
#define TASK_SERIAL_IF_GET_TX_RESULT_PRIO   (tskIDLE_PRIORITY + 1)
#define TASK_SERIAL_IF_GET_TX_RESULT_STACK   (configMINIMAL_STACK_SIZE * 1)

static void _memcpy_rev ( uint8_t *  puc_dst,
uint8_t *  puc_buf,
uint16_t  us_len 
)
static

Memcopy with byte order reversal.

Copies puc_buf[] into puc_dst[], re-ordering the bytes to adapt to the serial communication.

Parameters
puc_dstPointer to buffer where the data will be copied
puc_bufPointer to buffer data
us_lenLength of data to copy

Referenced by serial_if_api_parser().

static void _serial_if_get_tx_result_task ( void *  pvParameters)
static

Task to manage the serialization of the result of transmission through USI.

Parameters
pvParametersPointer that will be used as the parameter for the task being created.

References phy_get_cfg_param(), PHY_ID_CFG_TXRX_CHANNEL, phy_tx_frame_result_cb(), x_usi_serial_cmd_params::ptr_buf, xPhyMsgTxResult_t::rms_calc, SERIAL_IF_PHY_COMMAND_SEND_MSG_RSP, xPhyMsgTxResult_t::uc_id_buffer, xPhyMsgTxResult_t::uc_result, UNUSED, x_usi_serial_cmd_params::us_len, and usi_send_cmd().

Referenced by serial_if_check_tx_result().

int8_t Dummy_serial_send_cmd ( void *  msg)

Default serial interface for unused USI.

References UNUSED.

uint8_t serial_if_api_parser ( uint8_t *  puc_rx_msg,
uint16_t  us_len 
)
void serial_if_check_rx_msg ( void  )

Interface to manage the serialization of the reception message through USI.

References _serial_if_get_rx_task().

Referenced by main().

void serial_if_check_tx_result ( void  )

Interface to manage the serialization of the reception message through USI.

References _serial_if_get_tx_result_task().

Referenced by main().

void serial_if_init ( void  )

uint8_t uc_serial_data_buf[808]
static
uint8_t uc_serial_rsp_buf[808]
static
x_usi_serial_cmd_params x_phy_serial_msg
static