Microchip® Advanced Software Framework

nm_bsp_same70_app.c File Reference

This module contains SAME70 BSP APIs implementation.

Copyright (c) 2018-2019 Microchip Technology Inc. and its subsidiaries.

Data Structures

struct  tcc_module
 
struct  tstrTimer
 
struct  tstrWakeTimer
 

Macros

#define BSP_MIN(x, y)   ((x)>(y)?(y):(x))
 
#define DEBOUNCE_TIME   (40/TICK_RES)
 
#define LONG_PRESS_DEBOUNCE   (1500/TICK_RES)
 
#define LONG_PRESS_TIME   (1500/TICK_RES)
 
#define SHORT_PRESS_DEBOUNCE   (800/TICK_RES)
 
#define SW1_LINE
 
#define SW1_MUX
 
#define SW1_PIN
 
#define PIN_PUSHBUTTON_WAKEUP_PIO   PIOA
 Push button definitions for sleep mode and active mode. More...
 
#define PIN_PUSHBUTTON_WAKEUP_MASK   PIO_PA11
 
#define PIN_PUSHBUTTON_WAKEUP_ID   ID_PIOA
 
#define PIN_PUSHBUTTON_WAKEUP_ATTR   PIO_DEFAULT
 

Typedefs

typedef void(* tick_timer_cb_t )(void)
 

Functions

static void _tcc_callback_to_change_duty_cycle (void)
 
static void btn_isr (uint32 ul_id, uint32 ul_mask)
 
static void btn_poll (void)
 Static functions. More...
 
static void configurable_timer_init (uint32_t u32Period)
 
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 20ms timer. More...
 
void nm_bsp_uart_send (const uint8 *pu8Buf, uint16 u16Sz)
 
void SysTick_Handler (void)
 
static void timer0_init (void)
 

Variables

struct tcc_module configurable_tcc
 
static tpfNmBspBtnPress gpfBtns
 
static tstrTimer gstrConfigurableTimer
 
static tstrTimer gstrTimer1ms
 
static tstrTimer gstrTimer20ms
 
static uint16 gu16Btn1Cnt
 
uint32 gu32Jiffies1ms
 Global variables. More...
 
uint32 gu32Jiffies20ms
 Extern global variables. More...
 
static uint8 gu8BtnIfg
 
volatile uint32_t ms_ticks = 0
 
struct tcc_module tcc_instance
 
static tick_timer_cb_t tick_timer_cb = NULL
 

#define BSP_MIN (   x,
 
)    ((x)>(y)?(y):(x))

Referenced by spi_flash_write().

#define DEBOUNCE_TIME   (40/TICK_RES)
#define LONG_PRESS_DEBOUNCE   (1500/TICK_RES)

Referenced by btn_poll().

#define LONG_PRESS_TIME   (1500/TICK_RES)
#define PIN_PUSHBUTTON_WAKEUP_ATTR   PIO_DEFAULT

Referenced by nm_bsp_btn_init().

#define PIN_PUSHBUTTON_WAKEUP_ID   ID_PIOA

Referenced by nm_bsp_btn_init().

#define PIN_PUSHBUTTON_WAKEUP_MASK   PIO_PA11

Referenced by nm_bsp_btn_init().

#define PIN_PUSHBUTTON_WAKEUP_PIO   PIOA

Push button definitions for sleep mode and active mode.

Referenced by nm_bsp_btn_init().

#define SHORT_PRESS_DEBOUNCE   (800/TICK_RES)

Referenced by btn_poll().

#define SW1_LINE
#define SW1_MUX
#define SW1_PIN

typedef void(* tick_timer_cb_t)(void)

static void btn_isr ( uint32  ul_id,
uint32  ul_mask 
)
static

References gu8BtnIfg, and SW1.

Referenced by nm_bsp_btn_init().

static void btn_poll ( void  )
static
static void configurable_timer_init ( uint32_t  u32Period)
static
void nm_bsp_app_configurable_timer_init ( uint32_t  u32Period)
sint8 nm_bsp_app_deinit ( void  )

References M2M_SUCCESS.

void nm_bsp_start_1ms_timer ( tpfNmBspTimerCb  pfCb)

References tstrTimer::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  )

References NULL, and tstrTimer::pfCb.

void nm_bsp_stop_configurable_timer ( void  )
nm_bsp_stop_timer ( void  )

Start 20ms timer.

Stop 20ms timer.

Version
1.0

References NULL, and tstrTimer::pfCb.

Referenced by ble_heart_rate_handle_disconnect_event(), and ble_heart_rate_handle_paired_event().

void nm_bsp_uart_send ( const uint8 pu8Buf,
uint16  u16Sz 
)
void SysTick_Handler ( void  )

References ms_ticks, and tick_timer_cb.

static void timer0_init ( void  )
static

struct tcc_module configurable_tcc
tpfNmBspBtnPress gpfBtns
static

Referenced by btn_poll(), and nm_bsp_btn_init().

tstrTimer gstrConfigurableTimer
static
tstrTimer gstrTimer1ms
static
tstrTimer gstrTimer20ms
static
uint16 gu16Btn1Cnt
static

Referenced by btn_poll().

uint32 gu32Jiffies1ms
uint32 gu32Jiffies20ms

Extern global variables.

Referenced by _tcc_callback_to_change_duty_cycle().

uint8 gu8BtnIfg
static

Referenced by btn_isr(), and btn_poll().

volatile uint32_t ms_ticks = 0

Referenced by SysTick_Handler().

struct tcc_module tcc_instance
tick_timer_cb_t tick_timer_cb = NULL
static

Referenced by SysTick_Handler(), and timer0_init().