Skip to content

Commit

Permalink
nrfx 2.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nika-nordic committed Jan 24, 2020
1 parent 9136253 commit 281cc2e
Show file tree
Hide file tree
Showing 242 changed files with 19,672 additions and 28,353 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# Changelog
All notable changes to this project are documented in this file.

## [2.1.0] - 2020-01-24
### Added
- Added HALs for DCNF, OSCILLATORS, USBREG, and VREQCTRL.
- Added support for 1-MHz clock frequency in TWIM.
- Introduced the NRFX_I2S_STATUS_TRANSFER_STOPPED flag in the I2S driver.
- Introduced the nrfx_power_compat layer that allows use of the nrfx_power API with new SoC.
- Added encryption support in the QSPI driver.
- Added support for USBD in nRF5340.
- Expanded HALs to cover new functions in nRF5340: GPIO, I2S, PDM, POWER, QSPI, and REGULATORS.
- Introduced new clock management system in the CLOCK driver.
- Introduced new audio clock configuration settings in the I2S and PDM drivers for nRF5340.
- Implemented workaround for nRF5340 anomaly 4 in the CLOCK driver.
- Implemented workaround for nRF5340 anomaly 10 in the CCM HAL.
- Implemented workaround for nRF9160 anomaly 21 and nRF5340 anomaly 6 in the NVMC HAL.
- Implemented workaround for nRF9160 anomaly 23 and nRF5340 anomaly 44 in the UARTE driver.
- Introduced the NRFX_TWIM_NO_SPURIOUS_STOP_CHECK flag in the TWIM driver.
- Added functions for getting shortcut configuration in the TWIM HAL.

### Changed
- Updated MDK to 8.30.2.
- Reorganized templates of nrfx_config header files for different SoCs. Now they are included through one common file according to the selected SoC.
- Improved the UARTE driver to consume less current after the driver uninitialization. Now all clocks are disabled properly after uninitialization.
- Improved the GPIOTE driver robustness by setting the LATCH functionality to be used by default.
- Changed names of the frequency divider symbols in the QSPI HAL to reflect the new frequencies in nRF5340. Old API names were preserved and are still supported.
- Improved spurious STOP condition handling in the TWIM driver.
- Improved sampling procedure in the advanced blocking mode in the SAADC driver.
- Improved calibration procedure in the SAADC driver for nRF5340 and nRF9160.

### Fixed
- Fixed address assertions in NVMC driver for the nRF5340 network core.
- Fixed an issue in the TWI driver that would make the driver stuck when a premature STOP condition was generated by a slave device. The driver now handles this situation properly and signals that a bus error occurred.
- Fixed the stopping procedure in the PWM driver. Previously in very specific circumstances the PWM output might be not stopped at all or might be immediately restarted.

## [2.0.0] - 2019-11-06
### Added
- Added support for nRF5340.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017 - 2019, Nordic Semiconductor ASA
Copyright (c) 2017 - 2020, Nordic Semiconductor ASA
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
3 changes: 2 additions & 1 deletion doc/drv_supp_matrix.dox
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Driver | nRF51 Series | nRF52810/nRF52811 | nRF52832 | nRF52833
@ref nrf_clock |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |
@ref nrf_comp |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross |
@ref nrf_systick |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |
@ref nrf_dcnf |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick |@tagRedCross |
@ref nrf_dppi |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick |@tagGreenTick |
@ref nrf_ecb |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross |
@ref nrf_egu |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |
Expand Down Expand Up @@ -52,7 +53,7 @@ Driver | nRF51 Series | nRF52810/nRF52811 | nRF52832 | nRF52833
@ref nrf_twis |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |
@ref nrf_uart |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross |@tagRedCross |
@ref nrf_uarte |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |
@ref nrf_usbd |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagRedCross |@tagRedCross |
@ref nrf_usbd |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross |
@ref nrf_vmc |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick |@tagGreenTick |
@ref nrf_wdt |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |

Expand Down
4 changes: 2 additions & 2 deletions doc/main_page.dox
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ in a file named:
This file, similarly to the integration files mentioned above, can be placed
in any suitable location within the host environment.
The <a href="../../templates/">templates</a> subfolder contains templates of
configuration files for all currently supported Nordic SoCs placed in respective
subfolders.
configuration files for all currently supported Nordic SoCs. These files are
included through a common nrfx_config.h file, according to the selected SoC.
Refer to the "driver configuration" section in the API reference for a given
driver for more information regarding configuration options available for it.

