This module contains SAMD21 BSP APIs declarations.
Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | M2M_PRINTX(x) nm_bsp_uart_send((const uint8_t *)x,sizeof(x)) |
#define | NM_BSP_PERM_FIRMWARE_SIZE (1024UL*256) /* Permenant storage size available for the firmware */ |
#define | NM_BSP_TIME_MSEC (gu32Jiffies * TICK_RES) |
#define | SW1 NBIT0 |
#define | SW2 NBIT1 |
#define | TICK_RES 20 |
#define | TICK_RES_SLEEP 20 /*it must be equal tick or higher */ |
Typedefs | |
typedef void(* | tpfNmBspBtnPress )(uint8 u8Btn, uint8 u8Type) |
Callback functions. More... | |
typedef void(* | tpfNmBspTimerCb )(void) |
Functions | |
void | nm_bsp_app_configurable_timer_init (uint32_t u32Period) |
sint8 | nm_bsp_app_deinit (void) |
sint8 | nm_bsp_app_init (void) |
void | nm_bsp_btn_init (tpfNmBspBtnPress pfBtnCb) |
void | nm_bsp_start_1ms_timer (tpfNmBspTimerCb pfCb) |
void | nm_bsp_start_configurable_timer (tpfNmBspTimerCb pfCb) |
void | nm_bsp_start_timer (tpfNmBspTimerCb pfCb, uint32 u32Period) |
void | nm_bsp_stop_1ms_timer (void) |
void | nm_bsp_stop_configurable_timer (void) |
void | nm_bsp_stop_timer (void) |
Start periodic timer. More... | |
void | nm_bsp_uart_send (const uint8 *pu8Buf, uint16 u16Sz) |
Variables | |
uint32 | gu32Jiffies |
Extern global variables. More... | |
uint32 | gu32Jiffies1ms |
Global variables. More... | |
#define M2M_PRINTX | ( | x | ) | nm_bsp_uart_send((const uint8_t *)x,sizeof(x)) |
#define NM_BSP_PERM_FIRMWARE_SIZE (1024UL*256) /* Permenant storage size available for the firmware */ |
#define NM_BSP_TIME_MSEC (gu32Jiffies * TICK_RES) |
Referenced by _tcc_callback_to_change_duty_cycle(), and nm_bsp_start_timer().
#define SW1 NBIT0 |
Referenced by btn_isr(), and btn_poll().
#define SW2 NBIT1 |
Referenced by btn_poll().
#define TICK_RES 20 |
Tick resolution in milliseconds
Referenced by _tcc_callback_to_change_duty_cycle().
#define TICK_RES_SLEEP 20 /*it must be equal tick or higher */ |
Referenced by _tcc_callback_to_change_duty_cycle().
typedef void(* tpfNmBspTimerCb)(void) |
void nm_bsp_app_configurable_timer_init | ( | uint32_t | u32Period | ) |
References configurable_timer_init().
sint8 nm_bsp_app_deinit | ( | void | ) |
References M2M_SUCCESS.
sint8 nm_bsp_app_init | ( | void | ) |
References M2M_SUCCESS, NULL, tstrTimer::pfCb, tstrWakeTimer::strTimer, timer0_init(), tstrTimer::u32Period, tstrTimer::u32Timeout, and tstrWakeTimer::u8Enabled.
Referenced by main().
void nm_bsp_btn_init | ( | tpfNmBspBtnPress | pfBtnCb | ) |
References btn_isr(), BUTTON_0_EIC_LINE, BUTTON_0_EIC_MUX, BUTTON_0_EIC_PIN, extint_chan_conf::detection_criteria, EXTINT_CALLBACK_TYPE_DETECT, extint_chan_enable_callback(), extint_chan_get_config_defaults(), extint_chan_set_config(), EXTINT_DETECT_FALLING, EXTINT_PULL_UP, extint_register_callback(), gpfBtns, extint_chan_conf::gpio_pin, extint_chan_conf::gpio_pin_mux, extint_chan_conf::gpio_pin_pull, gu16Btn1Cnt, gu16Btn2Cnt, gu8BtnIfg, port_get_config_defaults(), PORT_PIN_DIR_INPUT, PORT_PIN_PULL_UP, and port_pin_set_config().
void nm_bsp_start_1ms_timer | ( | tpfNmBspTimerCb | pfCb | ) |
References tstrTimer::pfCb.
Referenced by IperfIncrementTimerUse().
void nm_bsp_start_configurable_timer | ( | tpfNmBspTimerCb | pfCb | ) |
References configurable_tcc, tstrTimer::pfCb, TCC_CALLBACK_OVERFLOW, and tcc_enable_callback().
void nm_bsp_start_timer | ( | tpfNmBspTimerCb | pfCb, |
uint32 | u32Period | ||
) |
References NM_BSP_TIME_MSEC, tstrTimer::pfCb, tstrTimer::u32Period, and tstrTimer::u32Timeout.
void nm_bsp_stop_1ms_timer | ( | void | ) |
References NULL, and tstrTimer::pfCb.
Referenced by IperfDecrementTimerUse().
void nm_bsp_stop_configurable_timer | ( | void | ) |
References configurable_tcc, NULL, tstrTimer::pfCb, TCC_CALLBACK_OVERFLOW, tcc_disable(), and tcc_disable_callback().
void nm_bsp_stop_timer | ( | void | ) |
Start periodic timer.
References NULL, and tstrTimer::pfCb.
uint32 gu32Jiffies |
Extern global variables.
Referenced by _tcc_callback_to_change_duty_cycle().
uint32 gu32Jiffies1ms |
Global variables.
Referenced by _tcc_callback_to_change_duty_cycle().