Microchip® Advanced Software Framework

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

This module provides configuration and utils for the sniffer in the PLC PHY layer.

Data Structures

struct  x_usi_sniffer_cmd_params
 

Macros

#define SNIFFER_ATPL230   0x01
 
#define SNIFFER_IF_PHY_COMMAND_ENABLE_PRIME_PLUS_ROBUST   3 /* Enable robust modes of PRIME */
 
#define SNIFFER_IF_PHY_COMMAND_MAC_CRC   1 /* ENABLE MAC on the ATPL230 */
 
#define SNIFFER_IF_PHY_COMMAND_MESSAGE   4 /* Inject message in PLC */
 
#define SNIFFER_IF_PHY_COMMAND_SET_CHANNEL   2 /* SET PLC channel (1 = CENELEC- A) */
 
#define SNIFFER_IF_PHY_MESSAGE_PRIME_1_3   0x20 /* PRIME_1_3 pdu received */
 
#define SNIFFER_IF_PHY_MESSAGE_PRIME_PLUS   0x21 /* PRIME_PLUS pdu received */
 
#define SNIFFER_VERSION   0x14
 
#define TASK_SNIFFER_IF_GET_RX_PRIO   (tskIDLE_PRIORITY + 1)
 
#define TASK_SNIFFER_IF_GET_RX_STACK   (configMINIMAL_STACK_SIZE * 1)
 
#define TIME_IN_TICS(x)   (x / 10)
 
#define TIME_OFDM_SYMBOL_US   2240L
 
#define TIME_PRIME_1_3_HEADER_US   4480L
 
#define TIME_PRIME_1_3_PREAMBLE_US   2048L
 
#define TIME_PRIME_PLUS_HEADER_US   (TIME_OFDM_SYMBOL_US * 4)
 
#define TIME_PRIME_PLUS_PREAMBLE_US   (TIME_PRIME_1_3_PREAMBLE_US * 4)
 

Functions

usi_status_t Dummy_sniffer_send_cmd (void *msg)
 Default serial interface for unused USI. More...
 
uint8_t serial_if_sniffer_api_parser (uint8_t *puc_rx_msg, uint16_t us_len)
 Received message. More...
 
void sniffer_if_init (uint8_t uc_enable_led)
 Initialize sniffer interface. More...
 
void sniffer_if_process (void)
 Task to manage the serialization of the reception message through USI. More...
 
static x_usi_sniffer_cmd_params x_phy_sniffer_msg
 
static uint8_t uc_sniffer_led_enable
 
static uint8_t uc_sniffer_data_buf [800]
 
static uint8_t uc_sniffer_rsp_buf [800]
 

#define SNIFFER_ATPL230   0x01

Referenced by sniffer_if_process().

#define SNIFFER_IF_PHY_COMMAND_ENABLE_PRIME_PLUS_ROBUST   3 /* Enable robust modes of PRIME */
#define SNIFFER_IF_PHY_COMMAND_MAC_CRC   1 /* ENABLE MAC on the ATPL230 */
#define SNIFFER_IF_PHY_COMMAND_MESSAGE   4 /* Inject message in PLC */
#define SNIFFER_IF_PHY_COMMAND_SET_CHANNEL   2 /* SET PLC channel (1 = CENELEC- A) */
#define SNIFFER_IF_PHY_MESSAGE_PRIME_1_3   0x20 /* PRIME_1_3 pdu received */

Referenced by sniffer_if_process().

#define SNIFFER_IF_PHY_MESSAGE_PRIME_PLUS   0x21 /* PRIME_PLUS pdu received */

Referenced by sniffer_if_process().

#define SNIFFER_VERSION   0x14

Referenced by sniffer_if_process().

#define TASK_SNIFFER_IF_GET_RX_PRIO   (tskIDLE_PRIORITY + 1)
#define TASK_SNIFFER_IF_GET_RX_STACK   (configMINIMAL_STACK_SIZE * 1)
#define TIME_IN_TICS (   x)    (x / 10)

Referenced by sniffer_if_process().

#define TIME_OFDM_SYMBOL_US   2240L

Referenced by sniffer_if_process().

#define TIME_PRIME_1_3_HEADER_US   4480L

Referenced by sniffer_if_process().

#define TIME_PRIME_1_3_PREAMBLE_US   2048L

Referenced by sniffer_if_process().

#define TIME_PRIME_PLUS_HEADER_US   (TIME_OFDM_SYMBOL_US * 4)

Referenced by sniffer_if_process().

#define TIME_PRIME_PLUS_PREAMBLE_US   (TIME_PRIME_1_3_PREAMBLE_US * 4)

Referenced by sniffer_if_process().

usi_status_t Dummy_sniffer_send_cmd ( void *  msg)

Default serial interface for unused USI.

References UNUSED, and USI_STATUS_PROTOCOL_NOT_FOUND.

uint8_t serial_if_sniffer_api_parser ( uint8_t *  puc_rx_msg,
uint16_t  us_len 
)

Received message.

Parameters
puc_rx_msgPointer to the received data
us_lenData length of the received data
Return values
trueif there is no error
falseif length is invalid or sniffer command is wrong

References PHY_ID_CFG_TXRX_CHANNEL, phy_mac_crc_disable(), phy_mac_crc_enable(), phy_set_cfg_param(), SNIFFER_IF_PHY_COMMAND_ENABLE_PRIME_PLUS_ROBUST, SNIFFER_IF_PHY_COMMAND_MAC_CRC, SNIFFER_IF_PHY_COMMAND_MESSAGE, and SNIFFER_IF_PHY_COMMAND_SET_CHANNEL.

Referenced by _process_msg().

void sniffer_if_init ( uint8_t  uc_enable_led)

Initialize sniffer interface.

Parameters
uc_enable_ledEnable led

References PHY_ID_RX_QR_MODE_ID, phy_mac_crc_disable(), phy_set_cfg_param(), REG_ATPL230_SNA0, x_usi_sniffer_cmd_params::uc_protocol_type, and UNUSED.

Referenced by phy_reset().

uint8_t uc_sniffer_data_buf[800]
static

Referenced by sniffer_if_process().

uint8_t uc_sniffer_led_enable
static
uint8_t uc_sniffer_rsp_buf[800]
static

Referenced by sniffer_if_process().

x_usi_sniffer_cmd_params x_phy_sniffer_msg
static