#include <asf.h>
#include "conf_board.h"
#include "common_sw_timer.h"
#include "keyboard.h"
#include "app_config.h"
#include "rf4ce.h"
#include "zrc.h"
#include "pb_pairing.h"
#include "vendor_data.h"
#include "nwk_config.h"
Macros | |
#define | DEBOUNCE_TIME_US 200000 |
#define | TX_OPTIONS |
Typedefs | |
typedef enum node_status_tag | node_status_t |
Functions | |
static void | app_task (void) |
Application task and state machine. More... | |
FLASH_DECLARE (uint16_t VendorIdentifier) | |
FLASH_DECLARE (uint8_t vendor_string[7]) | |
FLASH_DECLARE (uint8_t app_user_string[15]) | |
FLASH_DECLARE (uint8_t supported_cec_cmds[32]) | |
static void | indicate_fault_behavior (void) |
Indicating malfunction. More... | |
static key_state_t | key_state_read (key_id_t key_no) |
Read key_state. More... | |
int | main (void) |
Main function of the Single Button Controller application. More... | |
static void | nlme_reset_confirm (nwk_enum_t Status) |
void | nlme_rx_enable_confirm (nwk_enum_t Status) |
NLME-RX-ENABLE.confirm primitive API. More... | |
static void | nlme_start_confirm (nwk_enum_t Status) |
static void | pbp_org_pair_confirm (nwk_enum_t Status, uint8_t PairingRef) |
Push button pairing confirm; target and controller use. More... | |
static void | start_cmd_disc_cb (void *callback_parameter) |
void | vendor_app_alive_req (void) |
Vendor-spefic callback; handles reaction to incoming alive request. More... | |
void | vendor_data_ind (uint8_t PairingRef, uint16_t VendorId, uint8_t nsduLength, uint8_t *nsdu, uint8_t RxLinkQuality, uint8_t RxFlags) |
Post processing of the vendor data response. More... | |
static void | zrc_cmd_confirm (nwk_enum_t Status, uint8_t PairingRef, cec_code_t RcCmd) |
ZRC command confirm. More... | |
static void | zrc_cmd_disc_confirm (nwk_enum_t Status, uint8_t PairingRef, uint8_t *SupportedCmd) |
static void | zrc_cmd_disc_indication (uint8_t PairingRef) |
Variables | |
uint8_t | app_timer |
static node_status_t | node_status |
static uint8_t | pairing_ref = 0xFF |
zrc_indication_callback_t | zrc_ind |
#define DEBOUNCE_TIME_US 200000 |
Referenced by app_task().
#define TX_OPTIONS |
Referenced by app_task().
typedef enum node_status_tag node_status_t |
enum node_status_tag |
|
static |
Application task and state machine.
References DEBOUNCE_TIME_US, FUNC_PTR, IDLE, KEY_PRESSED, key_state, key_state_read(), LED0, LED_On, node_status, nwk_ready_to_sleep(), nwk_stack_idle(), pairing_ref, POWER_TOGGLE_FUNCTION, SELECT_KEY, sw_timer_get_time(), TRANSMITTING, TX_OPTIONS, USER_CONTROL_PRESSED, and zrc_cmd_confirm().
Referenced by main().
FLASH_DECLARE | ( | uint16_t | VendorIdentifier | ) |
FLASH_DECLARE | ( | uint8_t | vendor_string[7] | ) |
FLASH_DECLARE | ( | uint8_t | app_user_string[15] | ) |
FLASH_DECLARE | ( | uint8_t | supported_cec_cmds[32] | ) |
|
static |
Indicating malfunction.
References delay_ms, LED0, LED_Off, and LED_On.
Referenced by main(), pbp_org_pair_confirm(), and zrc_cmd_confirm().
|
static |
Read key_state.
key_no | Key to be read. |
References ioport_get_pin_level(), KEY_PRESSED, KEY_RELEASED, and SELECT_KEY.
Referenced by app_task(), and main().
int main | ( | void | ) |
Main function of the Single Button Controller application.
Main function.
The SAM3X_EK, SAM3X Arduino board and SAM4C_EK use two bytes length internal address EEPROM.
References app_task(), app_timer, board_init(), COLD_START, cpu_irq_enable, delay_init, FUNC_PTR, indicate_fault_behavior(), KEY_PRESSED, key_state, key_state_read(), LED0, LED_On, nlme_reset_confirm(), nlme_reset_request(), node_status, nwk_init(), NWK_SUCCESS, nwk_task(), register_zrc_indication_callback(), SELECT_KEY, sm_init(), sw_timer_get_id(), sw_timer_init(), sysclk_init(), vendor_data_ind(), zrc_indication_callback::vendor_data_ind_cb, WARM_START, zrc_cmd_disc_indication(), and zrc_indication_callback::zrc_cmd_disc_indication_cb.
|
static |
|
static |
|
static |
Push button pairing confirm; target and controller use.
The push button pairing confirm is a callback that provides the status of the push pairing request.
Status | Status of the last pairing transaction |
PairingRef | If pairing was successful, PairingRef contains assigned pairing reference. |
References aplcMinTargetBlackoutPeriod_us, app_timer, FUNC_PTR, indicate_fault_behavior(), nlme_rx_enable_confirm(), nlme_rx_enable_request(), NULL, NWK_SUCCESS, nwkcMinActivePeriod, pairing_ref, RX_DURATION_OFF, start_cmd_disc_cb(), SW_TIMEOUT_RELATIVE, and sw_timer_start().
|
static |
References FUNC_PTR, pairing_ref, zrc_cmd_disc_confirm(), and zrc_cmd_disc_request().
Referenced by pbp_org_pair_confirm().
void vendor_app_alive_req | ( | void | ) |
static void vendor_data_ind | ( | uint8_t | PairingRef, |
uint16_t | VendorId, | ||
uint8_t | nsduLength, | ||
uint8_t * | nsdu, | ||
uint8_t | RxLinkQuality, | ||
uint8_t | RxFlags | ||
) |
Post processing of the vendor data response.
PairingRef | Pairing reference |
VendorId | Vendor ID. |
nsduLength | Length of the payload. |
nsdu | Actual payload |
RxLinkQuality | Link quality of received packet. |
RxFlags | Rx Flags. |
References ALIVE_RESP, BATTERY_STATUS_RESP, FUNC_PTR, FW_VERSION_RESP, IDLE, nlme_rx_enable_confirm(), nlme_rx_enable_request(), node_status, PGM_READ_WORD, POWER_SAVE, RX_DURATION_INFINITY, and RX_ON_RESP.
|
static |
ZRC command confirm.
The ZRC comand confirm callback provides information about the status of the last command request/transmission.
Status | NWK_SUCCESS if transmission was successful |
PairingRef | Pairing reference |
RcCmd | Sent RC command |
References IDLE, indicate_fault_behavior(), LED0, LED_Off, node_status, and NWK_SUCCESS.
Referenced by app_task().
|
static |
|
static |
uint8_t app_timer |
Referenced by main(), and pbp_org_pair_confirm().
|
static |
Referenced by app_task(), main(), and zrc_cmd_confirm().
|
static |
Referenced by app_task(), pbp_org_pair_confirm(), and start_cmd_disc_cb().
zrc_indication_callback_t zrc_ind |