NHS31xx SW API

Detailed Description

The application can adapt the Storage module to better fit the different application scenarios through the use of diversity flags in the form of defines below. Sensible defaults are chosen; to override the default settings, place the defines with their desired values in the application app_sel.h header file: the compiler will pick up your defines before parsing this file.

These flags may be overridden:

These defines are derived from UARTTX_ENABLE_SHORTHANDS and may not be redefined in an application:

Macros

#define UARTTX_STOPBITS   2
 
#define UARTTX_BITRATE   9600
 
#define UARTTX_INVERTED   0
 
#define UARTTX_DEC_END_CHAR   '\n'
 
#define UARTTX_HEX_END_CHAR   '\n'
 
#define UARTTX_ENABLE_SHORTHANDS   0
 
#define PRINTD(n)   do {} while(0)
 
#define PRINTH(n)   do {} while(0)
 
#define PRINTS(s)   do {} while(0)
 
#define PRINTF(...)   do {} while(0)
 

Macro Definition Documentation

◆ UARTTX_STOPBITS

#define UARTTX_STOPBITS   2

By default, the uart module will use two stop bits. Explicitly define UARTTX_STOPBITS to 1 to end each byte with only 1 stopbit.

Note
If not defined, or if equal to any value different from 1, 2 stop bits will be used.

◆ UARTTX_BITRATE

#define UARTTX_BITRATE   9600

The uart module will use 9600 as default bit rate, assuming the default system clock of 500 kHz. Explicitly define UARTTX_BITRATE to switch to a higher bit rate.

Warning
Ensure valid bit rate/system clock combinations are used as listed in SW Clock Restrictions and SSP clock rates. The Uart Tx module does not perform any check on this.

◆ UARTTX_INVERTED

#define UARTTX_INVERTED   0

In UART, the idle state is high. This means that a pull-up will be set to PIO9. This allows for energy injection into the IO ring, which can cause problems when trying to go to Power-off. If defined to a non-zero value, the idle state will be low and all bits will be transmitted inverted.

Note
Enabling this requires an inverter, external to the IC, to transform the stream back to UART again.

◆ UARTTX_DEC_END_CHAR

#define UARTTX_DEC_END_CHAR   '\n'

Defines the extra character to output after printing out a decimal or hexadecimal number using PRINTD.

Precondition
This define must be a single character.

◆ UARTTX_HEX_END_CHAR

#define UARTTX_HEX_END_CHAR   '\n'

Defines the extra character to output after printing out a decimal or hexadecimal number using PRINTH.

Precondition
This define must be a single character.

◆ UARTTX_ENABLE_SHORTHANDS

#define UARTTX_ENABLE_SHORTHANDS   0

Defines shorthands for quick debugging, using the uart to output strings. A typical usage for this diversity setting could be to have these enabled in a debug build, but have them disabled in a release build, still allowing the full functionality of the uart module for non-debug usages - using the full API function names.

◆ PRINTD

#define PRINTD (   n)    do {} while(0)

void

◆ PRINTH

#define PRINTH (   n)    do {} while(0)

void

◆ PRINTS

#define PRINTS (   s)    do {} while(0)

void

◆ PRINTF

#define PRINTF (   ...)    do {} while(0)

void