10.2.4 PHY-DATA.indication
This data indication callback executes the function set by the upper layer at the initialization of the PL360 Host Controller (see Setting Callbacks). It is called when a frame is received. The format of the function is:
typedef void (*pf_data_indication_t)(rx_msg_t *px_msg);
The information is reported in the following structure:
typedef struct rx_msg {
uint32_t ul_rx_time;
uint32_t ul_frame_duration;
uint16_t us_rssi;
uint16_t us_data_len;
uint8_t uc_zct_diff;
uint8_t uc_rs_corrected_errors;
enum mod_types uc_mod_type;
enum mod_schemes uc_mod_scheme;
uint32_t ul_agc_factor;
uint16_t us_agc_fine;
int16_t ss_agc_offset_meas;
uint8_t uc_agc_active;
uint8_t uc_agc_pga_value;
int16_t ss_snr_fch;
int16_t ss_snr_pay
uint16_t us_payload_corrupted_carriers;
uint16_t us_payload_noised_symbols;
uint8_t uc_payload_snr_worst_carrier;
uint8_t uc_payload_snr_worst_symbol;
uint8_t uc_payload_snr_impulsive;
uint8_t uc_payload_snr_band;
uint8_t uc_payload_snr_background;
uint8_t uc_lqi;
enum delimiter_types uc_delimiter_type;
uint8_t uc_crc_ok;
uint8_t puc_tone_map[TONE_MAP_SIZE_MAX];
uint8_t puc_carrier_snr[PROTOCOL_CARRIERS_MAX];
uint8_t *puc_data_buf;
} rx_msg_t;
Fields of the structure:
ul_rx_time | Instant when frame was received (end of frame), referred to the internal 1µs PHY counter |
ul_frame_duration | Frame duration in µs (Preamble + FCH + Payload) |
us_rssi | RSSI in dBµV |
us_data_len | Length of received frame in bytes. If CRC capability is enabled (ATPL360_REG_CRC_TX_RX_CAPABILITY (0x401C)), the CRC length (two bytes) is not included |
uc_zct_diff | Phase difference with transmitting node [0-5]. Derived from PDC field in FCH and Zero-Crossing time |
uc_rs_corrected_errors | Errors corrected by Reed-Solomon decoder |
uc_mod_type | Modulation type of the received frame (related constants defined in PHY-DATA.request) |
uc_mod_scheme | Modulation scheme of the received frame (related constants defined in PHY-DATA.request) |
ul_agc_factor | Global amplifying factor of the main branch (21 bits) |
us_agc_fine | Factor that multiplies the digital input signal (13 bits) |
ss_agc_offset_meas | DC offset after the ADC that will be removed in case the DC Blocker is enabled (10 bits) |
uc_agc_active | Flag to indicate if AGC is active |
uc_agc_pga_value | Gain value applied to the PGA (3 bits) |
ss_snr_fch | SNR of FCH symbols in dB with sQ13.2 format (0x0000: 0dB; 0x0001: 0.25dB; 0xFFFF: -0.25dB) |
ss_snr_pay | SNR of payload symbols in dB with sQ13.2 format |
us_payload_corrupted_carriers | Number of corrupted carriers in payload due to narrow/broad-band noise |
us_payload_noised_symbols | Number of corrupted symbols in payload due to impulsive noise |
uc_payload_snr_worst_carrier | SNR of the worst carrier within payload symbols in dB with sQ5.2 format (0x00: 0dB; 0x01: 0.25dB; 0xFF: -0.25dB) |
uc_payload_snr_worst_symbol | SNR of the worst payload symbol in dB with sQ5.2 format |
uc_payload_snr_impulsive | SNR of payload symbols corrupted by impulsive noise in dB with sQ5.2 format |
uc_payload_snr_band | SNR of carriers corrupted by narrow/broad-band noise within payload symbols in dB with sQ5.2 format |
uc_payload_snr_background | SNR of payload symbols without taking into account corrupted carriers/symbols in dB with sQ5.2 format |
uc_lqi | Link Quality Indicator. SNR of payload symbols in dB with uQ6.2 format and -10 dB offset (0x00: -10 dB; 0x01: -9.75 dB; 0xFF: 53.75 dB) |
uc_delimiter_type | DT field coming in FCH (related constants defined in PHY-DATA.request) |
uc_crc_ok | CRC verification result [0x01: OK; 0x00: BAD; 0xFE: unexpected error; 0xFF: CRC capability disabled]. See ATPL360_REG_CRC_TX_RX_CAPABILITY (0x401C) |
puc_tone_map | Tone Map (Dynamic Notching) in received frame (related constants defined in PHY-DATA.request) |
puc_carrier_snr | Array containing the SNR of each carrier within payload symbols in dB with -10 dB offset (0x00: -10 dB; 0x01: -9 dB; 0xFF: 245 dB) (related constants defined below) |
puc_data_buf | Pointer to data buffer containing the received frame |
Related constants affecting the above parameters:
/* Carriers for Cenelec-A bandplan */
#define NUM_CARRIERS_CENELEC_A 36
/* Carriers for FCC bandplan */
#define NUM_CARRIERS_FCC 72
/* Carriers for ARIB bandplan */
#define NUM_CARRIERS_ARIB 54
/* Carriers for Cenelec-B bandplan */
#define NUM_CARRIERS_CENELEC_B 16
/* ! Maximum number of protocol carriers */
#define PROTOCOL_CARRIERS_MAX NUM_CARRIERS_FCC