Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Application Initialization Process

Initializes the Performance Analyzer Application.

Data Structures

struct  node_ib_t
 Structure to holds the information base for the node. More...
 

Macros

#define BOARD_NAME   "USER_BOARD"
 
#define CRC_SETTING_ON_REMOTE_NODE
 
#define DEFAULT_ADDR   (0xFFFF)
 
#define DEFAULT_CHANNEL   (DEFAULT_CHANNEL_OFFSET)
 
#define DEFAULT_PAN_ID   (0xCAFE)
 
#define DST_PAN_ID   (DEFAULT_PAN_ID)
 
#define DST_SHORT_ADDR   (0xFFFF)
 
#define DUMMY_PAYLOAD   (0xAA)
 
#define FIRMWARE_VERSION   3.2
 
#define FRAME_OVERHEAD   (11)
 
#define FRAME_OVERHEAD_DST_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define FRAME_OVERHEAD_SRC_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define IC_TYPE   0X01
 
#define LED_COUNT   0
 
#define MCU_SOC_NAME   "USER_MCU"
 
#define OFFSET_FOR_SRC_IEEE_ADDR   (7)
 
#define SRC_PAN_ID   (DEFAULT_PAN_ID)
 

Enumerations

enum  main_state_t {
  INIT = 0,
  WAIT_FOR_EVENT,
  PEER_SEARCH_RANGE_TX,
  PEER_SEARCH_PER_TX,
  PEER_SEARCH_RANGE_RX,
  PEER_SEARCH_PER_RX,
  RANGE_TEST_TX_ON,
  RANGE_TEST_TX_OFF,
  SINGLE_NODE_TESTS,
  PER_TEST_INITIATOR,
  PER_TEST_RECEPTOR,
  NUM_MAIN_STATES
}
 

Functions

void app_alert (void)
 
void config_node_ib (void)
 Function to init the information base for device. More...
 
static void configure_pibs (void)
 Configure the TAL PIB's relevant to the Performance analyzer application. More...
 
void init_state_init (void *arg)
 Initialization task for INIT STATE. More...
 
void performance_analyzer_init (void)
 Init function of the Performance Analyzer application. More...
 
void recover_all_settings (void)
 Recover all user settings before Start of CW transmission. More...
 
void save_all_settings (void)
 Save all user settings before Start of CW transmission. More...
 
void set_main_state (main_state_t state, void *arg)
 Function to set the main state of state machine. More...
 
retval_t transmit_frame (uint8_t dst_addr_mode, uint8_t *dst_addr, uint8_t src_addr_mode, uint8_t msdu_handle, uint8_t *payload, uint16_t payload_length, uint8_t ack_req)
 Function to transmit frames as per 802.15.4 std. More...
 
void wait_for_event_init (void *arg)
 Application task when the node is in the WAIT_FOR_EVENT state. More...
 
void wait_for_event_rx_cb (frame_info_t *frame)
 Callback that is called if data has been received by trx in WAIT_FOR_EVENT state. More...
 
void wait_for_event_task (void)
 Application task handling user events like key press or character on UART. More...
 

Variables

uint8_t APP_TIMER_TO_RX_LED_OFF
 
uint8_t APP_TIMER_TO_TX
 
uint8_t APP_TIMER_TO_TX_LED_OFF
 
bool node_ib_t::configure_mode
 
uint8_t CW_TX_TIMER
 
main_state_t node_ib_t::main_state
 
uint8_t node_ib_t::msg_seq_num
 
volatile node_ib_t node_info
 
bool node_ib_t::peer_found
 
uint16_t node_ib_t::peer_short_addr
 
uint8_t node_ib_t::sub_state
 
uint8_t T_APP_TIMER
 
uint8_t T_APP_TIMER_RANGE
 
uint8_t node_ib_t::transmitting
 
frame_info_tnode_ib_t::tx_frame_info
 

#define BOARD_NAME   "USER_BOARD"

Referenced by get_board_details(), and get_node_info().

#define CRC_SETTING_ON_REMOTE_NODE
#define DEFAULT_ADDR   (0xFFFF)

Referenced by configure_pibs().

#define DEFAULT_CHANNEL   (DEFAULT_CHANNEL_OFFSET)
#define DEFAULT_PAN_ID   (0xCAFE)
#define DST_SHORT_ADDR   (0xFFFF)
#define FIRMWARE_VERSION   3.2

Referenced by get_board_details(), and get_node_info().

#define FRAME_OVERHEAD_DST_IEEE_ADDR   (FRAME_OVERHEAD + 6)

Referenced by peer_req_send_rx_cb().

#define FRAME_OVERHEAD_SRC_IEEE_ADDR   (FRAME_OVERHEAD + 6)

Referenced by wait_for_event_rx_cb().

#define IC_TYPE   0X01

Referenced by get_board_details(), and get_node_info().

#define LED_COUNT   0

Referenced by appDataInd().

#define MCU_SOC_NAME   "USER_MCU"

Referenced by get_board_details(), and get_node_info().

#define OFFSET_FOR_SRC_IEEE_ADDR   (7)

Referenced by wait_for_event_rx_cb().

