Microchip® Advanced Software Framework

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

Handles all User interface related functions such as Button, Print,LED events.

Data Structures

struct  print_event_msg_t
 Print event message stucture to organize the prints. More...
 

Macros

#define COUNT_FOR_VALID_KEY_PRESS   (20)
 This defines the count to detect a valid key press. More...
 
#define COUNT_FOR_VALID_KEY_PRESS   (20)
 This defines the count to detect a valid key press. More...
 
#define LED_ON_DURAION_MICRO_SEC   (100000)
 This defines the LED on duration. More...
 
#define LED_ON_DURAION_MICRO_SEC   (100000)
 This defines the LED on duration. More...
 

Variables

void(* print_event_msg_t::additional_print_func )(void)
 
const char * print_event_msg_t::item_desc
 
print_event_msg_t print_event_table [NUM_MAX_PRINT_EVENTS]
 This table holds the Messages to be printed on the UART Terminal at each event. More...
 
print_event_msg_t print_event_table [NUM_MAX_PRINT_EVENTS]
 This table holds the Messages to be printed on the UART Terminal at each event. More...
 

LED EVENTS

enum  led_event_t {
  LED_EVENT_TX_FRAME,
  LED_EVENT_RX_FRAME,
  LED_EVENT_POWER_ON,
  LED_EVENT_START_PEER_SEARCH,
  LED_EVENT_PEER_SEARCH_DONE,
  LED_EVENT_ALL_ON,
  LED_EVENT_ALL_OFF,
  LED_EVENT_TX_FRAME,
  LED_EVENT_RX_FRAME,
  LED_EVENT_POWER_ON,
  LED_EVENT_START_PEER_SEARCH,
  LED_EVENT_PEER_SEARCH_DONE,
  LED_EVENT_ALL_ON,
  LED_EVENT_ALL_OFF
}
 

PRINT EVENTS

enum  print_event_t {
  PRINT_KEY_PRESS_WHILE_POWER_ON_CONFIG_MODE,
  PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR,
  PRINT_UART_CHAR_PEER_SEARCH_INITIATOR,
  PRINT_KEY_PRESS_PEER_SEARCH_RECEPTOR,
  PRINT_UART_CHAR_PEER_SEARCH_RECEPTOR,
  PRINT_PEER_SEARCH_RECEPTOR_BAD_FRAME,
  PRINT_PEER_SEARCH_INITATED,
  PRINT_PEER_SEARCH_IN_PROGRESS,
  PRINT_PEER_SEARCH_SUCCESS,
  PRINT_PEER_SEARCH_FAILED,
  PRINT_PEER_SEARCH_ABORTED,
  PRINT_PEER_SEARCH_ABORTABLE,
  PRINT_PEER_FOUND_PER_INITIATOR,
  PRINT_PEER_FOUND_PER_RECEPTOR,
  PRINT_SINGLE_NODE_TESTS,
  PRINT_RANGE_MEASURE_TX_START,
  PRINT_RANGE_MEASURE_TX_STOP,
  PRINT_RANGE_MEASURE_STATSTICS,
  NUM_MAX_PRINT_EVENTS,
  PRINT_KEY_PRESS_WHILE_POWER_ON_CONFIG_MODE,
  PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR,
  PRINT_UART_CHAR_PEER_SEARCH_INITIATOR,
  PRINT_KEY_PRESS_PEER_SEARCH_RECEPTOR,
  PRINT_UART_CHAR_PEER_SEARCH_RECEPTOR,
  PRINT_PEER_SEARCH_RECEPTOR_BAD_FRAME,
  PRINT_PEER_SEARCH_INITATED,
  PRINT_PEER_SEARCH_IN_PROGRESS,
  PRINT_PEER_SEARCH_SUCCESS,
  PRINT_PEER_SEARCH_FAILED,
  PRINT_PEER_SEARCH_ABORTED,
  PRINT_PEER_SEARCH_ABORTABLE,
  PRINT_PEER_FOUND_PER_INITIATOR,
  PRINT_PEER_FOUND_PER_RECEPTOR,
  PRINT_SINGLE_NODE_TESTS,
  PRINT_RANGE_MEASURE_TX_START,
  PRINT_RANGE_MEASURE_TX_STOP,
  PRINT_RANGE_MEASURE_STATSTICS,
  NUM_MAX_PRINT_EVENTS
}
 
