Skip to content

Commit

Permalink
nrfx 3.1.0 release
Browse files Browse the repository at this point in the history
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
  • Loading branch information
nika-nordic authored and Adam Wojasinski committed Jun 28, 2023
1 parent 1c72117 commit 98d6f43
Show file tree
Hide file tree
Showing 66 changed files with 9,663 additions and 6,797 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# Changelog
All notable changes to this project are documented in this file.

## [3.1.0] - 2023-06-28

### Added
- Added the HALY layer for the NFCT. HALY is an extension of the HAL layer that aggregates basic hardware use cases within single functions. Now it is used instead of HAL in the NFCT drivers.
- Added the NRFX_IN_RANGE() macro for checking if a given value is in a given range.
- Added functions for writing a word to the flash and reading a buffer, word, halfword, and byte in the NVMC HAL.

### Changed
- Updated MDK to version 8.55.0.
- Modified the power management in the SPIM driver. Now the nrfx_spim_abort() function must be called once all expected transactions using the NRFX_SPIM_FLAG_NO_XFER_EVT_HANDLER, NRFX_SPIM_FLAG_HOLD_XFER, or NRFX_SPIM_FLAG_REPEATED_XFER option flags are finalized.

### Fixed
- Fixed a workaround for the anomaly 109 on the nRF52 family in the SPIM and SPIS drivers.
- Fixed the NRFX_TIMER_FREQUENCY_STATIC_CHECK() and NRFX_SPIM_FREQUENCY_STATIC_CHECK() macros.
- Fixed the nrfx_wdt_reconfigure() function that was returning the NRFX_ERROR_INVALID_STATE error code when the driver instance has been initialized.
- Fixed the nrfx_pwm_stopped_check() function when used without user's handler function.

## [3.0.0] - 2023-04-25
### Added
- Added the HALY layer for the following peripherals: COMP, DPPI, GPIO, GPIOTE, I2S, LPCOMP, PDM, PWM, QDEC, RTC, SAADC, SPIM, TEMP, TIMER, TWIM, UARTE, WDT. HALY is an extension of the HAL layer that aggregates basic hardware use cases within single functions. Now it is used instead of HAL in the corresponding drivers.
Expand Down
2 changes: 1 addition & 1 deletion doc/nrfx.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ PROJECT_NAME = "nrfx"

### EDIT THIS ###

PROJECT_NUMBER = "3.0"
PROJECT_NUMBER = "3.1"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
13 changes: 11 additions & 2 deletions drivers/include/nrfx_nfct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define NRFX_NFCT_H__

#include <nrfx.h>
#include <hal/nrf_nfct.h>
#include <haly/nrfy_nfct.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -179,6 +179,7 @@ typedef struct
{
uint32_t rxtx_int_mask; ///< Mask for enabling RX/TX events. Indicate which events must be forwarded to the upper layer by using @ref nrfx_nfct_evt_id_t. By default, no events are enabled. */
nrfx_nfct_handler_t cb; ///< Callback.
uint8_t irq_priority; ///< Interrupt priority.
} nrfx_nfct_config_t;

/**
Expand All @@ -188,6 +189,7 @@ typedef struct
*
* @retval NRFX_SUCCESS The NFCT driver was initialized successfully.
* @retval NRFX_ERROR_INVALID_STATE The NFCT driver is already initialized.
* @retval NRFX_ERROR_FORBIDDEN The NFCT antenna pads are not configured as antenna pins.
*/
nrfx_err_t nrfx_nfct_init(nrfx_nfct_config_t const * p_config);

Expand Down Expand Up @@ -225,8 +227,11 @@ bool nrfx_nfct_field_check(void);
* @brief Function for preparing the NFCT driver for receiving an NFC frame.
*
* @param[in] p_rx_data Pointer to the RX buffer.
*
* @retval NRFX_SUCCESS The operation was successful.
* @retval NRFX_ERROR_INVALID_ADDR Data buffer does not point to memory region reachable by EasyDMA.
*/
void nrfx_nfct_rx(nrfx_nfct_data_desc_t const * p_rx_data);
nrfx_err_t nrfx_nfct_rx(nrfx_nfct_data_desc_t const * p_rx_data);

