Skip to content

Commit

Permalink
v2.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludovic-Lesur committed Mar 22, 2024
1 parent 0b83c01 commit f9e379f
Show file tree
Hide file tree
Showing 7 changed files with 341 additions and 233 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v2.0](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v2.0) - 22 Mar 2024

### Added

* Add **dynamic amplitude tables** computation to **support all RF output powers**.

### Fixed

* Add cast on custom RF API **error codes**.
* Fix **compilation warning** in send function when `ERROR_CODES` flag is not defined.

### Changed

* Improve **HW API interface** to support external radio front-end.
* Remove `inline` keyword on RF API **functions redirection**.
* Rename `RCx` compilation flags into `RCx_ZONE` for **Microchip MCUs compatibility**.

### Known limitations

* **LBT** not implemented.
* **Modulated CW** not supported for type approval addon.

## [v1.3](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v1.3) - 09 Nov 2023

### Added
Expand Down
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.15)
project(s2lp_rf_api)
include(ExternalProject)

#Check if Project configure by himself or by a parent project (like sfx_lib_core_protocol)
#Check if Project configure by himself or by a parent project (like sigfox-ep-lib)
if ( ${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} )
if (NOT DEFINED SIGFOX_EP_LIB_DIR)
message(FATAL_ERROR "${PROJECT_NAME} cannot be configured without -DSIGFOX_EP_LIB_DIR=<sfx_lib_core_protocol directory>")
message(FATAL_ERROR "${PROJECT_NAME} cannot be configured without -DSIGFOX_EP_LIB_DIR=<sigfox-ep-lib directory>")
endif()
add_subdirectory(${SIGFOX_EP_LIB_DIR} "${CMAKE_CURRENT_BINARY_DIR}/${SIGFOX_EP_LIB_DIR}")
else()
Expand Down Expand Up @@ -51,8 +51,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
#Precompile module
include(precompile_s2lp_rf_api)


add_library(${PROJECT_NAME}_obj OBJECT EXCLUDE_FROM_ALL src/manuf/s2lp_rf_api.c)

if (NOT TARGET s2lp_driver)
add_dependencies(${PROJECT_NAME}_obj s2lp)
endif()
Expand All @@ -63,13 +63,11 @@ target_include_directories( ${PROJECT_NAME}_obj PUBLIC
)
target_compile_definitions(${PROJECT_NAME}_obj PUBLIC ${DEF_FLAG_LIST})