bool app_debounce_button (void)
 Button debounce routine. More...
 
bool button_pressed (void)
 Determine if button is pressed. More...
 
void app_led_event (led_event_t ev)
 Turns LEDs on / off to indicate specific events. More...
 
void print_event (print_event_t ev)
 Print various messages from the table as per the event notified. More...
 
void app_print_statistics (void)
 Print the statistics for Range Measurement on the UART Terminal. More...
 

LED EVENTS

enum  led_event_t {
  LED_EVENT_TX_FRAME,
  LED_EVENT_RX_FRAME,
  LED_EVENT_POWER_ON,
  LED_EVENT_START_PEER_SEARCH,
  LED_EVENT_PEER_SEARCH_DONE,
  LED_EVENT_ALL_ON,
  LED_EVENT_ALL_OFF,
  LED_EVENT_TX_FRAME,
  LED_EVENT_RX_FRAME,
  LED_EVENT_POWER_ON,
  LED_EVENT_START_PEER_SEARCH,
  LED_EVENT_PEER_SEARCH_DONE,
  LED_EVENT_ALL_ON,
  LED_EVENT_ALL_OFF
}
 

PRINT EVENTS

enum  print_event_t {
  PRINT_KEY_PRESS_WHILE_POWER_ON_CONFIG_MODE,
  PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR,
  PRINT_UART_CHAR_PEER_SEARCH_INITIATOR,
  PRINT_KEY_PRESS_PEER_SEARCH_RECEPTOR,
  PRINT_UART_CHAR_PEER_SEARCH_RECEPTOR,
  PRINT_PEER_SEARCH_RECEPTOR_BAD_FRAME,
  PRINT_PEER_SEARCH_INITATED,
  PRINT_PEER_SEARCH_IN_PROGRESS,
  PRINT_PEER_SEARCH_SUCCESS,
  PRINT_PEER_SEARCH_FAILED,
  PRINT_PEER_SEARCH_ABORTED,
  PRINT_PEER_SEARCH_ABORTABLE,
  PRINT_PEER_FOUND_PER_INITIATOR,
  PRINT_PEER_FOUND_PER_RECEPTOR,
  PRINT_SINGLE_NODE_TESTS,
  PRINT_RANGE_MEASURE_TX_START,
  PRINT_RANGE_MEASURE_TX_STOP,
  PRINT_RANGE_MEASURE_STATSTICS,
  NUM_MAX_PRINT_EVENTS,
  PRINT_KEY_PRESS_WHILE_POWER_ON_CONFIG_MODE,
  PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR,
  PRINT_UART_CHAR_PEER_SEARCH_INITIATOR,
  PRINT_KEY_PRESS_PEER_SEARCH_RECEPTOR,
  PRINT_UART_CHAR_PEER_SEARCH_RECEPTOR,
  PRINT_PEER_SEARCH_RECEPTOR_BAD_FRAME,
  PRINT_PEER_SEARCH_INITATED,
  PRINT_PEER_SEARCH_IN_PROGRESS,
  PRINT_PEER_SEARCH_SUCCESS,
  PRINT_PEER_SEARCH_FAILED,
  PRINT_PEER_SEARCH_ABORTED,
  PRINT_PEER_SEARCH_ABORTABLE,
  PRINT_PEER_FOUND_PER_INITIATOR,
  PRINT_PEER_FOUND_PER_RECEPTOR,
  PRINT_SINGLE_NODE_TESTS,
  PRINT_RANGE_MEASURE_TX_START,
  PRINT_RANGE_MEASURE_TX_STOP,
  PRINT_RANGE_MEASURE_STATSTICS,
  NUM_MAX_PRINT_EVENTS
}
 