/**
* @brief Function for transmitting an NFC frame.
Expand All @@ -237,6 +242,8 @@ void nrfx_nfct_rx(nrfx_nfct_data_desc_t const * p_rx_data);
* @retval NRFX_SUCCESS The operation was successful.
* @retval NRFX_ERROR_INVALID_LENGTH The TX buffer size is invalid.
* @retval NRFX_ERROR_BUSY Driver is already transferring.
* @retval NRFX_ERROR_INVALID_ADDR Data buffer does not point to memory region reachable by
* EasyDMA.
*/
nrfx_err_t nrfx_nfct_tx(nrfx_nfct_data_desc_t const * p_tx_data,
nrf_nfct_frame_delay_mode_t delay_mode);
Expand All @@ -251,6 +258,8 @@ nrfx_err_t nrfx_nfct_tx(nrfx_nfct_data_desc_t const * p_tx_data,
* @retval NRFX_SUCCESS The operation was successful.
* @retval NRFX_ERROR_INVALID_LENGTH The TX buffer size is invalid.
* @retval NRFX_ERROR_BUSY Driver is already transferring.
* @retval NRFX_ERROR_INVALID_ADDR Data buffer does not point to memory region reachable by
* EasyDMA.
*/
nrfx_err_t nrfx_nfct_bits_tx(nrfx_nfct_data_desc_t const * p_tx_data,
nrf_nfct_frame_delay_mode_t delay_mode);
Expand Down
2 changes: 1 addition & 1 deletion drivers/include/nrfx_nvmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ NRFX_STATIC_INLINE bool nrfx_nvmc_write_done_check(void)

NRFX_STATIC_INLINE uint32_t nrfx_nvmc_uicr_word_read(uint32_t const volatile *address)
{
uint32_t value = *address;
uint32_t value = nrf_nvmc_word_read((uint32_t)address);

#if NRF91_ERRATA_7_ENABLE_WORKAROUND
__DSB();
Expand Down
12 changes: 8 additions & 4 deletions drivers/include/nrfx_saadc.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ extern "C" {
{ \
.channel_config = \
{ \
.resistor_p = NRF_SAADC_RESISTOR_DISABLED, \
.resistor_n = NRF_SAADC_RESISTOR_DISABLED, \
NRFX_COND_CODE_1(NRF_SAADC_HAS_CH_CONFIG_RES, \
(.resistor_p = NRF_SAADC_RESISTOR_DISABLED, \
.resistor_n = NRF_SAADC_RESISTOR_DISABLED,), \
()) \
.gain = NRF_SAADC_GAIN1, \
.reference = NRF_SAADC_REFERENCE_INTERNAL, \
.acq_time = NRFX_SAADC_DEFAULT_ACQTIME, \
Expand Down Expand Up @@ -115,8 +117,10 @@ extern "C" {
{ \
.channel_config = \
{ \
.resistor_p = NRF_SAADC_RESISTOR_DISABLED, \
.resistor_n = NRF_SAADC_RESISTOR_DISABLED, \
NRFX_COND_CODE_1(NRF_SAADC_HAS_CH_CONFIG_RES, \
(.resistor_p = NRF_SAADC_RESISTOR_DISABLED, \
.resistor_n = NRF_SAADC_RESISTOR_DISABLED,), \
()) \
.gain = NRF_SAADC_GAIN1, \
.reference = NRF_SAADC_REFERENCE_INTERNAL, \
.acq_time = NRFX_SAADC_DEFAULT_ACQTIME, \
Expand Down
15 changes: 13 additions & 2 deletions drivers/include/nrfx_spim.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,17 @@ void nrfx_spim_uninit(nrfx_spim_t const * p_instance);
* flag if the transfer is triggered externally by PPI. Use
* @ref nrfx_spim_start_task_address_get to get the address of the start task.
* Chip select must be configured to @ref NRF_SPIM_PIN_NOT_CONNECTED and managed outside the driver.
* If you do not expect more transfers, you should call @ref nrfx_spim_abort to inform the driver
* that the peripheral can be put into a low power state.
* - @ref NRFX_SPIM_FLAG_NO_XFER_EVT_HANDLER - No user event handler after transfer
* completion. This also means no interrupt at the end of the transfer.
* If @ref NRFX_SPIM_FLAG_NO_XFER_EVT_HANDLER is used, the driver does not set the instance into
* busy state, so you must ensure that the next transfers are set up when SPIM is not active.
* Additionally, you should call @ref nrfx_spim_abort to inform the driver that no more transfers will occur.
* @ref nrfx_spim_end_event_address_get function can be used to detect end of transfer. Option can
* be used together with @ref NRFX_SPIM_FLAG_REPEATED_XFER to prepare a sequence of SPI transfers
* without interruptions.
* without interruptions. If you do not expect more transfers, you should call @ref nrfx_spim_abort
* to inform the driver that the peripheral can be put into a low power state.
* - @ref NRFX_SPIM_FLAG_REPEATED_XFER - Prepare for repeated transfers. You can set
* up a number of transfers that will be triggered externally (for example by PPI). An example is
* a TXRX transfer with the options @ref NRFX_SPIM_FLAG_RX_POSTINC,
Expand All @@ -327,7 +331,8 @@ void nrfx_spim_uninit(nrfx_spim_t const * p_instance);
* @ref nrfx_spim_end_event_address_get can be used to get the address of the END event, which can
* be used to count the number of transfers. If @ref NRFX_SPIM_FLAG_REPEATED_XFER is used,
* the driver does not set the instance into busy state, so you must ensure that the next
* transfers are set up when SPIM is not active.
* transfers are set up when SPIM is not active. If you do not expect more transfers, you should call
* @ref nrfx_spim_abort to inform the driver that the peripheral can be put into a low power state.
*
* @note Peripherals using EasyDMA (including SPIM) require the transfer buffers
* to be placed in the Data RAM region. If this condition is not met,
Expand Down Expand Up @@ -409,6 +414,12 @@ NRFX_STATIC_INLINE uint32_t nrfx_spim_end_event_address_get(nrfx_spim_t const *
/**
* @brief Function for aborting ongoing transfer.
*
* @note You should call the function if the first transfer has been started with one or more
* of the following options: @ref NRFX_SPIM_FLAG_NO_XFER_EVT_HANDLER,
* @ref NRFX_SPIM_FLAG_HOLD_XFER, and @ref NRFX_SPIM_FLAG_REPEATED_XFER. When you do not
* expect more transfers, use this function so that the driver can put the peripheral into
* a low power state.
*
* @param[in] p_instance Pointer to the driver instance structure.
*/
void nrfx_spim_abort(nrfx_spim_t const * p_instance);
Expand Down
15 changes: 15 additions & 0 deletions drivers/nrfx_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#include <limits.h>

#include <nrf.h>
Expand Down Expand Up @@ -405,6 +406,20 @@ extern "C" {
*/
#define NRFX_MAX(a, b) ((a) > (b) ? (a) : (b))

/**
* @brief Macro for checking if a given value is in a given range.
*
* @note @p val is evaluated twice.
*
* @param[in] val A value to be checked.
* @param[in] min The lower bound (inclusive).
* @param[in] max The upper bound (inclusive).
*
* @retval true The value is in the given range.
* @retval false The value is out of the given range.
*/
#define NRFX_IN_RANGE(val, min, max) ((val) >= (min) && (val) <= (max))

/**
* @brief Macro for performing rounded integer division (as opposed to
* truncating the result).
Expand Down
4 changes: 2 additions & 2 deletions drivers/nrfx_utils_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ void NRFX_CONCAT(nrfx_, periph_name_small, _, prefix, i, _irq_handler)(void) \
)

/**
* @brief Macro for generating else if statement code blocks that assignes token \<periph_name\>\<prefix\>\<i\>\<suffix\>
* @brief Macro for generating else if statement code blocks that assignes token \<periph_name\>\<prefix\>\<i\>\<suffix\>
* to the variable \<var\> if \<p_reg\> points to the instance NRF_\<periph_name\>\<prefix\>\<i\>.
*
*
* @param[in] periph_name Peripheral name, e.g. SPIM.
* @param[in] prefix Prefix appended to the index.
* @param[in] i Index.
Expand Down
4 changes: 0 additions & 4 deletions drivers/src/nrfx_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,7 @@ void nrfx_clock_start(nrf_clock_domain_t domain)
else if (nrf_clock_start_task_check(NRF_CLOCK, NRF_CLOCK_DOMAIN_LFCLK))
{
// LF clock is not active yet but was started already. Inspect its source.
#if NRF_CLOCK_HAS_XO
lfclksrc = nrf_clock_lf_actv_src_get(NRF_CLOCK);
#else
lfclksrc = nrf_clock_lf_srccopy_get(NRF_CLOCK);
#endif
if (clock_lfclksrc_tweak(&lfclksrc))
{
// LF clock was started already and the configured source
Expand Down
Loading

0 comments on commit 98d6f43

Please sign in to comment.