Microchip® Advanced Software Framework

winc3400/wifi_drv/bsp/source/nm_bsp_sam4s_app.c File Reference

This module contains SAMD21 BSP APIs implementation.

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

#include "bsp/include/nm_bsp_sam4s_app.h"
#include "common/include/nm_common.h"

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 PIN_PUSHBUTTON_WAKEUP_ATTR   PIO_DEFAULT
 
#define PIN_PUSHBUTTON_WAKEUP_ID   ID_PIOA
 
#define PIN_PUSHBUTTON_WAKEUP_MASK   PIO_PA2
 
#define PIN_PUSHBUTTON_WAKEUP_PIO   PIOA
 
#define SHORT_PRESS_DEBOUNCE   (800/TICK_RES)
 
#define SW1_LINE
 
#define SW1_MUX
 
#define SW1_PIN
 
#define XPRO_BUTTON_0_ACTIVE   false
 
#define XPRO_BUTTON_0_INACTIVE   !XPRO_BUTTON_0_ACTIVE
 
#define XPRO_BUTTON_0_PIN   IOPORT_CREATE_PIN(PIOA, 2)
 

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)
 
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))
#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
#define PIN_PUSHBUTTON_WAKEUP_ID   ID_PIOA
#define PIN_PUSHBUTTON_WAKEUP_MASK   PIO_PA2
#define PIN_PUSHBUTTON_WAKEUP_PIO   PIOA
#define SHORT_PRESS_DEBOUNCE   (800/TICK_RES)

Referenced by btn_poll().

#define SW1_LINE
#define SW1_MUX
#define SW1_PIN
#define XPRO_BUTTON_0_ACTIVE   false
#define XPRO_BUTTON_0_INACTIVE   !XPRO_BUTTON_0_ACTIVE

Referenced by btn_poll().

#define XPRO_BUTTON_0_PIN   IOPORT_CREATE_PIN(PIOA, 2)

Referenced by btn_poll().

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 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  )
void nm_bsp_stop_timer ( void  )

Start 20ms timer.

Stop 20ms timer.

Author
M.S.M
Date
28 OCT 2013
Version
1.0
Author
M.S.M
Date
28 oct 2013
Version
1.0
1.0

References NULL, and tstrTimer::pfCb.

void nm_bsp_uart_send ( const uint8 pu8Buf,
uint16  u16Sz 
)
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.

uint8 gu8BtnIfg
static

Referenced by btn_isr(), and btn_poll().

volatile uint32_t ms_ticks = 0
struct tcc_module tcc_instance
tick_timer_cb_t tick_timer_cb = NULL
static

Referenced by timer0_init().