Sens'it SDK
v2.0.0
|
Sens'it SDK user functions. More...
Functions | |
error_t | SENSIT_API_get_sdk_version (u8 **version, u8 *size) |
Return Sens'it SDK library version, in ASCII format. More... | |
error_t | SENSIT_API_configure_radio (rc_origin_e origin, radio_conf_e *rc) |
Configure the device with the selected Sigfox Radio Configuration (RC). More... | |
error_t | SENSIT_API_switch_radio (bool on, rgb_color_e color) |
Switch on/off radio power. More... | |
void | SENSIT_API_reset (void) |
Reset the device. More... | |
error_t | SENSIT_API_sleep (bool auto_wake_up) |
Put the device in stop mode and wait for an interrupt. More... | |
error_t | SENSIT_API_set_rtc_alarm (u32 interrupt_period) |
Set RTC alarm timer. Set interrupt period to 0 to disable it. More... | |
error_t | SENSIT_API_configure_button (interrupt_e config) |
Configure button interrupt. More... | |
error_t | SENSIT_API_get_button_state (bool *state) |
Get the state of the button. More... | |
error_t | SENSIT_API_set_rgb_led (rgb_color_e color) |
Set RGB led state. More... | |
error_t | SENSIT_API_set_white_led (bool on) |
Set white led state. More... | |
error_t | SENSIT_API_get_battery_level (u16 *battery_voltage) |
Do a measurement of battery voltage. More... | |
error_t | SENSIT_API_get_current_time (u32 *current_time) |
Return time passed since last device reset. More... | |
error_t | SENSIT_API_wait (u32 time_ms) |
Wait during 'time_ms'. More... | |
error_t | SENSIT_API_configure_reed_switch (bool enable, interrupt_e config) |
Enable/disable the reed switch and configure interrupt. More... | |
error_t | SENSIT_API_get_reed_switch_state (bool *state) |
Get the state of the reed switch. More... | |
error_t | SENSIT_API_write_read_i2c_bus (u8 addr, u8 *buffer, u8 nbWrite, u8 nbRead) |
I2C bus driver. More... | |
error_t | SENSIT_API_configure_fxos8700_interrupt (bool enable) |
Enable/Disable interrupt from Accelerometer. More... | |
error_t | SENSIT_API_init_nv_mem (u16 block_length) |
Initialize Non-Volatile Memory. More... | |
error_t | SENSIT_API_get_nv_mem (u8 *data) |
Read user data from non-volatile memory. More... | |
error_t | SENSIT_API_set_nv_mem (u8 *data) |
Write user data in a non-volatile memory. More... | |
error_t | SENSIT_API_init_watchdog (void) |
Activate the watchdog. More... | |
error_t | SENSIT_API_clear_watchdog (void) |
Clear watchdog timer. More... | |
error_t | SENSIT_API_init_uart (void) |
Initialize the UART communication. More... | |
error_t | SENSIT_API_close_uart (void) |
Close the UART communication. More... | |
error_t | SENSIT_API_send_data_to_uart (u8 *data, u8 size) |
Send a string on the UART communication. More... | |
error_t | SENSIT_API_get_data_from_uart (u8 *c) |
Get a char from the UART Rx buffer. More... | |
error_t | SENSIT_API_init_usb (void) |
Initialize USB communication of the device. More... | |
error_t | SENSIT_API_send_data_to_usb (u8 *data, u8 size) |
Send a string on the USB communication. More... | |
error_t | SENSIT_API_get_data_from_usb (u8 *c) |
Get a char from the USB Rx buffer. More... | |
error_t | SENSIT_API_switch_battery_charger (bool enable) |
Function to disable battery charger in case of use of an external power supply. More... | |
error_t | SENSIT_API_switch_test_mode_creedentials (bool enable) |
Switch to private/test mode credentials. More... | |
error_t | SENSIT_API_reset_device_sequence_number (void) |
Reset device sequence number. More... | |
Sens'it SDK user functions.
Return Sens'it SDK library version, in ASCII format.
[out] | version | Pointer to Byte array containing version |
[out] | size | Size of version buffer |
SENSIT_ERR_NONE | No error |
error_t SENSIT_API_configure_radio | ( | rc_origin_e | origin, |
radio_conf_e * | rc | ||
) |
Configure the device with the selected Sigfox Radio Configuration (RC).
[in] | origin | Radio Configuration value origin |
[out] | rc | If RC_FROM_MEMORY, Radio Configuration set in the device memory |
[in] | rc | If RC_FROM_PARAMETER, Radio Configuration to use |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_MEMORY | Error, device memory is corrupted |
SENSIT_ERR_RADIO_CONF | Radio Configuration has an invalid value |
error_t SENSIT_API_switch_radio | ( | bool | on, |
rgb_color_e | color | ||
) |
Switch on/off radio power.
[in] | on | TRUE to switch on radio FALSE to switch off radio |
[in] | color | Color of LEDs blink during transmission. Use 0xFF to have the white LED blinks. |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_RADIO_NOT_INIT | Error, radio is not configured |
void SENSIT_API_reset | ( | void | ) |
Reset the device.
The device reset is signaled by 5 white led blinks.
If the button is pressed during the reset, the device will restart in bootloader.
Put the device in stop mode and wait for an interrupt.
Use pending_interrupt to know wake up source.
[in] | auto_wake_up | If TRUE, auto wake up each second |
SENSIT_ERR_NONE | No error |
Set RTC alarm timer.
Set interrupt period to 0 to disable it.
Use pending_interrupt to know when timer interrupt occurs.
[in] | interrupt_period | Alarm interrupt period in s |
SENSIT_ERR_NONE | No error |
error_t SENSIT_API_configure_button | ( | interrupt_e | config | ) |
Configure button interrupt.
[in] | config | Interrupt configuration |
SENSIT_ERR_NONE | No error |
Get the state of the button.
[out] | state | If FALSE, button is pressed. If TRUE, button is released. |
SENSIT_ERR_NONE | No error |
error_t SENSIT_API_set_rgb_led | ( | rgb_color_e | color | ) |
Set RGB led state.
[in] | color | Color of the RGB led |
SENSIT_ERR_NONE | No error |
Set white led state.
[in] | on | TRUE: led is turned on FALSE: led is turned off |
SENSIT_ERR_NONE | No error |
Do a measurement of battery voltage.
[out] | battery_voltage | Battery voltage in mV |
SENSIT_ERR_NONE | No error |
Return time passed since last device reset.
[out] | current_time | Current time in s |
SENSIT_ERR_NONE | No error |
Wait during 'time_ms'.
[in] | time_ms | Time to wait in milliseconds |
SENSIT_ERR_NONE | No error |
error_t SENSIT_API_configure_reed_switch | ( | bool | enable, |
interrupt_e | config | ||
) |
Enable/disable the reed switch and configure interrupt.
[in] | enable | TRUE to enable reed switch |
[in] | config | Interrupt configuration |
SENSIT_ERR_NONE | No error |
Get the state of the reed switch.
[out] | state | If FALSE, magnet not detected. If TRUE, magnet detected |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_REED_SWITCH_STATE | Reed switch is not enabled |
I2C bus driver.
[in] | addr | Sensor address. Use SENSOR_I2C_ADDR values. |
[in] | buffer | From buffer[0] to buffer[nbWrite-1]: Data to write |
[out] | buffer | From buffer[nbWrite] to buffer[nbWrite+nbRead-1]: Read data |
[in] | nbWrite | Number of bytes to write |
[in] | nbRead | Number of bytes to read |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_I2C_WRITE | Failed to write data on I2C bus |
SENSIT_ERR_I2C_READ | Failed to read data from I2C bus |
SENSIT_ERR_I2C_TIMEOUT | I2C communication timeout |
Enable/Disable interrupt from Accelerometer.
[in] | enable | TRUE to enable interrupt |
SENSIT_ERR_NONE | No error |
Initialize Non-Volatile Memory.
[in] | block_length | Non-Volatile Memory data block length |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_NVMEM_SIZE | Block length exceeds SENSIT_NV_MEM_SIZE |
Read user data from non-volatile memory.
Data length must be defined by initializing the NVMEM with SENSIT_API_init_nv_mem
[out] | data | Data read from non-volatile memory |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_NVMEM_INIT | Non-Volatile memory must be init first |
Write user data in a non-volatile memory.
Data length must be defined by initializing the NVMEM with SENSIT_API_init_nv_mem
[in] | data | Data to write in non-volatile memory |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_NVMEM_INIT | Non-Volatile memory must be init first |
SENSIT_ERR_NVMEM_WRITE | Failed to write data |
error_t SENSIT_API_init_watchdog | ( | void | ) |
Activate the watchdog.
SENSIT_API_watchdog_clear must be called at least every 26 seconds, otherwise the device will be reset.
SENSIT_ERR_NONE | No error |
error_t SENSIT_API_clear_watchdog | ( | void | ) |
Clear watchdog timer.
SENSIT_ERR_NONE | No error |
error_t SENSIT_API_init_uart | ( | void | ) |
Initialize the UART communication.
SENSIT_ERR_NONE | No error |
error_t SENSIT_API_close_uart | ( | void | ) |
Close the UART communication.
SENSIT_ERR_NONE | No error |
Send a string on the UART communication.
[in] | data | Data to send |
[in] | size | Data size |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_UART_STATE | First init the UART |
SENSIT_ERR_UART_FULL | No more space in UART Tx buffer |
Get a char from the UART Rx buffer.
[out] | c | Pointer on the read char |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_UART_STATE | First init the UART |
SENSIT_ERR_UART_EMPTY | UART Rx buffer is empty |
error_t SENSIT_API_init_usb | ( | void | ) |
Initialize USB communication of the device.
The USB interfaces will not work if your device is in sleep mode.
SENSIT_ERR_NONE | No error |
Send a string on the USB communication.
[in] | data | Data to send |
[in] | size | Data size |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_USB_STATE | First init the USB |
Get a char from the USB Rx buffer.
[out] | c | Pointer on the read character |
SENSIT_ERR_NONE | No error |
SENSIT_ERR_USB_STATE | First init the USB |
SENSIT_ERR_USB_EMPTY | USB Rx buffer empty |
Function to disable battery charger in case of use of an external power supply.
[in] | enable | TRUE to enable battery charger FALSE to disable battery charger |
SENSIT_ERR_NONE | No error |
Switch to private/test mode credentials.
Test mode credentials are used for Sigfox API test functions & Sigfox Verified Addon.
Test mode ID = 0xFEDCBA98
TEST mode key = 0x0123456789ABCDEF0123456789ABCDEF
[in] | enable | TRUE to enable test mode credentials |
SENSIT_ERR_NONE | No error |
error_t SENSIT_API_reset_device_sequence_number | ( | void | ) |
Reset device sequence number.
This fucntion can be use when you have an error during the save of sequence number (SFX_ERR_INT_EXECUTE_COM_SEQUENCE_NVM_STORAGE_MESSAGE).
SENSIT_ERR_NONE | No error |
SENSIT_ERR_RESET_SEQ_NB | Failed to reset device sequence number. |