NHS31xx SW API
dpa: board support for the NTAG SmartSensor PCB "Sensor button"

Detailed Description

The Demo PCB features are abstracted away. A high-level SW API is provided for:

The initialization function performs initialization of the most used HW blocks, and adds the correct pulls to all the PIOs.

Board support concept:
Board support comes in the form of a statically-linked library which includes the bare minimum for an application to start the HW properly (IO pin configuration and/or clock configuration if required), as well as SW support for the features provided by the board. The single most important API function is the board initialization function (Board_Init). The board initialization has three distinct purposes:
  • To ensure that IO pin configurations are set to a harmless state for the respective board.
  • To enable the features provided by the board (LEDs, external memories, etc): proper initialization in SW and making them ready to be used directly by the application.
  • Enable and initialize basic HW blocks that are considered to be useful by every application. This also allows the board library to make use of them.
Whenever board support is needed for a different board (different pin layout, reduced/extended feature set, etc), a separate board library must be created, matching the requirements of the new board. As long as the initialization function prototype (Board_Init) and the design is kept consistent between board APIs, applications may switch boards more easily during development or even be run on different boards without changing any code.
Diversity
This board makes use of some higher level modules which support diversity: where possible, the default values have been kept. Necessary overrides have been made in Board diversity overrides.

Modules

 Board diversity overrides
 

Macros

#define BOARD_DPA
 
#define BOARD_ACCEL_POWER_PIN   IOCON_PIO0_3
 
#define BOARD_ACCEL_PRECHARGE_PIN   IOCON_PIO0_6
 
#define BOARD_ENABLE_WAKEUP
 

Functions

void Board_Init (void)
 
void Board_DeInit (void)
 
void Board_PowerOnAccel (void)
 
void Board_PowerOffAccel (void)
 
bool Board_AccelIsPowered (void)
 
#define BOARD_PIO1_PULL   IOCON_RMODE_PULLDOWN
 
#define BOARD_PIO2_PULL   IOCON_RMODE_PULLDOWN
 
#define BOARD_PIO4_PULL   IOCON_RMODE_INACT
 
#define BOARD_PIO5_PULL   IOCON_RMODE_INACT
 
#define BOARD_PIO7_PULL   IOCON_RMODE_PULLDOWN
 
#define BOARD_PIO8_PULL   IOCON_RMODE_PULLDOWN
 
#define BOARD_PIO9_PULL   IOCON_RMODE_PULLDOWN
 
#define BOARD_PIO10_PULL   IOCON_RMODE_PULLDOWN
 
#define BOARD_PIO11_PULL   IOCON_RMODE_PULLDOWN
 

Macro Definition Documentation

◆ BOARD_DPA

#define BOARD_DPA

A unique define for the Sensor PCB. Applications or modules can use this define to enable/disable code at compile time based on the board being used.

◆ BOARD_PIO1_PULL

#define BOARD_PIO1_PULL   IOCON_RMODE_PULLDOWN

Depending on the peripherals on the board, power consumption is minimized by adding pull-ups or -downs on the digital pins. These are added at startup in Board_Init and should have these pulls when the pins are not in use.

Note
possible values are IOCON_RMODE_PULLDOWN, IOCON_RMODE_PULLUP or IOCON_RMODE_INACT (no pull).

◆ BOARD_PIO2_PULL

#define BOARD_PIO2_PULL   IOCON_RMODE_PULLDOWN

Depending on the peripherals on the board, power consumption is minimized by adding pull-ups or -downs on the digital pins. These are added at startup in Board_Init and should have these pulls when the pins are not in use.

Note
possible values are IOCON_RMODE_PULLDOWN, IOCON_RMODE_PULLUP or IOCON_RMODE_INACT (no pull).

◆ BOARD_PIO4_PULL

#define BOARD_PIO4_PULL   IOCON_RMODE_INACT

Depending on the peripherals on the board, power consumption is minimized by adding pull-ups or -downs on the digital pins. These are added at startup in Board_Init and should have these pulls when the pins are not in use.

Note
possible values are IOCON_RMODE_PULLDOWN, IOCON_RMODE_PULLUP or IOCON_RMODE_INACT (no pull).

◆ BOARD_PIO5_PULL

#define BOARD_PIO5_PULL   IOCON_RMODE_INACT

Depending on the peripherals on the board, power consumption is minimized by adding pull-ups or -downs on the digital pins. These are added at startup in Board_Init and should have these pulls when the pins are not in use.

