mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #15989 from haukepetersen/opt_nrf52_dcdcento1
cpu/nrf5x: enhance enabling of internal DC/DC converter
This commit is contained in:
commit
b10ce9784a
@ -81,11 +81,6 @@ static const i2c_conf_t i2c_config[] = {
|
||||
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -11,5 +11,6 @@ config BOARD_COMMON_NRF52XXXDK
|
||||
select HAS_PERIPH_PWM
|
||||
select HAS_PERIPH_SPI
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -3,5 +3,6 @@ FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_pwm
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.features
|
||||
|
@ -68,11 +68,6 @@ static const pwm_conf_t pwm_config[] = {
|
||||
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -14,5 +14,6 @@ config BOARD_COMMON_PARTICLE_MESH
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_PERIPH_USBDEV
|
||||
select HAS_HIGHLEVEL_STDIO
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -6,6 +6,7 @@ FEATURES_PROVIDED += periph_pwm
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += periph_usbdev
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
# Various other features (if any)
|
||||
|
||||
|
@ -15,5 +15,6 @@ config BOARD_DWM1001
|
||||
select HAS_PERIPH_I2C
|
||||
select HAS_PERIPH_SPI
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -4,5 +4,6 @@ CPU_MODEL = nrf52832xxaa
|
||||
FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.features
|
||||
|
@ -77,11 +77,6 @@ static const i2c_conf_t i2c_config[] = {
|
||||
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -16,5 +16,6 @@ config BOARD_MICROBIT_V2
|
||||
select HAS_PERIPH_PWM
|
||||
select HAS_PERIPH_SPI
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -5,6 +5,7 @@ FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_pwm
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
# include common nrf52 based boards features
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.features
|
||||
|
@ -29,11 +29,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
/**
|
||||
* @name UART configuration
|
||||
* @{
|
||||
|
@ -16,5 +16,6 @@ config BOARD_NRF51DK
|
||||
select HAS_PERIPH_SPI
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_PERIPH_UART_HW_FC
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf51/Kconfig"
|
||||
|
@ -5,6 +5,7 @@ FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += periph_uart_hw_fc
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
# include common nrf51 based boards features
|
||||
include $(RIOTBOARD)/common/nrf51/Makefile.features
|
||||
|
@ -73,11 +73,6 @@ static const i2c_conf_t i2c_config[] = {
|
||||
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -14,5 +14,6 @@ config BOARD_NRF52832_MDK
|
||||
select CPU_MODEL_NRF52832XXAA
|
||||
select HAS_PERIPH_I2C
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -3,5 +3,6 @@ CPU_MODEL = nrf52832xxaa
|
||||
# Put defined MCU peripherals here (in alphabetical order)
|
||||
FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.features
|
||||
|
@ -40,11 +40,6 @@ extern "C" {
|
||||
#define UART_PIN_TX GPIO_PIN(0,20)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -16,5 +16,6 @@ config BOARD_NRF52840_MDK
|
||||
select HAS_PERIPH_SPI
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_PERIPH_USBDEV
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -5,6 +5,7 @@ FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += periph_usbdev
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
# Various other features (if any)
|
||||
|
||||
|
@ -53,11 +53,6 @@ static const uart_conf_t uart_config[] = {
|
||||
#define UART_NUMOF ARRAY_SIZE(uart_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -14,5 +14,6 @@ config BOARD_NRF52840DK
|
||||
select CPU_MODEL_NRF52840XXAA
|
||||
select HAS_PERIPH_PWM
|
||||
select HAS_PERIPH_USBDEV
|
||||
select HAS_VDD_LC_FILTER_REG0
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52xxxdk/Kconfig"
|
||||
|
@ -5,3 +5,4 @@ include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.features
|
||||
# Various other features (if any)
|
||||
FEATURES_PROVIDED += periph_pwm
|
||||
FEATURES_PROVIDED += periph_usbdev
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg0
|
||||
|
@ -16,5 +16,7 @@ config BOARD_NRF52840DONGLE
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_PERIPH_USBDEV
|
||||
select HAS_HIGHLEVEL_STDIO
|
||||
select HAS_VDD_LC_FILTER_REG0
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -4,6 +4,8 @@ CPU_MODEL = nrf52840xxaa
|
||||
FEATURES_PROVIDED += periph_pwm
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += periph_usbdev
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg0
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
# Various other features (if any)
|
||||
FEATURES_PROVIDED += highlevel_stdio
|
||||
|
@ -71,13 +71,6 @@ static const pwm_conf_t pwm_config[] = {
|
||||
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#ifndef NRF5X_ENABLE_DCDC
|
||||
#define NRF5X_ENABLE_DCDC 1
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -60,11 +60,6 @@ static const uart_conf_t uart_config[] = {
|
||||
#define UART_NUMOF ARRAY_SIZE(uart_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -60,11 +60,6 @@ static const uart_conf_t uart_config[] = {
|
||||
#define UART_NUMOF ARRAY_SIZE(uart_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -60,11 +60,6 @@ static const uart_conf_t uart_config[] = {
|
||||
#define UART_NUMOF ARRAY_SIZE(uart_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -14,5 +14,6 @@ config BOARD_PINETIME
|
||||
select CPU_MODEL_NRF52832XXAA
|
||||
select HAS_PERIPH_I2C
|
||||
select HAS_PERIPH_SPI
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -4,5 +4,6 @@ CPU_MODEL = nrf52832xxaa
|
||||
FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
#FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.features
|
||||
|
@ -64,11 +64,6 @@ static const i2c_conf_t i2c_config[] = {
|
||||
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -16,5 +16,6 @@ config BOARD_REEL
|
||||
select HAS_PERIPH_SPI
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_PERIPH_USBDEV
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -5,6 +5,7 @@ FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += periph_usbdev
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
# Various other features (if any)
|
||||
|
||||
|
@ -68,11 +68,6 @@ static const spi_conf_t spi_config[] = {
|
||||
#define SPI_NUMOF ARRAY_SIZE(spi_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -14,5 +14,6 @@ config BOARD_RUUVITAG
|
||||
select CPU_MODEL_NRF52832XXAA
|
||||
select HAS_PERIPH_SPI
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -3,5 +3,6 @@ CPU_MODEL = nrf52832xxaa
|
||||
# Put defined MCU peripherals here (in alphabetical order)
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.features
|
||||
|
@ -55,11 +55,6 @@ static const spi_conf_t spi_config[] = {
|
||||
#define UART_PIN_TX GPIO_PIN(0, 5)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -14,5 +14,6 @@ config BOARD_THINGY52
|
||||
select CPU_MODEL_NRF52832XXAA
|
||||
select HAS_PERIPH_I2C
|
||||
select HAS_PERIPH_UART
|
||||
select HAS_VDD_LC_FILTER_REG1
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
@ -3,5 +3,6 @@ CPU_MODEL = nrf52832xxaa
|
||||
# Put defined MCU peripherals here (in alphabetical order)
|
||||
FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += vdd_lc_filter_reg1
|
||||
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.features
|
||||
|
@ -62,11 +62,6 @@ static const i2c_conf_t i2c_config[] = {
|
||||
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Enable the internal DC/DC converter
|
||||
*/
|
||||
#define NRF5X_ENABLE_DCDC
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -43,4 +43,16 @@ config HAS_RADIO_NRFMIN
|
||||
Indicates that a radio compatible with the nRF minimal radio driver is
|
||||
present.
|
||||
|
||||
config HAS_VDD_LC_FILTER_REG0
|
||||
bool
|
||||
help
|
||||
Indicates that a board is equipped with an external LC filter circuit
|
||||
attached to the CPUs voltage regulator stage 0.
|
||||
|
||||
config HAS_VDD_LC_FILTER_REG1
|
||||
bool
|
||||
help
|
||||
Indicates that a board is equipped with an external LC filter circuit
|
||||
attached to the CPUs voltage regulator stage 1.
|
||||
|
||||
source "$(RIOTCPU)/cortexm_common/Kconfig"
|
||||
|
@ -3,3 +3,10 @@ USEMODULE += nrf5x_common_periph
|
||||
|
||||
# link common cpu code
|
||||
USEMODULE += cpu_common
|
||||
|
||||
# per default, enable DCDC converter if an external LC filter is provided
|
||||
# reg1 feature denotes state 1 on two-stage regulator models or the single
|
||||
# state in single-regulator models
|
||||
FEATURES_OPTIONAL += vdd_lc_filter_reg1
|
||||
# reg0 feature denotes stage 0 two-stage regulator models
|
||||
FEATURES_OPTIONAL += vdd_lc_filter_reg0
|
||||
|
@ -32,26 +32,30 @@ extern "C" {
|
||||
/**
|
||||
* @brief Enable the internal DC/DC power converter for the NRF5x MCU.
|
||||
*
|
||||
* The internal DC/DC converter is more efficient compared to the LDO regulator.
|
||||
* The downside of the DC/DC converter is that it requires an external inductor
|
||||
* to be present on the board. Enabling the DC/DC converter is guarded with
|
||||
* NRF5X_ENABLE_DCDC, this macro must be defined if the DC/DC converter is to be
|
||||
* enabled.
|
||||
* In most cases, the internal DC/DC converter is more efficient compared to the
|
||||
* LDO regulator. The downside of the DC/DC converter is that it requires an
|
||||
* external LC filter to be present on the board. Per default, the DC/DC
|
||||
* converter is enabled if an LC filter is present (VDD_LC_FILTER_REGx feature).
|
||||
*
|
||||
* Independent of the presence of the LC filter, the DC/DC converter(s) can be
|
||||
* disabled by blacklisting the VDD_LC_FILTER_REGx feature, e.g. build using
|
||||
* `FEATURES_BLACKLIST=VDD_LC_FILTER_REG1 make all`.
|
||||
*/
|
||||
static inline void nrfx_dcdc_init(void)
|
||||
{
|
||||
#ifdef NRF5X_ENABLE_DCDC
|
||||
NRF_POWER->DCDCEN = 1;
|
||||
if (IS_ACTIVE(MODULE_VDD_LC_FILTER_REG1)) {
|
||||
NRF_POWER->DCDCEN = 1;
|
||||
}
|
||||
|
||||
/* on CPUs that support high voltage power supply via VDDH and thus use a
|
||||
* two stage regulator, we also enable the DC/DC converter for the first
|
||||
* state. */
|
||||
#ifdef POWER_DCDCEN0_DCDCEN_Msk
|
||||
if (NRF_POWER->MAINREGSTATUS == POWER_MAINREGSTATUS_MAINREGSTATUS_High) {
|
||||
/* on CPUs that support high voltage power supply via VDDH and thus use a
|
||||
* two stage regulator, we also try to enable the DC/DC converter for the
|
||||
* first stage */
|
||||
if (IS_ACTIVE(MODULE_VDD_LC_FILTER_REG0) &&
|
||||
(NRF_POWER->MAINREGSTATUS == POWER_MAINREGSTATUS_MAINREGSTATUS_High)) {
|
||||
NRF_POWER->DCDCEN0 = 1;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -57,3 +57,6 @@ endif
|
||||
|
||||
# use efm32_coretemp if the feature is used
|
||||
USEMODULE += $(filter efm32_coretemp, $(FEATURES_USED))
|
||||
|
||||
# if LC filter(s) is attached to the CPUs voltage regulator, use it
|
||||
USEMODULE += $(filter vdd_lc_filter_%,$(FEATURES_USED))
|
||||
|
@ -147,6 +147,7 @@ PSEUDOMODULES += stm32mp1_eng_mode
|
||||
PSEUDOMODULES += suit_transport_%
|
||||
PSEUDOMODULES += suit_storage_%
|
||||
PSEUDOMODULES += sys_bus_%
|
||||
PSEUDOMODULES += vdd_lc_filter_%
|
||||
PSEUDOMODULES += wakaama_objects_%
|
||||
PSEUDOMODULES += wifi_enterprise
|
||||
PSEUDOMODULES += xtimer_on_ztimer
|
||||
|
Loading…
Reference in New Issue
Block a user