add_library(${PROJECT_NAME} STATIC ${S2LP_RF_API_SOURCES})
add_dependencies(${PROJECT_NAME} precompil_${PROJECT_NAME} s2lp)
target_include_directories(${PROJECT_NAME} PUBLIC ${PRECOMPIL_DIR}/inc ${CHIP_RF_HEADERS_LIST})
target_include_directories(${PROJECT_NAME} PUBLIC ${PRECOMPIL_DIR}/inc ${CHIP_RF_HEADERS_LIST})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${DEF_FLAG_LIST})
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
#set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${PRECOMPIL_ADDON_RFP_PUBLIC_HEADERS}")
set_target_properties(${PROJECT_NAME}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${LIB_LOCATION}
Expand Down
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ The table below shows the versions compatibility between this radio example and

| **S2LP_RF_API** | **EP_LIB** |
|:---:|:---:|
| [v1.3](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v1.3) | >= [v3.4](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.4) |
| [v2.0](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v2.0) | >= [v3.5](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.5) |
| [v1.3](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v1.3) | [v3.4](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.4) |
| [v1.2](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v1.2) | [v3.2](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.2) to [v3.3](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.3) |
| [v1.1](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v1.1) | [v3.2](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.2) to [v3.3](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.3) |
| [v1.0](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v1.0) | [v3.2](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.2) to [v3.3](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.3) |
Expand Down Expand Up @@ -115,14 +116,14 @@ make precompil_s2lp_rf_api
```bash
cmake -DSIGFOX_EP_LIB_DIR=<sigfox-ep-lib path> \
-DUSE_SIGFOX_EP_FLAGS_H=OFF \
-DRC1=ON \
-DRC2=ON \
-DRC3C=ON \
-DRC3D=ON \
-DRC4=ON \
-DRC5=ON \
-DRC6=ON \
-DRC7=ON \
-DRC1_ZONE=ON \
-DRC2_ZONE=ON \
-DRC3C_ZONE=ON \
-DRC3D_ZONE=ON \
-DRC4_ZONE=ON \
-DRC5_ZONE=ON \
-DRC6_ZONE=ON \
-DRC7_ZONE=ON \
-DAPPLICATION_MESSAGES=ON \
-DCONTROL_KEEP_ALIVE_MESSAGE=ON \
-DBIDIRECTIONAL=ON \
Expand Down Expand Up @@ -177,14 +178,14 @@ make s2lp_rf_api
```bash
cmake -DSIGFOX_EP_LIB_DIR=<sigfox-ep-lib path> \
-DUSE_SIGFOX_EP_FLAGS_H=OFF \
-DRC1=ON \
-DRC2=ON \
-DRC3C=ON \
-DRC3D=ON \
-DRC4=ON \
-DRC5=ON \
-DRC6=ON \
-DRC7=ON \
-DRC1_ZONE=ON \
-DRC2_ZONE=ON \
-DRC3C_ZONE=ON \
-DRC3D_ZONE=ON \
-DRC4_ZONE=ON \
-DRC5_ZONE=ON \
-DRC6_ZONE=ON \
-DRC7_ZONE=ON \
-DAPPLICATION_MESSAGES=ON \
-DCONTROL_KEEP_ALIVE_MESSAGE=ON \
-DBIDIRECTIONAL=ON \
Expand Down
80 changes: 68 additions & 12 deletions inc/board/s2lp_hw_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "sigfox_ep_flags.h"
#endif
#include "sigfox_types.h"
#include "manuf/rf_api.h"

/*** S2LP HW API structures ***/

Expand Down Expand Up @@ -76,7 +77,7 @@ typedef enum {
* \brief S2LP external signals list.
*******************************************************************/
typedef enum {
S2LP_HW_API_SIGNAL_IRQ = 0,
S2LP_HW_API_SIGNAL_NIRQ = 0,
S2LP_HW_API_SIGNAL_LAST
} S2LP_HW_API_signal_t;

Expand All @@ -100,39 +101,84 @@ typedef enum {
typedef enum {
S2LP_HW_API_LATENCY_EXIT_SHUTDOWN = 0,
S2LP_HW_API_LATENCY_ENTER_SHUTDOWN,
S2LP_HW_API_LATENCY_INIT_TX,
S2LP_HW_API_LATENCY_DE_INIT_TX,
#ifdef BIDIRECTIONAL
S2LP_HW_API_LATENCY_INIT_RX,
S2LP_HW_API_LATENCY_DE_INIT_RX,
#endif
S2LP_HW_API_LATENCY_LAST
} S2LP_HW_API_latency_t;
#endif

/********************************
* \brief S2LP driver callback functions.
* \fn S2LP_HW_API_irq_cb_t To be called when a falling edge is detected on the S2LP GPIO.
*******************************/
/*!******************************************************************
* \brief S2LP driver IRQ callback functions.
* \fn S2LP_HW_API_irq_cb_t To be called when the corresponding IRQ occurs.
*******************************************************************/
typedef void (*S2LP_HW_API_irq_cb_t)(void);

/*!******************************************************************
* \struct S2LP_HW_API_config_t
* \brief S2LP driver configuration structure.
*******************************************************************/
typedef struct {
S2LP_HW_API_irq_cb_t gpio_irq_callback; // S2LP GPIOx pin interrupt callback.
} S2LP_HW_API_config_t;

/*!******************************************************************
* \struct S2LP_radio_parameters_t
* \brief S2LP radio parameters structure.
*******************************************************************/
typedef struct {
RF_API_mode_t rf_mode;
sfx_s8 expected_tx_power_dbm;
} S2LP_radio_parameters_t;

/*** S2LP HW API functions ***/

/*!******************************************************************
* \fn S2LP_HW_API_status_t S2LP_HW_API_open(S2LP_HW_irq_cb_t gpio_irq_callback)
* \brief Open the S2LP hardware interface. This function is called during RF_API_open() function of the manufacturer layer.
* \param[in] gpio_irq_callback: GPIO interrupt callback that must be called on S2LP GPIOx pin interrupt.
* \fn S2LP_HW_API_status_t S2LP_HW_API_open(S2LP_HW_API_config_t* hw_api_config)
* \brief This function is called during the RF_API_open() function to open the S2LP hardware interface. It should:
* \brief - Configure the S2LP_SDN pin as output.
* \brief - Enter shutdown mode and perform a delay to ensure S2LP_SDN is kept high during a minimum time.
* \brief - Configure the S2LP_GPIOx pin as IRQ input: a falling edge on this pin must call the gpio_irq_callback function passed as parameter.
* \param[in] hw_api_config: Pointer to the HW API configuration.
* \param[out] none
* \retval Function execution status.
*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_open(S2LP_HW_API_irq_cb_t gpio_irq_callback);
S2LP_HW_API_status_t S2LP_HW_API_open(S2LP_HW_API_config_t* hw_api_config);

/*!******************************************************************
* \fn S2LP_HW_API_status_t S2LP_HW_API_close(void)
* \brief Close the S2LP hardware interface. This function is called during RF_API_close() function of the manufacturer layer.
* \brief This function is called during the RF_API_close() function to close the S2LP hardware interface. It should:
* \brief - Release the S2LP_SDN and S2LP_GPIOx pins.
* \param[in] none
* \param[out] none
* \retval Function execution status.
*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_close(void);

/*!******************************************************************
* \fn S2LP_HW_API_status_t S2LP_HW_API_get_xo_frequency_hz(sfx_u32 *xo_frequency_hz)
* \brief Returns the S2LP crystal oscillator frequency.
* \fn S2LP_HW_API_status_t S2LP_HW_API_init(S2LP_radio_parameters_t *radio_parameters)
* \brief This optional function is called during the RF_API_init() function to configure additional hardware parameters.
* \param[in] radio_parameters: Pointers to the radio parameters.
* \param[out] none
* \retval Function execution status.
*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_init(S2LP_radio_parameters_t *radio_parameters);

/*!******************************************************************
* \fn S2LP_HW_API_status_t S2LP_HW_API_de_init(void)
* \brief This optional function is called during the RF_API_de_init() function to release additional hardware parameters.
* \param[in] none
* \param[out] none
* \retval Function execution status.
*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_de_init(void);

/*!******************************************************************
* \fn S2LP_HW_API_status_t S2LP_HW_API_get_oscillator(S2LP_HW_API_oscillator_type_t *xo_type, sfx_u32 *xo_frequency_hz)
* \brief Returns the crystal oscillator parameters attached to the S2LP.
* \param[in] none
* \param[out] xo_type: Pointer to the type of oscillator attached to S2LP.
* \param[out] xo_frequency_hz: Pointer to the frequency of the oscillator attached to S2LP.
Expand All @@ -149,6 +195,16 @@ S2LP_HW_API_status_t S2LP_HW_API_get_oscillator(S2LP_HW_API_oscillator_type_t *x
*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_get_gpio(S2LP_HW_API_signal_t signal, S2LP_HW_API_gpio_t *s2lp_gpio);

/*!******************************************************************
* \fn S2LP_HW_API_status_t S2LP_HW_API_get_tx_power(sfx_s8 expected_tx_power_dbm, sfx_s8 *s2lp_tx_power_dbm)
* \brief Returns the effective RF output power to program on the S2LP to get the expected value at board level.
* \brief This function is required when an external gain has to be compensated (typical case of an external PA). Otherwise the S2LP output power equals the expected value.
* \param[in] expected_tx_power_dbm: Expected output power in dBm (given by applicative level).
* \param[out] s2lp_tx_power_dbm: Pointer to the effective output power in dBm to program on the S2LP transceiver.
* \retval Function execution status.
*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_get_tx_power(sfx_s8 expected_tx_power_dbm, sfx_s8 *s2lp_tx_power_dbm);

#if (defined TIMER_REQUIRED) && (defined LATENCY_COMPENSATION)
/*!******************************************************************
* \fn S2LP_HW_API_status_t S2LP_HW_API_get_latency(S2LP_HW_API_latency_t latency_type, sfx_u32 *latency_ms)
Expand Down
4 changes: 2 additions & 2 deletions inc/manuf/s2lp_rf_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#ifdef USE_SIGFOX_EP_FLAGS_H
#include "sigfox_ep_flags.h"
#endif
#include "sigfox_types.h"
#include "manuf/rf_api.h"

/*** S2LP RF API structures ***/
Expand All @@ -57,7 +58,6 @@ typedef enum {
S2LP_RF_API_ERROR_MODULATION,
S2LP_RF_API_ERROR_GPIO,
S2LP_RF_API_ERROR_TX_POWER,
S2LP_RF_API_ERROR_SYMBOL_TABLE,
S2LP_RF_API_ERROR_LATENCY_TYPE,
S2LP_RF_API_ERROR_STATE,
// Low level errors.
Expand Down Expand Up @@ -125,7 +125,7 @@ RF_API_status_t S2LP_RF_API_sleep(void);
/*!******************************************************************
* \fn RF_API_status_t S2LP_RF_API_init(RF_API_radio_parameters_t *radio_parameters)
* \brief Initialize the radio operation before each individual frame transmission or reception.
* \param[in] radio_parameters: Pointers to the radio parameters.
* \param[in] radio_parameters: Pointer to the radio parameters.
* \param[out] none
* \retval Function execution status.
*******************************************************************/
Expand Down
39 changes: 27 additions & 12 deletions src/board/s2lp_hw_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,18 @@
#ifdef USE_SIGFOX_EP_FLAGS_H
#include "sigfox_ep_flags.h"
#endif
// Sigfox EP library.
#include "sigfox_error.h"
#include "sigfox_types.h"
#include "manuf/rf_api.h"

/*** S2LP HW API functions ***/

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_open(S2LP_HW_API_irq_cb_t gpio_irq_callback) {
S2LP_HW_API_status_t S2LP_HW_API_open(S2LP_HW_API_config_t* hw_api_config) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
#endif

// Configure the S2LP_SDN pin as output.
// Enter shutdown mode.
// Perform a 100ms delay to ensure S2LP_SDN is kept high during a minimum time.

// Configure the S2LP_GPIOx pin as IRQ input.
// A falling edge on this pins wakes-up the MCU in order to handle radio interrupts.
// The gpio_irq_callback function has to be called when such event occurs.

RETURN();
}

Expand All @@ -69,9 +60,24 @@ S2LP_HW_API_status_t S2LP_HW_API_close(void) {
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
#endif
RETURN();
}

// Release the S2LP_SDN and S2LP_GPIOx pins.
/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_init(S2LP_radio_parameters_t *radio_parameters) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
#endif
RETURN();
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_de_init(void) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
#endif
RETURN();
}

Expand All @@ -93,6 +99,15 @@ S2LP_HW_API_status_t S2LP_HW_API_get_gpio(S2LP_HW_API_signal_t signal, S2LP_HW_A
RETURN();
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_get_tx_power(sfx_s8 expected_tx_power_dbm, sfx_s8 *s2lp_tx_power_dbm) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
#endif
RETURN();
}

#if (defined TIMER_REQUIRED) && (defined LATENCY_COMPENSATION)
/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_get_latency(S2LP_HW_API_latency_t latency_type, sfx_u32 *latency_ms) {
Expand Down
Loading

0 comments on commit f9e379f

Please sign in to comment.