void print_event (trx_id_t trx, print_event_t ev)
 Print various messages from the table as per the event notified. More...
 
void app_print_statistics (int trx)
 Print the statistics for Range Measurement on the UART Terminal. More...
 

#define COUNT_FOR_VALID_KEY_PRESS   (20)

This defines the count to detect a valid key press.

#define COUNT_FOR_VALID_KEY_PRESS   (20)

This defines the count to detect a valid key press.

Referenced by app_debounce_button().

#define LED_ON_DURAION_MICRO_SEC   (100000)

This defines the LED on duration.

#define LED_ON_DURAION_MICRO_SEC   (100000)

This defines the LED on duration.

Referenced by app_led_event().

Enumerator
LED_EVENT_TX_FRAME 
LED_EVENT_RX_FRAME 
LED_EVENT_POWER_ON 
LED_EVENT_START_PEER_SEARCH 
LED_EVENT_PEER_SEARCH_DONE 
LED_EVENT_ALL_ON 
LED_EVENT_ALL_OFF 
LED_EVENT_TX_FRAME 
LED_EVENT_RX_FRAME 
LED_EVENT_POWER_ON 
LED_EVENT_START_PEER_SEARCH 
LED_EVENT_PEER_SEARCH_DONE 
LED_EVENT_ALL_ON 
LED_EVENT_ALL_OFF 
Enumerator
LED_EVENT_TX_FRAME 
LED_EVENT_RX_FRAME 
LED_EVENT_POWER_ON 
LED_EVENT_START_PEER_SEARCH 
LED_EVENT_PEER_SEARCH_DONE 
LED_EVENT_ALL_ON 
LED_EVENT_ALL_OFF 
LED_EVENT_TX_FRAME 
LED_EVENT_RX_FRAME 
LED_EVENT_POWER_ON 
LED_EVENT_START_PEER_SEARCH 
LED_EVENT_PEER_SEARCH_DONE 
LED_EVENT_ALL_ON 
LED_EVENT_ALL_OFF 
Enumerator
PRINT_KEY_PRESS_WHILE_POWER_ON_CONFIG_MODE 
PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR 
PRINT_UART_CHAR_PEER_SEARCH_INITIATOR 
PRINT_KEY_PRESS_PEER_SEARCH_RECEPTOR 
PRINT_UART_CHAR_PEER_SEARCH_RECEPTOR 
PRINT_PEER_SEARCH_RECEPTOR_BAD_FRAME 
PRINT_PEER_SEARCH_INITATED 
PRINT_PEER_SEARCH_IN_PROGRESS 
PRINT_PEER_SEARCH_SUCCESS 
PRINT_PEER_SEARCH_FAILED 
PRINT_PEER_SEARCH_ABORTED 
PRINT_PEER_SEARCH_ABORTABLE 
PRINT_PEER_FOUND_PER_INITIATOR 
PRINT_PEER_FOUND_PER_RECEPTOR 
PRINT_SINGLE_NODE_TESTS 
PRINT_RANGE_MEASURE_TX_START 
PRINT_RANGE_MEASURE_TX_STOP 
PRINT_RANGE_MEASURE_STATSTICS 
NUM_MAX_PRINT_EVENTS 
PRINT_KEY_PRESS_WHILE_POWER_ON_CONFIG_MODE 
PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR 
PRINT_UART_CHAR_PEER_SEARCH_INITIATOR 
PRINT_KEY_PRESS_PEER_SEARCH_RECEPTOR 
PRINT_UART_CHAR_PEER_SEARCH_RECEPTOR 
PRINT_PEER_SEARCH_RECEPTOR_BAD_FRAME 
PRINT_PEER_SEARCH_INITATED 
PRINT_PEER_SEARCH_IN_PROGRESS 
PRINT_PEER_SEARCH_SUCCESS 
PRINT_PEER_SEARCH_FAILED 
PRINT_PEER_SEARCH_ABORTED 
PRINT_PEER_SEARCH_ABORTABLE 
PRINT_PEER_FOUND_PER_INITIATOR 
PRINT_PEER_FOUND_PER_RECEPTOR 
PRINT_SINGLE_NODE_TESTS 
PRINT_RANGE_MEASURE_TX_START 
PRINT_RANGE_MEASURE_TX_STOP 
PRINT_RANGE_MEASURE_STATSTICS 
NUM_MAX_PRINT_EVENTS 
Enumerator
PRINT_KEY_PRESS_WHILE_POWER_ON_CONFIG_MODE 
PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR 
PRINT_UART_CHAR_PEER_SEARCH_INITIATOR 
PRINT_KEY_PRESS_PEER_SEARCH_RECEPTOR 
PRINT_UART_CHAR_PEER_SEARCH_RECEPTOR 
PRINT_PEER_SEARCH_RECEPTOR_BAD_FRAME 
PRINT_PEER_SEARCH_INITATED 
PRINT_PEER_SEARCH_IN_PROGRESS 
PRINT_PEER_SEARCH_SUCCESS 
PRINT_PEER_SEARCH_FAILED 
PRINT_PEER_SEARCH_ABORTED 
PRINT_PEER_SEARCH_ABORTABLE 
PRINT_PEER_FOUND_PER_INITIATOR 
PRINT_PEER_FOUND_PER_RECEPTOR 
PRINT_SINGLE_NODE_TESTS 
PRINT_RANGE_MEASURE_TX_START 
PRINT_RANGE_MEASURE_TX_STOP 
PRINT_RANGE_MEASURE_STATSTICS 
NUM_MAX_PRINT_EVENTS 
PRINT_KEY_PRESS_WHILE_POWER_ON_CONFIG_MODE 
PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR 
PRINT_UART_CHAR_PEER_SEARCH_INITIATOR 
PRINT_KEY_PRESS_PEER_SEARCH_RECEPTOR 
PRINT_UART_CHAR_PEER_SEARCH_RECEPTOR 
PRINT_PEER_SEARCH_RECEPTOR_BAD_FRAME 
PRINT_PEER_SEARCH_INITATED 
PRINT_PEER_SEARCH_IN_PROGRESS 
PRINT_PEER_SEARCH_SUCCESS 
PRINT_PEER_SEARCH_FAILED 
PRINT_PEER_SEARCH_ABORTED 
PRINT_PEER_SEARCH_ABORTABLE 
PRINT_PEER_FOUND_PER_INITIATOR 
PRINT_PEER_FOUND_PER_RECEPTOR 
PRINT_SINGLE_NODE_TESTS 
PRINT_RANGE_MEASURE_TX_START 
PRINT_RANGE_MEASURE_TX_STOP 
PRINT_RANGE_MEASURE_STATSTICS 
NUM_MAX_PRINT_EVENTS 

