In this article:
Board specific implementation of the board support package (BSP).
Myriota development board BSP is used by default. Create bsp.c under application folder to override default BSP file
Board-specific environment
#defineBOARD_ENV_LEN_MAX50
Get board-specific environment variables Returns string which contains semicolon separated variables.
-
GNSSFIX
-
0: skip system GNSS fix and initial location is invalid
-
1: get time only after location has been fixed or set
-
2: get time and do GNSS 2D fix
-
3: get time and do GNSS 3D fix; this is default mode
-
4: skip system GNSS fix and intitial location is set to 0,0
-
unset: the same as 3
-
-
DUMPTX (Deprecated, do not use)
-
1: dump transmission information
-
0 or unset: don't dump
-
-
SATTEST (supercede DUMPTX)
-
1~255: Enable satellite communication test, including dumping transmission information and communication stats, and specify communication stats dumping interval in minute. The dumped data is logged using user logging code 255
-
0 or unset: disabled
-
char *BoardEnvGet(void)
Board initialisation
intBoardInit(void)
Initialise the board before any system hardware initialisation, invoked only once at startup.
Returns 0 if succeeded and -1 if failed.
intBoardStart(void)
Initialise the board after the system hardware initialisation, invoked only once at startup.
Can be overriden by your application code individually. Returns 0 if succeeded and -1 if failed.
Battery voltage reading
intBoardBatteryVoltGet(uint32_t * mv)
Get the battery voltage in millivolt.
Returns 0 if succeeded and -1 if failed. If battery measurement is not supported then both voltage and the return value should be 0.
LED control
voidBoardLEDInit(void)
Control the LED for system status indication.
voidBoardLEDDeinit(void)
voidBoardLEDTurnOn(void)
voidBoardLEDTurnOff(void)
voidBoardLEDToggle(void)
GNSS module power control
voidBoardGNSSPowerEnable(void)
voidBoardGNSSPowerDisable(void)
boolBoardGNSSPowerIsEnabled(void)
Returns true if enabled and false if disabled.
Satellite radio antenna control
enumRadioMode
| Values | Descriptions |
|---|---|
| RADIO_MODE_RX | radio downlink |
| RADIO_MODE_TX | radio uplink |
| RADIO_MODE_INIT | radio initialisation |
| RADIO_MODE_DEINIT | radio de-initialisation |
Select the antenna based on satellite radio mode and frequency band.
enumRadioBand
| Values | Descriptions |
|---|---|
| RADIO_BAND_VHF | |
| RADIO_BAND_UHF | |
| RADIO_BAND_LPD | |
| RADIO_BAND_UNSUPPORTED |
intBoardAntennaSelect(RadioModeMode,RadioBand Band)
Returns 0 if succeeded and -1 if failed.
Debug output
void *BoardDebugInit(void)
voidBoardDebugDeinit(void)
intBoardDebugWrite(const uint8_t * Tx,size_t Length)
Returns 0 if all bytes are sent and -1 if not.
intBoardDebugRead(uint8_t * Rx,size_t Length)
Returns number of bytes read back and -1 if read fails.
Sleep hooks
voidBoardSleepEnter(void)
Hook invoked before the system enters sleep.
voidBoardSleepExit(void)
Hook invoked after the system wakes up from sleep.