Expand Down
4 changes: 4 additions & 0 deletions doc/nrf5340.dox
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

@ref nrf_systick

@ref nrf_dcnf

@ref nrf_dppi

@ref nrf_ecb
Expand Down Expand Up @@ -78,6 +80,8 @@

@ref nrf_uarte

@ref nrf_usbd

@ref nrf_vmc

@ref nrf_wdt
Expand Down
5 changes: 2 additions & 3 deletions doc/nrfx.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PROJECT_NAME = "nrfx"

### EDIT THIS ###

PROJECT_NUMBER = "2.0"
PROJECT_NUMBER = "2.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 Expand Up @@ -236,8 +236,7 @@ TAB_SIZE = 4
# alias to insert a newline as if a physical newline was in the original file.

ALIASES = "tagGreenTick=@htmlonly<CENTER><font color= green>✔</font></CENTER>@endhtmlonly" \
"tagRedCross=@htmlonly<CENTER><font color= red>✖</font></CENTER>@endhtmlonly" \
"linkProductSpecification52=[nRF52840 Product Specification](http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52/dita/nrf52/chips/nrf52840_ps.html) or [nRF52832 Product Specification](http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52/dita/nrf52/chips/nrf52832_ps.html)"
"tagRedCross=@htmlonly<CENTER><font color= red>✖</font></CENTER>@endhtmlonly"

# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
Expand Down
2 changes: 2 additions & 0 deletions doc/nrfx_api.dox
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

@defgroup nrf_systick Cortex-M Systick

@defgroup nrf_dcnf DCNF

@defgroup nrf_dppi DPPI

