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
#define
BOARD_ENV_LEN_MAX
50
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
int
BoardInit
(void)
Initialise the board before any system hardware initialisation, invoked only once at startup.
Returns 0 if succeeded and -1 if failed.
int
BoardStart
(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
int
BoardBatteryVoltGet
(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
void
BoardLEDInit
(void)
Control the LED for system status indication.
void
BoardLEDDeinit
(void)
void
BoardLEDTurnOn
(void)
void
BoardLEDTurnOff
(void)
void
BoardLEDToggle
(void)
GNSS module power control
void
BoardGNSSPowerEnable
(void)
void
BoardGNSSPowerDisable
(void)
bool
BoardGNSSPowerIsEnabled
(void)
Returns true if enabled and false if disabled.
Satellite radio antenna control
enum
RadioMode
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.
enum
RadioBand
Values | Descriptions |
---|---|
RADIO_BAND_VHF | |
RADIO_BAND_UHF | |
RADIO_BAND_LPD | |
RADIO_BAND_UNSUPPORTED |
int
BoardAntennaSelect
(
RadioMode
Mode,RadioBand Band)
Returns 0 if succeeded and -1 if failed.
Debug output
void *
BoardDebugInit
(void)
void
BoardDebugDeinit
(void)
int
BoardDebugWrite
(const uint8_t * Tx,size_t Length)
Returns 0 if all bytes are sent and -1 if not.
int
BoardDebugRead
(uint8_t * Rx,size_t Length)
Returns number of bytes read back and -1 if read fails.
Sleep hooks
void
BoardSleepEnter
(void)
Hook invoked before the system enters sleep.
void
BoardSleepExit
(void)
Hook invoked after the system wakes up from sleep.