bool app_debounce_button ( void  )

Button debounce routine.

Helper function for debouncing the transmit button.

Returns
ret 1 if a button event is detected, 0 otherwise.

References button_pressed(), and COUNT_FOR_VALID_KEY_PRESS.

Referenced by per_mode_receptor_task(), range_test_tx_off_task(), range_test_tx_on_task(), and wait_for_event_task().

void app_print_statistics ( void  )

Print the statistics for Range Measurement on the UART Terminal.

References num_of_frames_rec, and num_of_frames_send.

void app_print_statistics ( int  trx)

Print the statistics for Range Measurement on the UART Terminal.

References num_of_frames_rec, and num_of_frames_send.

bool button_pressed ( void  )

Determine if button is pressed.

Returns
true if button is pressed, else false

References ioport_get_pin_level().

Referenced by app_debounce_button(), and configuration_mode_selection().

void print_event ( trx_id_t  trx,
print_event_t  ev 
)

Print various messages from the table as per the event notified.

Parameters
evthe event to be printed on the Terminal.

References print_event_msg_t::additional_print_func.

void(* print_event_msg_t::additional_print_func)(int trx)

Referenced by print_event().

const char * print_event_msg_t::item_desc

This table holds the Messages to be printed on the UART Terminal at each event.

This table holds the Messages to be printed on the UART Terminal at each event.