Microchip® Advanced Software Framework

2/inc/app_init.h File Reference
#include "tal.h"
#include "string.h"
#include "app_config.h"

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_RF09   (1)
 
#define DEFAULT_CHANNEL_RF24   (21)
 
#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   (9)
 
#define FRAME_OVERHEAD_DST_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define FRAME_OVERHEAD_SRC_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define IC_TYPE   0x00
 
#define LED_COUNT   0
 
#define MCU_SOC_NAME   "USER_MCU"
 
#define OFFSET_FOR_SRC_IEEE_ADDR   (7)
 
#define SRC_PAN_ID   (DEFAULT_PAN_ID)
 
#define SUN_PAGE_NO   (0X09)
 
#define TAL_CURRENT_PAGE_DEFAULT_RF09   (0x02)
 
#define TAL_CURRENT_PAGE_DEFAULT_RF24   (0x00)
 

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,
  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)
 
retval_t app_transmit_frame (trx_id_t trx, 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 config_node_ib (trx_id_t trx)
 Function to init the information base for device. More...
 
void init_after_disconnect (trx_id_t trx)
 Function to perform initialization task after disconnect request. More...
 
void init_state_init (trx_id_t trx, void *arg)
 Initialization task for INIT STATE. More...
 
void set_main_state (trx_id_t tranciever, main_state_t state, void *arg)
 Function to set the main state of state machine. More...
 
void wait_for_event_init (trx_id_t trx, void *arg)
 Application task when the node is in the WAIT_FOR_EVENT state. More...
 
void wait_for_event_rx_cb (trx_id_t trx, 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 (trx_id_t trx)
 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
 
volatile node_ib_t node_info [NUM_TRX]
 
uint8_t T_APP_TIMER
 
uint8_t T_APP_TIMER_RANGE_RF09
 
uint8_t T_APP_TIMER_RANGE_RF24