Skip to content

Commit

Permalink
v3.1 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricB31 committed May 30, 2024
1 parent 9a6b6e4 commit 417f31d
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 32 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v3.1](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v3.1) - 30 May 2024

### Added

* Add weak attribute to functions templates.
* Add **SFX_UNUSED** macro to remove extra warnings.

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

### Added
Expand Down
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ if ( ${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} )
endif()
add_subdirectory(${SIGFOX_EP_LIB_DIR} "${CMAKE_CURRENT_BINARY_DIR}/${SIGFOX_EP_LIB_DIR}")
else()
set(SIGFOX_EP_LIB_DIR ${CMAKE_SOURCE_DIR})
message("${PROJECT_NAME} is Fetched by a parent project")
if (NOT DEFINED SIGFOX_EP_LIB_DIR)
set(SIGFOX_EP_LIB_DIR ${CMAKE_SOURCE_DIR})
message("${PROJECT_NAME} is Fetched by a parent project")
endif()
endif()

set (S2LP_RF_API_SOURCES
Expand Down Expand Up @@ -54,7 +56,7 @@ 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)
add_dependencies(${PROJECT_NAME}_obj s2lp)
endif()
target_include_directories( ${PROJECT_NAME}_obj PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/inc
Expand All @@ -64,10 +66,13 @@ 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)
add_dependencies(${PROJECT_NAME} precompil_${PROJECT_NAME} )
if (NOT TARGET s2lp_driver)
add_dependencies(${PROJECT_NAME} s2lp)
endif()
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)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror)
set_target_properties(${PROJECT_NAME}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${LIB_LOCATION}
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ The table below shows the versions compatibility between this radio example and

| **S2LP_RF_API** | **EP_LIB** |
|:---:|:---:|
| [v3.0](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v3.0) | >= [v3.5](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.5) |
| [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) |
| [v3.1](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v3.1) | >= [v3.6](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.6) |
| [v3.0](https://github.com/sigfox-tech-radio/sigfox-ep-rf-api-st-s2lp/releases/tag/v3.0) | [v3.5](https://github.com/sigfox-tech-radio/sigfox-ep-lib/releases/tag/v3.5) |
| [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) |
Expand Down
21 changes: 16 additions & 5 deletions src/board/S2LP_CORE_SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,42 @@
/*** S2LP CORE SPI functions ***/

/*******************************************************************/
sfx_u8 S2LPSpiWriteRegisters(sfx_u8 register_address, sfx_u8 data_size, sfx_u8* data) {
sfx_u8 __attribute__((weak)) S2LPSpiWriteRegisters(sfx_u8 register_address, sfx_u8 data_size, sfx_u8* data) {
/* To be implemented by the device manufacturer */
SFX_UNUSED(register_address);
SFX_UNUSED(data_size);
SFX_UNUSED(data);
return 0;
}

/*******************************************************************/
sfx_u8 S2LPSpiReadRegisters(sfx_u8 register_address, sfx_u8 data_size, sfx_u8* data) {
sfx_u8 __attribute__((weak)) S2LPSpiReadRegisters(sfx_u8 register_address, sfx_u8 data_size, sfx_u8* data) {
/* To be implemented by the device manufacturer */
SFX_UNUSED(register_address);
SFX_UNUSED(data_size);
SFX_UNUSED(data);
return 0;
}

/*******************************************************************/
sfx_u8 S2LPSpiCommandStrobes(sfx_u8 command) {
sfx_u8 __attribute__((weak)) S2LPSpiCommandStrobes(sfx_u8 command) {
/* To be implemented by the device manufacturer */
SFX_UNUSED(command);
return 0;
}

/*******************************************************************/
sfx_u8 S2LPSpiWriteFifo(sfx_u8 data_size, sfx_u8* data) {
sfx_u8 __attribute__((weak)) S2LPSpiWriteFifo(sfx_u8 data_size, sfx_u8* data) {
/* To be implemented by the device manufacturer */
SFX_UNUSED(data_size);
SFX_UNUSED(data);
return 0;
}

/*******************************************************************/
sfx_u8 S2LPSpiReadFifo(sfx_u8 data_size, sfx_u8* data) {
sfx_u8 __attribute__((weak)) S2LPSpiReadFifo(sfx_u8 data_size, sfx_u8* data) {
/* To be implemented by the device manufacturer */
SFX_UNUSED(data_size);
SFX_UNUSED(data);
return 0;
}
30 changes: 20 additions & 10 deletions src/board/s2lp_hw_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@
/*** S2LP HW API functions ***/

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_open(S2LP_HW_API_config_t* hw_api_config) {
S2LP_HW_API_status_t __attribute__((weak)) 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
SFX_UNUSED(hw_api_config);
RETURN();
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_close(void) {
S2LP_HW_API_status_t __attribute__((weak)) S2LP_HW_API_close(void) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
Expand All @@ -64,16 +65,17 @@ S2LP_HW_API_status_t S2LP_HW_API_close(void) {
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_init(S2LP_radio_parameters_t *radio_parameters) {
S2LP_HW_API_status_t __attribute__((weak)) 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
SFX_UNUSED(radio_parameters);
RETURN();
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_de_init(void) {
S2LP_HW_API_status_t __attribute__((weak)) 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;
Expand All @@ -82,7 +84,7 @@ S2LP_HW_API_status_t S2LP_HW_API_de_init(void) {
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_enter_shutdown(void) {
S2LP_HW_API_status_t __attribute__((weak)) S2LP_HW_API_enter_shutdown(void) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
Expand All @@ -91,7 +93,7 @@ S2LP_HW_API_status_t S2LP_HW_API_enter_shutdown(void) {
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_exit_shutdown(void) {
S2LP_HW_API_status_t __attribute__((weak)) S2LP_HW_API_exit_shutdown(void) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
Expand All @@ -100,39 +102,47 @@ S2LP_HW_API_status_t S2LP_HW_API_exit_shutdown(void) {
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_get_oscillator(S2LP_HW_API_oscillator_type_t *xo_type, sfx_u32 *xo_frequency_hz) {
S2LP_HW_API_status_t __attribute__((weak)) S2LP_HW_API_get_oscillator(S2LP_HW_API_oscillator_type_t *xo_type, sfx_u32 *xo_frequency_hz) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
#endif
SFX_UNUSED(xo_type);
SFX_UNUSED(xo_frequency_hz);
RETURN();
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_get_gpio(S2LP_HW_API_signal_t signal, S2LP_HW_API_gpio_t *s2lp_gpio) {
S2LP_HW_API_status_t __attribute__((weak)) S2LP_HW_API_get_gpio(S2LP_HW_API_signal_t signal, S2LP_HW_API_gpio_t *s2lp_gpio) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
#endif
SFX_UNUSED(signal);
SFX_UNUSED(s2lp_gpio);
RETURN();
}

/*******************************************************************/
S2LP_HW_API_status_t S2LP_HW_API_get_tx_power(sfx_s8 expected_tx_power_dbm, sfx_s8 *s2lp_tx_power_dbm) {
S2LP_HW_API_status_t __attribute__((weak)) 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
SFX_UNUSED(expected_tx_power_dbm);
SFX_UNUSED(s2lp_tx_power_dbm);
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) {
S2LP_HW_API_status_t __attribute__((weak)) S2LP_HW_API_get_latency(S2LP_HW_API_latency_t latency_type, sfx_u32 *latency_ms) {
/* To be implemented by the device manufacturer */
#ifdef ERROR_CODES
S2LP_HW_API_status_t status = S2LP_HW_API_SUCCESS;
#endif
SFX_UNUSED(latency_type);
SFX_UNUSED(latency_ms);
RETURN();
}
#endif
12 changes: 2 additions & 10 deletions src/manuf/s2lp_rf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ typedef struct {
/*** S2LP RF API local global variables ***/

#ifdef VERBOSE
static const sfx_u8 S2LP_RF_API_VERSION[] = "v3.0";
static const sfx_u8 S2LP_RF_API_VERSION[] = "v3.1";
#endif
// Amplitude profile tables for ramp and bit 0 transmission at maximum output power.
static const sfx_u8 S2LP_RF_API_RAMP_AMPLITUDE_PROFILE[S2LP_RF_API_SYMBOL_PROFILE_SIZE_BYTES] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 5, 7, 10, 14, 19, 25, 31, 39, 60, 220};
Expand Down Expand Up @@ -936,17 +936,9 @@ RF_API_status_t S2LP_RF_API_get_dl_phy_content_and_rssi(sfx_u8 *dl_phy_content,
RF_API_status_t S2LP_RF_API_carrier_sense(RF_API_carrier_sense_parameters_t *carrier_sense_params) {
#ifdef ERROR_CODES
RF_API_status_t status = RF_API_SUCCESS;
#endif
#ifdef PARAMETERS_CHECK
// Check parameter.
if (carrier_sense_params == SFX_NULL) {
EXIT_ERROR((RF_API_status_t) S2LP_RF_API_ERROR_NULL_PARAMETER);
}
#endif
/* To be implemented by the device manufacturer */
#ifdef PARAMETERS_CHECK
errors:
#endif
SFX_UNUSED(carrier_sense_params);
RETURN();
}
#endif
Expand Down

0 comments on commit 417f31d

Please sign in to comment.