The Demo PCB features are abstracted away. A high-level SW API is provided for:
- an accelerometer sensor
- a humidity sensor
- a UCode-I2C RainRfiD IC
- one controllable LED: LED_RED
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.
◆ BOARD_DPAHU
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
◆ BOARD_PIO2_PULL
◆ BOARD_PIO4_PULL
◆ BOARD_PIO5_PULL
◆ BOARD_PIO7_PULL
#define BOARD_PIO7_PULL IOCON_RMODE_PULLDOWN /* Power pin for powering humidity sensor and UCode-I2C. By default off. */ |
◆ BOARD_PIO8_PULL
◆ BOARD_PIO9_PULL
#define BOARD_PIO9_PULL IOCON_RMODE_PULLUP /* When using pin9 for UARTTX, a pull-up prevents undesired 'break' conditions. */ |
◆ BOARD_PIO10_PULL
◆ BOARD_PIO11_PULL
◆ BOARD_ACCEL_POWER_PIN
Power pin for the accelerometer
◆ BOARD_ACCEL_PRECHARGE_PIN
Precharge pin for the accelerometer.
◆ BOARD_HUMID_POWER_PIN
Power pin for the humidity sensor.
◆ BOARD_UCODE_POWER_PIN
Power pin for the UCode-I2C.
◆ 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.
◆ Board_Init()
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.
-
humid 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 |
| ) |
|
◆ 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.