Note
possible values are IOCON_RMODE_PULLDOWN, IOCON_RMODE_PULLUP or IOCON_RMODE_INACT (no pull).

◆ BOARD_PIO7_PULL

#define BOARD_PIO7_PULL   IOCON_RMODE_PULLDOWN

Depending on the peripherals on the board, power consumption is minimized by adding pull-ups or -downs on the digital pins. These are added at startup in Board_Init and should have these pulls when the pins are not in use.

Note
possible values are IOCON_RMODE_PULLDOWN, IOCON_RMODE_PULLUP or IOCON_RMODE_INACT (no pull).

◆ BOARD_PIO8_PULL

#define BOARD_PIO8_PULL   IOCON_RMODE_PULLDOWN

Depending on the peripherals on the board, power consumption is minimized by adding pull-ups or -downs on the digital pins. These are added at startup in Board_Init and should have these pulls when the pins are not in use.

Note
possible values are IOCON_RMODE_PULLDOWN, IOCON_RMODE_PULLUP or IOCON_RMODE_INACT (no pull).

◆ BOARD_PIO9_PULL

#define BOARD_PIO9_PULL   IOCON_RMODE_PULLDOWN

Depending on the peripherals on the board, power consumption is minimized by adding pull-ups or -downs on the digital pins. These are added at startup in Board_Init and should have these pulls when the pins are not in use.

Note
possible values are IOCON_RMODE_PULLDOWN, IOCON_RMODE_PULLUP or IOCON_RMODE_INACT (no pull).

◆ BOARD_PIO10_PULL

#define BOARD_PIO10_PULL   IOCON_RMODE_PULLDOWN

Depending on the peripherals on the board, power consumption is minimized by adding pull-ups or -downs on the digital pins. These are added at startup in Board_Init and should have these pulls when the pins are not in use.

Note
possible values are IOCON_RMODE_PULLDOWN, IOCON_RMODE_PULLUP or IOCON_RMODE_INACT (no pull).

◆ BOARD_PIO11_PULL

#define BOARD_PIO11_PULL   IOCON_RMODE_PULLDOWN

Depending on the peripherals on the board, power consumption is minimized by adding pull-ups or -downs on the digital pins. These are added at startup in Board_Init and should have these pulls when the pins are not in use.

Note
possible values are IOCON_RMODE_PULLDOWN, IOCON_RMODE_PULLUP or IOCON_RMODE_INACT (no pull).

◆ BOARD_ACCEL_POWER_PIN

#define BOARD_ACCEL_POWER_PIN   IOCON_PIO0_3

Power pin for the accelerometer

◆ BOARD_ACCEL_PRECHARGE_PIN

#define BOARD_ACCEL_PRECHARGE_PIN   IOCON_PIO0_6

Precharge pin for the accelerometer.

◆ BOARD_ENABLE_WAKEUP

#define BOARD_ENABLE_WAKEUP

If defined, a push button or similar is attached to PIO0 and can wake up the IC when in Deep Power Down.

Function Documentation

◆ Board_Init()

void Board_Init ( void  )

Sets up and initializes all required blocks and functions related to the board hardware.

Note
Initialization will add pulls according to BOARD_PIO0_PULL, BOARD_PIO1_PULL and so on, to the default IO pin configuration.
Initialization does not change the system clock configuration.
Precondition
This function may be only called once, may be only called after a hard reset, and must be called as soon as possible.
Postcondition
accel module is not initialized.
These chip level drivers are initialized and ready for use:
If the accelerometer was already running, it continues running, using power supplied from BOARD_ACCEL_POWER_PIN.
If the accelerometer was powered off, it remains powered off.
Note
This function may be called before Startup_VarInit has been called.

◆ Board_DeInit()

void Board_DeInit ( void  )

De-Init of the board.

◆ Board_PowerOnAccel()

void Board_PowerOnAccel ( void  )

Powers on the accelerometer, in a safe way, charging the external capacitor beforehand. The extra capacitor ensures the accelerometer survives a reset of the NHS3100.

Note
This function takes 30 ms to complete.

◆ Board_PowerOffAccel()

void Board_PowerOffAccel ( void  )

Powers off the accelerometer, in a safe way, discharging the external capacitor beforehand.

Note
This function takes 30 ms to complete.

◆ Board_AccelIsPowered()

bool Board_AccelIsPowered ( void  )

Getter.

Returns
Indicates whether the accelerometer is powered through pins PIO3 and PIO6.