Enumerator
INIT 
WAIT_FOR_EVENT 
PEER_SEARCH_RANGE_TX 
PEER_SEARCH_PER_TX 
PEER_SEARCH_RANGE_RX 
PEER_SEARCH_PER_RX 
RANGE_TEST_TX_ON 
RANGE_TEST_TX_OFF 
SINGLE_NODE_TESTS 
PER_TEST_INITIATOR 
PER_TEST_RECEPTOR 
NUM_MAIN_STATES 

void app_alert ( void  )

References delay_us.

Referenced by app_timers_init(), init_state_init(), and main().

void config_node_ib ( void  )
static void configure_pibs ( void  )
static

Configure the TAL PIB's relevant to the Performance analyzer application.

References CCPU_ENDIAN_TO_LE16, DEFAULT_ADDR, DEFAULT_CHANNEL, macIeeeAddress, macPANId, macShortAddress, phyCurrentChannel, phyCurrentPage, SRC_PAN_ID, tal_pib, and tal_pib_set().

Referenced by wait_for_event_init().

void init_state_init ( void *  arg)

Initialization task for INIT STATE.

All hardware, PAL, TAL and stack level initialization must be done in this function

Parameters
argarguments for INIT state

References ANT_CTRL_1, ANT_DIVERSITY_DISABLE, app_alert(), app_timers_init(), config_node_ib(), configuration_mode_selection(), init_sio(), MAC_SUCCESS, sw_timer_init(), and tal_init().

void performance_analyzer_init ( void  )

Init function of the Performance Analyzer application.

References INIT, NULL, set_main_state(), sio2host_init(), and WAIT_FOR_EVENT.

Referenced by main().

void recover_all_settings ( void  )

Recover all user settings before Start of CW transmission.

Referenced by set_transceiver_state().

void save_all_settings ( void  )

Save all user settings before Start of CW transmission.

Referenced by set_transceiver_state().

retval_t transmit_frame ( uint8_t  dst_addr_mode,
uint8_t *  dst_addr,
uint8_t  src_addr_mode,
uint8_t  msdu_handle,
uint8_t *  payload,
uint16_t  payload_length,
uint8_t  ack_req 
)

Function to transmit frames as per 802.15.4 std.

Parameters
dst_addr_modedestination address mode - can be 16 or 64 bit
dst_addrdestination address
src_addr_modesource address mode - can be 16 or 64 bit
msdu_handlemsdu handle for the upper layers to track packets
payloaddata payload pointer
payload_lengthdata length
ack_reqspecifies ack requested for frame if set to 1
Returns
MAC_SUCCESS if the TAL has accepted the data for frame transmission TAL_BUSY if the TAL is busy servicing the previous tx request

References CCPU_ENDIAN_TO_LE16, convert_16_bit_to_byte_array(), convert_64_bit_to_byte_array(), CSMA_UNSLOTTED, DST_PAN_ID, EXT_ADDR_LEN, FAILURE, FCF_2_SOURCE_ADDR_OFFSET, FCF_ACK_REQUEST, FCF_FRAMETYPE_DATA, FCF_LEN, FCF_LONG_ADDR, FCF_PAN_ID_COMPRESSION, FCF_SET_DEST_ADDR_MODE, FCF_SET_SOURCE_ADDR_MODE, FCF_SHORT_ADDR, FCS_LEN, FRAME_OVERHEAD, i, frame_info_tag::mpdu, frame_info_tag::msduHandle, node_ib_t::msg_seq_num, PAN_ID_LEN, PL_POS_DST_ADDR_START, SHORT_ADDR_LEN, SRC_PAN_ID, tal_pib, tal_tx_frame(), node_ib_t::transmitting, and node_ib_t::tx_frame_info.

Referenced by handle_gts_data_req(), mac_tx_gts_data(), mcps_data_request(), mlme_gts_request(), process_deallocate_data_q(), range_test_frame_tx(), send_disconnect_command(), send_identify_command(), send_parameters_changed(), send_peer_conf(), send_peer_info_req(), send_peer_info_rsp(), send_peer_req(), send_peer_rsp(), send_per_test_start_cmd(), send_range_test_marker_cmd(), send_range_test_marker_rsp(), send_range_test_rsp(), send_range_test_start_cmd(), send_range_test_stop_cmd(), send_remote_cmd(), send_remote_reply_cmd(), send_result_req(), send_result_rsp(), and send_set_default_config_command().

void wait_for_event_init ( void *  arg)

Application task when the node is in the WAIT_FOR_EVENT state.

Parameters
argarguments for WAIT_FOR_EVENT state

References app_led_event(), configure_pibs(), LED_EVENT_POWER_ON, PHY_RX_ON, and tal_rx_enable().

void wait_for_event_task ( void  )

Application task handling user events like key press or character on UART.

This function

  • Implements the event handling in WAIT_FOR_EVENT state.

References app_debounce_button(), NULL, PEER_SEARCH_RANGE_TX, print_event(), PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR, and set_main_state().

uint8_t APP_TIMER_TO_RX_LED_OFF

Referenced by app_led_event(), and app_timers_init().

uint8_t APP_TIMER_TO_TX_LED_OFF
uint8_t node_ib_t::msg_seq_num

Referenced by config_node_ib(), and transmit_frame().