@defgroup nrf_ecb ECB
Expand Down
2 changes: 1 addition & 1 deletion drivers/include/nrf_bitmask.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 - 2019, Nordic Semiconductor ASA
* Copyright (c) 2016 - 2020, Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion drivers/include/nrfx_adc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 - 2019, Nordic Semiconductor ASA
* Copyright (c) 2015 - 2020, Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
199 changes: 183 additions & 16 deletions drivers/include/nrfx_clock.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 - 2019, Nordic Semiconductor ASA
* Copyright (c) 2016 - 2020, Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -50,10 +50,12 @@ extern "C" {
/** @brief Clock events. */
typedef enum
{
NRFX_CLOCK_EVT_HFCLK_STARTED, ///< HFCLK has been started.
NRFX_CLOCK_EVT_LFCLK_STARTED, ///< LFCLK has been started.
NRFX_CLOCK_EVT_CTTO, ///< Calibration timeout.
NRFX_CLOCK_EVT_CAL_DONE ///< Calibration has been done.
NRFX_CLOCK_EVT_HFCLK_STARTED, ///< HFCLK has been started.
NRFX_CLOCK_EVT_LFCLK_STARTED, ///< LFCLK has been started.
NRFX_CLOCK_EVT_CTTO, ///< Calibration timeout.
NRFX_CLOCK_EVT_CAL_DONE, ///< Calibration has been done.
NRFX_CLOCK_EVT_HFCLKAUDIO_STARTED, ///< HFCLKAUDIO has been started.
NRFX_CLOCK_EVT_HFCLK192M_STARTED, ///< HFCLK192M has been started.
} nrfx_clock_evt_type_t;

/**
Expand Down Expand Up @@ -85,34 +87,137 @@ void nrfx_clock_disable(void);
/** @brief Function for uninitializing the clock module. */
void nrfx_clock_uninit(void);

/** @brief Function for starting the LFCLK. */
void nrfx_clock_lfclk_start(void);
/**
* @brief Function for starting the specified clock domain.
*
* @param[in] domain Clock domain.
*/
void nrfx_clock_start(nrf_clock_domain_t domain);

/**
* @brief Function for stopping the specified clock domain.
*
* @param[in] domain Clock domain.
*/
void nrfx_clock_stop(nrf_clock_domain_t domain);

/**
* @brief Function for checking the specified clock domain state.
*
* XTAL source is assumed for domains with multiple sources.
*
* @param[in] domain Clock domain.
* @param[out] clk_src Clock source that is running. Set to NULL if not needed.
* Ignored for HFCLKAUDIO domain. Typecast it to @ref nrf_clock_lfclk_t for
* LFCLK and @ref nrf_clock_hfclk_t for HFCLK and HFCLK192M.
*
* @retval true The clock domain is running.
* @retval false The clock domain is not running.
*/
NRFX_STATIC_INLINE bool nrfx_clock_is_running(nrf_clock_domain_t domain, void * clk_src);

/** @brief Function for stopping the LFCLK. */
void nrfx_clock_lfclk_stop(void);
#if NRF_CLOCK_HAS_HFCLK_DIV || NRF_CLOCK_HAS_HFCLK_192M
/**
* @brief Function for setting the specified clock domain divider.
*
* @param[in] domain Clock domain.
* @param[in] div New divider for the clock domain.
*
* @retval NRFX_SUCCESS Divider successfully set.
* @retval NRFX_ERROR_NOT_SUPPORTED Domain does not support setting the divider.
* @retval NRFX_ERROR_INVALID_PARAM Divider not supported by the specified domain.
*/
nrfx_err_t nrfx_clock_divider_set(nrf_clock_domain_t domain,
nrf_clock_hfclk_div_t div);

/**
* @brief Function for getting the specified clock domain divider.
*
* @param[in] domain Clock domain.
*
* @return Current divider for the specified clock domain.
*/

NRFX_STATIC_INLINE nrf_clock_hfclk_div_t nrfx_clock_divider_get(nrf_clock_domain_t domain);
#endif

/**
* @brief Function for starting the LFCLK.
*
* @note This function is deprecated. Use @ref nrfx_clock_start instead.
*/
NRFX_STATIC_INLINE void nrfx_clock_lfclk_start(void);

/**
* @brief Function for stopping the LFCLK.
*
* @note This function is deprecated. Use @ref nrfx_clock_stop instead.
*/
NRFX_STATIC_INLINE void nrfx_clock_lfclk_stop(void);

/**
* @brief Function for checking the LFCLK state.
*
* @note This function is deprecated. Use @ref nrfx_clock_is_running instead.
*
* @retval true The LFCLK is running.
* @retval false The LFCLK is not running.
*/
NRFX_STATIC_INLINE bool nrfx_clock_lfclk_is_running(void);

/** @brief Function for starting the high-accuracy source HFCLK. */
void nrfx_clock_hfclk_start(void);
/**
* @brief Function for starting the high-accuracy source HFCLK.
*
* @note This function is deprecated. Use @ref nrfx_clock_start instead.
*/
NRFX_STATIC_INLINE void nrfx_clock_hfclk_start(void);

/** @brief Function for stopping the external high-accuracy source HFCLK. */
void nrfx_clock_hfclk_stop(void);
/**
* @brief Function for stopping the external high-accuracy source HFCLK.
*
* @note This function is deprecated. Use @ref nrfx_clock_stop instead.
*/
NRFX_STATIC_INLINE void nrfx_clock_hfclk_stop(void);

/**
* @brief Function for checking the HFCLK state.
*
* @note This function is deprecated. Use @ref nrfx_clock_is_running instead.
*
* @retval true The HFCLK is running (XTAL source).
* @retval false The HFCLK is not running.
*/
NRFX_STATIC_INLINE bool nrfx_clock_hfclk_is_running(void);


#if NRF_CLOCK_HAS_HFCLKAUDIO
/**
* @brief Function for setting the HFCLKAUDIO configuration.
*
* The frequency of HFCLKAUDIO ranges from 10.666 MHz to 13.333 MHz in 40.7 Hz steps.
* To calculate @p freq_value corresponding to the chosen frequency, use the following equation:
* FREQ_VALUE = 2^16 * ((12 * f_out / 32M) - 4)
*
* @warning Chosen frequency must fit in 11.176 MHz - 11.402 MHz or 12.165 MHz - 12.411 MHz
* frequency bands.
*
* @param[in] freq_value New FREQ_VALUE for HFCLKAUDIO.
*/
NRFX_STATIC_INLINE void nrfx_clock_hfclkaudio_config_set(uint16_t freq_value);

/**
* @brief Function for getting the HFCLKAUDIO configuration.
*
* The frequency of HFCLKAUDIO ranges from 10.666 MHz to 13.333 MHz in 40.7 Hz steps.
* To calculate frequency corresponding to the returned FREQ_VALUE, use the following equation:
* f_out = 32M * (4 + FREQ_VALUE * 2^(-16))/12
*
* @return Current value of FREQ_VALUE for HFCLKAUDIO.
*/
NRFX_STATIC_INLINE uint16_t nrfx_clock_hfclkaudio_config_get(void);

#endif

/**
* @brief Function for starting the calibration of internal LFCLK.
*
Expand Down Expand Up @@ -161,8 +266,48 @@ NRFX_STATIC_INLINE uint32_t nrfx_clock_ppi_task_addr(nrf_clock_task_t task);
*/
NRFX_STATIC_INLINE uint32_t nrfx_clock_ppi_event_addr(nrf_clock_event_t event);


#ifndef NRFX_DECLARE_ONLY

#if NRF_CLOCK_HAS_HFCLK_DIV || NRF_CLOCK_HAS_HFCLK_192M
NRFX_STATIC_INLINE nrf_clock_hfclk_div_t nrfx_clock_divider_get(nrf_clock_domain_t domain)
{
switch (domain)
{
#if NRF_CLOCK_HAS_HFCLK_DIV
case NRF_CLOCK_DOMAIN_HFCLK:
return nrf_clock_hfclk_div_get(NRF_CLOCK);
#endif
#if NRF_CLOCK_HAS_HFCLK192M
case NRF_CLOCK_DOMAIN_HFCLK192M:
return nrf_clock_hfclk192m_div_get(NRF_CLOCK);
#endif
default:
NRFX_ASSERT(0);
return 0;
}
}
#endif // NRF_CLOCK_HAS_HFCLK_DIV || NRF_CLOCK_HAS_HFCLK_192M

NRFX_STATIC_INLINE void nrfx_clock_lfclk_start(void)
{
nrfx_clock_start(NRF_CLOCK_DOMAIN_LFCLK);
}

NRFX_STATIC_INLINE void nrfx_clock_lfclk_stop(void)
{
nrfx_clock_stop(NRF_CLOCK_DOMAIN_LFCLK);
}

NRFX_STATIC_INLINE void nrfx_clock_hfclk_start(void)
{
nrfx_clock_start(NRF_CLOCK_DOMAIN_HFCLK);
}

NRFX_STATIC_INLINE void nrfx_clock_hfclk_stop(void)
{
nrfx_clock_stop(NRF_CLOCK_DOMAIN_HFCLK);
}

NRFX_STATIC_INLINE uint32_t nrfx_clock_ppi_task_addr(nrf_clock_task_t task)
{
return nrf_clock_task_address_get(NRF_CLOCK, task);
Expand All @@ -173,15 +318,37 @@ NRFX_STATIC_INLINE uint32_t nrfx_clock_ppi_event_addr(nrf_clock_event_t event)
return nrf_clock_event_address_get(NRF_CLOCK, event);
}

NRFX_STATIC_INLINE bool nrfx_clock_is_running(nrf_clock_domain_t domain, void * clk_src)
{
return nrf_clock_is_running(NRF_CLOCK, domain, clk_src);
}

NRFX_STATIC_INLINE bool nrfx_clock_hfclk_is_running(void)
{
return nrf_clock_hf_is_running(NRF_CLOCK, NRF_CLOCK_HFCLK_HIGH_ACCURACY);
nrf_clock_hfclk_t clk_src;
bool ret = nrfx_clock_is_running(NRF_CLOCK_DOMAIN_HFCLK, &clk_src);
return (ret && (clk_src == NRF_CLOCK_HFCLK_HIGH_ACCURACY));
}

NRFX_STATIC_INLINE bool nrfx_clock_lfclk_is_running(void)
{
return nrf_clock_lf_is_running(NRF_CLOCK);
return nrfx_clock_is_running(NRF_CLOCK_DOMAIN_LFCLK, NULL);
}

#if NRF_CLOCK_HAS_HFCLKAUDIO

NRFX_STATIC_INLINE void nrfx_clock_hfclkaudio_config_set(uint16_t freq_value)
{
nrf_clock_hfclkaudio_config_set(NRF_CLOCK, freq_value);
}

NRFX_STATIC_INLINE uint16_t nrfx_clock_hfclkaudio_config_get(void)
{
return nrf_clock_hfclkaudio_config_get(NRF_CLOCK);
}

#endif

#endif // NRFX_DECLARE_ONLY

/** @} */
Expand Down

0 comments on commit 281cc2e

Please sign in to comment.