HT32SX Monarch Scan
Monarch Scan application for HT32SX
st_mcu_api.h File Reference

Sigfox manufacturer functions. More...

#include "sigfox_types.h"

Go to the source code of this file.

Functions

void ST_MCU_API_SpiRaw (sfx_u8 n_bytes, sfx_u8 *in_buffer, sfx_u8 *out_buffer, sfx_u8 can_return_bef_tx)
 Performs a SPI transaction with the S2-LP SPI slave. More...
 
void ST_MCU_API_GpioIRQ (sfx_u8 pin, sfx_u8 new_state, sfx_u8 trigger)
 Enables or Disables the external interrupt on the microcontroller side. The interrupt must be set on the rising or falling edge of the input signal according to the trigger_flag. The pin number passed represents the GPIO number of the S2-LP. More...
 
void ST_MCU_API_Shutdown (sfx_u8 value)
 Set on or off the S2-LP by GPIO. More...
 
void ST_MCU_API_LowPower (sfx_u8 low_power_flag)
 This function instructs the mcu_api to send the microcontroller in sleep or not during the protocol operations. It is mainly used for debugging purposes. More...
 
void ST_MCU_API_WaitForInterrupt (void)
 Microcontroller waits for interrupt. This function is continously called by the library each time it waits for an event. This is useful if the application must trigger a state machine and not block the CPU waiting for an event from the library. For example, this can be a null implementation or can activate a low power mode of the microcontroller, tick a stack for dual radio applications or other type of state machines. More...
 
void ST_MCU_API_SetSysClock (void)
 This function is used to confgure the system clock when the STM32 exits the low power or at beginning of the application. More...
 
void ST_MCU_API_TimerCalibration (sfx_u16 duration_ms)
 This function calibrates the RTC that is used by the st_lowlevel when the device goes in sleep. More...
 
void ST_MCU_API_SetEncryptionPayload (sfx_u8 ePayload)
 

Detailed Description

Sigfox manufacturer functions.

Author
AMG - RF Application team
Version
2.2.2
Date
November 24, 2017

This file defines the manufacturer's MCU functions to be implemented for library usage.

Function Documentation

◆ ST_MCU_API_GpioIRQ()

void ST_MCU_API_GpioIRQ ( sfx_u8  pin,
sfx_u8  new_state,
sfx_u8  trigger 
)

Enables or Disables the external interrupt on the microcontroller side. The interrupt must be set on the rising or falling edge of the input signal according to the trigger_flag. The pin number passed represents the GPIO number of the S2-LP.


Parameters
[in]uint8_tpin: the GPIO pin of the S2-LP (integer from 0 to 3).
[in]uint8_tnew_state: enable or disable the EXTI (can be 0 or 1).
[in]uint8_ttrigger: trigger_flag: 1: rising edge 0: falling edge
Note
This is a function that is not required by the SIGFOX_API nor by the RF_API library.
Return values
None

◆ ST_MCU_API_LowPower()

void ST_MCU_API_LowPower ( sfx_u8  low_power_flag)

This function instructs the mcu_api to send the microcontroller in sleep or not during the protocol operations. It is mainly used for debugging purposes.


Parameters
[in]uint8_tlow_power_flag : enable the low power (1, default setting) or not (0).
Note
This is a function that is not required by the SIGFOX_API nor by the RF_API library.
Return values
None.

◆ ST_MCU_API_SetSysClock()

void ST_MCU_API_SetSysClock ( void  )

This function is used to confgure the system clock when the STM32 exits the low power or at beginning of the application.


Parameters
[in]None.
Note
This is a function that is not required by the SIGFOX_API nor by the RF_API library.
Return values
None.

◆ ST_MCU_API_Shutdown()

void ST_MCU_API_Shutdown ( sfx_u8  value)

Set on or off the S2-LP by GPIO.


Parameters
[in]sfx_u8value: if 1, the device should enter shutdown (OFF). if 0, the device should exit from shutdown (ON).
Return values
None

◆ ST_MCU_API_SpiRaw()

void ST_MCU_API_SpiRaw ( sfx_u8  n_bytes,
sfx_u8 *  in_buffer,
sfx_u8 *  out_buffer,
sfx_u8  can_return_bef_tx 
)

Performs a SPI transaction with the S2-LP SPI slave.


Parameters
[in]uint8_tbytes: The number of bytes involved in the SPI transaction.
[in]uint8_t*in_buffer: pointer to the buffer to be sent to the slave.
[in]uint8_t*out_buffer: pointer to the buffer where the received bytes should be stored.
[in]uint8_tcan_return_bef_tx: flag specifying if the function should be blocking (0) or not (1). This can be useful if the SPI is aided with DMA support.
Note
This is a function that is not required by the SIGFOX_API nor by the RF_API library.
Return values
None

◆ ST_MCU_API_TimerCalibration()

void ST_MCU_API_TimerCalibration ( sfx_u16  duration_ms)

This function calibrates the RTC that is used by the st_lowlevel when the device goes in sleep.


Parameters
[in]sfx_u16duration_ms : duration of the calibration process in ms.
Note
This is a function that is not required by the SIGFOX_API nor by the RF_API library.
Return values
None.

◆ ST_MCU_API_WaitForInterrupt()

void ST_MCU_API_WaitForInterrupt ( void  )

Microcontroller waits for interrupt. This function is continously called by the library each time it waits for an event. This is useful if the application must trigger a state machine and not block the CPU waiting for an event from the library. For example, this can be a null implementation or can activate a low power mode of the microcontroller, tick a stack for dual radio applications or other type of state machines.


Parameters
[in]None.
Note
This is a function that is not required by the SIGFOX_API nor by the RF_API library.
Return values
None.