|
STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
|
Peripheral clock gating, oscillators, PLL, SYSCLK switch and reset cause. More...
Macros | |
| #define | RCC_CLOCK_READY_TIMEOUT_ITERATIONS (100000U) |
| Polls allowed for each oscillator, PLL or SWS wait (see Poll-count timeouts). | |
Functions | |
| static DriverStatus_e | rccGpioClockBit (const GpioRegisters_t *port, uint32_t *bit) |
| Map a GPIO port to its AHB1ENR bit. | |
| static uint32_t | rccActiveSysclkSource (const RccRegisters_t *rcc) |
| The SYSCLK source in use, from CFGR.SWS (not the requested CFGR.SW). | |
| static DriverStatus_e | rccOscillatorDisableGuard (const RccRegisters_t *rcc, uint32_t sysclk_value, uint32_t pllsrc_value) |
| Report whether an oscillator feeds SYSCLK, directly or through the PLL. | |
| static DriverStatus_e | rccWaitCrFlag (const RccRegisters_t *rcc, uint32_t ready_bit, uint32_t expected) |
Poll a CR ready flag until it reaches expected or the budget runs out. | |
| static DriverStatus_e | rccValidateHpre (uint32_t hpre) |
Check that hpre is one of the nine RCC_CFGR_HPRE_DIV* values. | |
| static DriverStatus_e | rccValidatePpre (uint32_t ppre) |
Check that ppre is one of the five RCC_CFGR_PPRE_DIV* values. | |
Peripheral clock gating | |
| DRIVER_MUST_CHECK DriverStatus_e | rccGpioClockEnable (RccRegisters_t *rcc, const GpioRegisters_t *port) |
| Enable a GPIO port's clock. | |
| DRIVER_MUST_CHECK DriverStatus_e | rccGpioClockDisable (RccRegisters_t *rcc, const GpioRegisters_t *port) |
| Disable a GPIO port's clock. | |
| void | rccUsart2ClockEnable (RccRegisters_t *rcc) |
| Enable USART2's clock. | |
| void | rccUsart2ClockDisable (RccRegisters_t *rcc) |
| Disable USART2's clock. | |
| void | rccWwdgClockEnable (RccRegisters_t *rcc) |
| Enable the WWDG's clock; needed before any WWDG access. | |
| void | rccWwdgClockDisable (RccRegisters_t *rcc) |
| Disable the WWDG's clock. | |
| void | rccSyscfgClockEnable (RccRegisters_t *rcc) |
| Enable SYSCFG's clock; needed before any SYSCFG access (e.g. | |
| void | rccSyscfgClockDisable (RccRegisters_t *rcc) |
| Disable SYSCFG's clock. | |
| void | rccPwrClockEnable (RccRegisters_t *rcc) |
| Enable PWR's clock; needed before any PWR access. | |
| void | rccPwrClockDisable (RccRegisters_t *rcc) |
| Disable PWR's clock. | |
Reset cause | |
| uint32_t | rccResetFlags (const RccRegisters_t *rcc) |
| The reset-cause flags set since they were last cleared. | |
| void | rccClearResetFlags (RccRegisters_t *rcc) |
| Clear every reset-cause flag (CSR.RMVF). | |
| #define | RCC_RESET_FLAGS_Msk |
| Every CSR reset-cause flag; rccResetFlags() returns a subset of these. | |
Oscillators | |
| DRIVER_MUST_CHECK DriverStatus_e | rccHsiEnable (RccRegisters_t *rcc) |
| Turn on the 16 MHz internal oscillator (HSI) and wait until ready. | |
| DRIVER_MUST_CHECK DriverStatus_e | rccHsiDisable (RccRegisters_t *rcc) |
| Turn off HSI and wait until HSIRDY clears. | |
| DRIVER_MUST_CHECK DriverStatus_e | rccHseEnable (RccRegisters_t *rcc, uint32_t bypass) |
| Turn on the external oscillator (HSE) and wait until ready. | |
| DRIVER_MUST_CHECK DriverStatus_e | rccHseDisable (RccRegisters_t *rcc) |
| Turn off HSE and wait until HSERDY clears. | |
Main PLL | |
| DRIVER_MUST_CHECK DriverStatus_e | rccPllConfig (RccRegisters_t *rcc, uint32_t source, uint32_t m, uint32_t n, uint32_t p) |
| Set the PLL's input source and M, N and P. | |
| DRIVER_MUST_CHECK DriverStatus_e | rccPllEnable (RccRegisters_t *rcc) |
| Turn on the PLL and wait for lock. | |
| DRIVER_MUST_CHECK DriverStatus_e | rccPllDisable (RccRegisters_t *rcc) |
| Turn off the PLL and wait until PLLRDY clears. | |
Bus prescalers and SYSCLK | |
| DRIVER_MUST_CHECK DriverStatus_e | rccBusPrescalerConfig (RccRegisters_t *rcc, uint32_t hpre, uint32_t ppre1, uint32_t ppre2) |
| Set the AHB, APB1 and APB2 prescalers. | |
| DRIVER_MUST_CHECK DriverStatus_e | rccSysclkSwitch (RccRegisters_t *rcc, FlashRegisters_t *flash, uint32_t source, uint32_t latency) |
| Switch SYSCLK to a ready source and set the flash latency it needs. | |
Peripheral clock gating, oscillators, PLL, SYSCLK switch and reset cause.
| #define RCC_RESET_FLAGS_Msk |
Every CSR reset-cause flag; rccResetFlags() returns a subset of these.
Definition at line 108 of file rcc.h.
Referenced by rccResetFlags().
| #define RCC_CLOCK_READY_TIMEOUT_ITERATIONS (100000U) |
Polls allowed for each oscillator, PLL or SWS wait (see Poll-count timeouts).
Definition at line 16 of file rcc.c.
Referenced by rccSysclkSwitch(), and rccWaitCrFlag().
| DriverStatus_e rccGpioClockEnable | ( | RccRegisters_t * | rcc, |
| const GpioRegisters_t * | port ) |
Enable a GPIO port's clock.
| rcc | RCC block (e.g. RCC). |
| port | Port to enable, GPIOA to GPIOH; compared by address, never dereferenced. |
| DRIVER_STATUS_OK | Enabled. |
| DRIVER_STATUS_ERR_INVALID_PARAM | port is not GPIOA to GPIOH. |
Definition at line 69 of file rcc.c.
References RccRegisters_t::AHB1ENR, DRIVER_STATUS_OK, rccGpioClockBit(), and rccGpioClockEnable().
Referenced by rccGpioClockEnable().
| DriverStatus_e rccGpioClockDisable | ( | RccRegisters_t * | rcc, |
| const GpioRegisters_t * | port ) |
Disable a GPIO port's clock.
| rcc | RCC block (e.g. RCC). |
| port | Port to disable, GPIOA to GPIOH. |
| DRIVER_STATUS_OK | Disabled. |
| DRIVER_STATUS_ERR_INVALID_PARAM | port is not GPIOA to GPIOH. |
Definition at line 83 of file rcc.c.
References RccRegisters_t::AHB1ENR, DRIVER_STATUS_OK, rccGpioClockBit(), and rccGpioClockDisable().
Referenced by rccGpioClockDisable().
| void rccUsart2ClockEnable | ( | RccRegisters_t * | rcc | ) |
Enable USART2's clock.
| rcc | RCC block (e.g. RCC). |
Definition at line 96 of file rcc.c.
References RccRegisters_t::APB1ENR, RCC_APB1ENR_USART2EN, and rccUsart2ClockEnable().
Referenced by rccUsart2ClockEnable().
| void rccUsart2ClockDisable | ( | RccRegisters_t * | rcc | ) |
Disable USART2's clock.
| rcc | RCC block (e.g. RCC). |
Definition at line 102 of file rcc.c.
References RccRegisters_t::APB1ENR, RCC_APB1ENR_USART2EN, and rccUsart2ClockDisable().
Referenced by rccUsart2ClockDisable().
| void rccWwdgClockEnable | ( | RccRegisters_t * | rcc | ) |
Enable the WWDG's clock; needed before any WWDG access.
| rcc | RCC block (e.g. RCC). |
Definition at line 107 of file rcc.c.
References RccRegisters_t::APB1ENR, RCC_APB1ENR_WWDGEN, and rccWwdgClockEnable().
Referenced by rccWwdgClockEnable().
| void rccWwdgClockDisable | ( | RccRegisters_t * | rcc | ) |
Disable the WWDG's clock.
Once the WWDG is started, only a reset stops it.
| rcc | RCC block (e.g. RCC). |
Definition at line 113 of file rcc.c.
References RccRegisters_t::APB1ENR, RCC_APB1ENR_WWDGEN, and rccWwdgClockDisable().
Referenced by rccWwdgClockDisable().
| void rccSyscfgClockEnable | ( | RccRegisters_t * | rcc | ) |
Enable SYSCFG's clock; needed before any SYSCFG access (e.g.
EXTI routing).
| rcc | RCC block (e.g. RCC). |
Definition at line 118 of file rcc.c.
References RccRegisters_t::APB2ENR, RCC_APB2ENR_SYSCFGEN, and rccSyscfgClockEnable().
Referenced by rccSyscfgClockEnable().
| void rccSyscfgClockDisable | ( | RccRegisters_t * | rcc | ) |
Disable SYSCFG's clock.
| rcc | RCC block (e.g. RCC). |
Definition at line 124 of file rcc.c.
References RccRegisters_t::APB2ENR, RCC_APB2ENR_SYSCFGEN, and rccSyscfgClockDisable().
Referenced by rccSyscfgClockDisable().
| void rccPwrClockEnable | ( | RccRegisters_t * | rcc | ) |
Enable PWR's clock; needed before any PWR access.
| rcc | RCC block (e.g. RCC). |
Definition at line 129 of file rcc.c.
References RccRegisters_t::APB1ENR, RCC_APB1ENR_PWREN, and rccPwrClockEnable().
Referenced by bspClockInit(), and rccPwrClockEnable().
| void rccPwrClockDisable | ( | RccRegisters_t * | rcc | ) |
Disable PWR's clock.
| rcc | RCC block (e.g. RCC). |
Definition at line 135 of file rcc.c.
References RccRegisters_t::APB1ENR, RCC_APB1ENR_PWREN, and rccPwrClockDisable().
Referenced by rccPwrClockDisable().
| uint32_t rccResetFlags | ( | const RccRegisters_t * | rcc | ) |
The reset-cause flags set since they were last cleared.
Several can be set at once: a power-on reset also sets PINRSTF and BORRSTF, and every internal reset also drives the NRST pin, so PINRSTF accompanies IWDGRSTF, WWDGRSTF and SFTRSTF. Test the specific flag.
| rcc | RCC block (e.g. RCC). |
Definition at line 140 of file rcc.c.
References RccRegisters_t::CSR, RCC_RESET_FLAGS_Msk, and rccResetFlags().
Referenced by rccResetFlags().
| void rccClearResetFlags | ( | RccRegisters_t * | rcc | ) |
Clear every reset-cause flag (CSR.RMVF).
Read them first with rccResetFlags(): they accumulate across resets until cleared.
| rcc | RCC block (e.g. RCC). |
Definition at line 145 of file rcc.c.
References RccRegisters_t::CSR, RCC_CSR_RMVF, and rccClearResetFlags().
Referenced by rccClearResetFlags().
| DriverStatus_e rccHsiEnable | ( | RccRegisters_t * | rcc | ) |
Turn on the 16 MHz internal oscillator (HSI) and wait until ready.
HSI is the reset clock, so this normally returns at once.
| rcc | RCC block (e.g. RCC). |
| DRIVER_STATUS_OK | HSIRDY is set. |
| DRIVER_STATUS_ERR_TIMEOUT | HSIRDY did not set; HSION stays set. |
Definition at line 226 of file rcc.c.
References RccRegisters_t::CR, RCC_CR_HSION, RCC_CR_HSIRDY, rccHsiEnable(), and rccWaitCrFlag().
Referenced by rccHsiEnable().
| DriverStatus_e rccHsiDisable | ( | RccRegisters_t * | rcc | ) |
Turn off HSI and wait until HSIRDY clears.
| rcc | RCC block (e.g. RCC). |
| DRIVER_STATUS_OK | HSI is off. |
| DRIVER_STATUS_ERR_BUSY | HSI feeds SYSCLK, directly or through the PLL; nothing written. |
| DRIVER_STATUS_ERR_TIMEOUT | HSIRDY stayed set; HSION is cleared. |
Definition at line 233 of file rcc.c.
References RccRegisters_t::CR, DRIVER_STATUS_OK, RCC_CFGR_SYSCLK_HSI, RCC_CR_HSION, RCC_CR_HSIRDY, RCC_PLLCFGR_PLLSRC_HSI, rccHsiDisable(), rccOscillatorDisableGuard(), and rccWaitCrFlag().
Referenced by rccHsiDisable().
| DriverStatus_e rccHseEnable | ( | RccRegisters_t * | rcc, |
| uint32_t | bypass ) |
Turn on the external oscillator (HSE) and wait until ready.
| rcc | RCC block (e.g. RCC). |
| bypass | RCC_CR_HSEBYP for an external clock on OSC_IN (the NUCLEO's ST-LINK MCO), or 0 for a crystal. |
| DRIVER_STATUS_OK | HSERDY is set. |
| DRIVER_STATUS_ERR_INVALID_PARAM | bypass is neither value. |
| DRIVER_STATUS_ERR_BUSY | HSE is already on; call rccHseDisable() first. |
| DRIVER_STATUS_ERR_TIMEOUT | HSERDY did not set; HSEON stays set. |
Definition at line 247 of file rcc.c.
References RccRegisters_t::CR, DRIVER_STATUS_ERR_BUSY, DRIVER_STATUS_ERR_INVALID_PARAM, DRIVER_STATUS_OK, RCC_CR_HSEBYP, RCC_CR_HSEON, RCC_CR_HSERDY, rccHseEnable(), and rccWaitCrFlag().
Referenced by bspClockInit(), and rccHseEnable().
| DriverStatus_e rccHseDisable | ( | RccRegisters_t * | rcc | ) |
Turn off HSE and wait until HSERDY clears.
| rcc | RCC block (e.g. RCC). |
| DRIVER_STATUS_OK | HSE is off. |
| DRIVER_STATUS_ERR_BUSY | HSE feeds SYSCLK, directly or through the PLL; nothing written. |
| DRIVER_STATUS_ERR_TIMEOUT | HSERDY stayed set; HSEON is cleared. |
Definition at line 271 of file rcc.c.
References RccRegisters_t::CR, DRIVER_STATUS_OK, RCC_CFGR_SYSCLK_HSE, RCC_CR_HSEON, RCC_CR_HSERDY, RCC_PLLCFGR_PLLSRC_HSE, rccHseDisable(), rccOscillatorDisableGuard(), and rccWaitCrFlag().
Referenced by rccHseDisable().
| DriverStatus_e rccPllConfig | ( | RccRegisters_t * | rcc, |
| uint32_t | source, | ||
| uint32_t | m, | ||
| uint32_t | n, | ||
| uint32_t | p ) |
Set the PLL's input source and M, N and P.
Checks the register ranges, not the VCO frequency limits. PLLQ is left unchanged.
| rcc | RCC block (e.g. RCC). |
| source | RCC_PLLCFGR_PLLSRC_HSI or RCC_PLLCFGR_PLLSRC_HSE. |
| m | Input divider, 2-63. VCO input = source / m, must be 1-2 MHz. |
| n | Multiplier, 50-432. VCO output = VCO input x n, must be 100-432 MHz. |
| p | A RCC_PLLCFGR_PLLP_DIV* value. SYSCLK = VCO output / p. |
| DRIVER_STATUS_OK | PLLCFGR written. |
| DRIVER_STATUS_ERR_INVALID_PARAM | A parameter is out of range. |
| DRIVER_STATUS_ERR_BUSY | The PLL is on; PLLCFGR is writable only while it is off. |
Definition at line 285 of file rcc.c.
References RccRegisters_t::CR, DRIVER_STATUS_ERR_BUSY, DRIVER_STATUS_ERR_INVALID_PARAM, DRIVER_STATUS_OK, RccRegisters_t::PLLCFGR, RCC_CR_PLLON, RCC_PLLCFGR_PLLM_Msk, RCC_PLLCFGR_PLLM_Pos, RCC_PLLCFGR_PLLN_Msk, RCC_PLLCFGR_PLLN_Pos, RCC_PLLCFGR_PLLP_Msk, RCC_PLLCFGR_PLLP_Pos, RCC_PLLCFGR_PLLSRC, RCC_PLLCFGR_PLLSRC_HSE, RCC_PLLCFGR_PLLSRC_HSI, and rccPllConfig().
Referenced by bspClockInit(), and rccPllConfig().
| DriverStatus_e rccPllEnable | ( | RccRegisters_t * | rcc | ) |
Turn on the PLL and wait for lock.
| rcc | RCC block (e.g. RCC). |
| DRIVER_STATUS_OK | PLLRDY is set. |
| DRIVER_STATUS_ERR_TIMEOUT | PLLRDY did not set, usually because the source is not ready. PLLON stays set; call rccPllDisable() to retry. |
Definition at line 323 of file rcc.c.
References RccRegisters_t::CR, RCC_CR_PLLON, RCC_CR_PLLRDY, rccPllEnable(), and rccWaitCrFlag().
Referenced by bspClockInit(), and rccPllEnable().
| DriverStatus_e rccPllDisable | ( | RccRegisters_t * | rcc | ) |
Turn off the PLL and wait until PLLRDY clears.
| rcc | RCC block (e.g. RCC). |
| DRIVER_STATUS_OK | The PLL is off. |
| DRIVER_STATUS_ERR_BUSY | The PLL is the SYSCLK source; nothing written. |
| DRIVER_STATUS_ERR_TIMEOUT | PLLRDY stayed set; PLLON is cleared. |
Definition at line 330 of file rcc.c.
References RccRegisters_t::CR, DRIVER_STATUS_ERR_BUSY, DRIVER_STATUS_OK, RCC_CFGR_SYSCLK_PLL, RCC_CR_PLLON, RCC_CR_PLLRDY, rccActiveSysclkSource(), rccPllDisable(), and rccWaitCrFlag().
Referenced by rccPllDisable().
| DriverStatus_e rccBusPrescalerConfig | ( | RccRegisters_t * | rcc, |
| uint32_t | hpre, | ||
| uint32_t | ppre1, | ||
| uint32_t | ppre2 ) |
Set the AHB, APB1 and APB2 prescalers.
The new division takes effect 1 to 16 AHB cycles after the write. Does not check the bus maximums: APB1 at most 45 MHz, APB2 at most 90 MHz.
| rcc | RCC block (e.g. RCC). |
| hpre | A RCC_CFGR_HPRE_DIV* value. |
| ppre1 | A RCC_CFGR_PPRE_DIV* value for APB1. |
| ppre2 | A RCC_CFGR_PPRE_DIV* value for APB2. |
| DRIVER_STATUS_OK | CFGR written. |
| DRIVER_STATUS_ERR_INVALID_PARAM | A value is not one of its macros. |
Definition at line 387 of file rcc.c.
References RccRegisters_t::CFGR, DRIVER_STATUS_OK, RCC_CFGR_HPRE_Msk, RCC_CFGR_HPRE_Pos, RCC_CFGR_PPRE1_Msk, RCC_CFGR_PPRE1_Pos, RCC_CFGR_PPRE2_Msk, RCC_CFGR_PPRE2_Pos, rccBusPrescalerConfig(), rccValidateHpre(), and rccValidatePpre().
Referenced by bspClockInit(), and rccBusPrescalerConfig().
| DriverStatus_e rccSysclkSwitch | ( | RccRegisters_t * | rcc, |
| FlashRegisters_t * | flash, | ||
| uint32_t | source, | ||
| uint32_t | latency ) |
Switch SYSCLK to a ready source and set the flash latency it needs.
A higher latency is written before the switch; a lower one only after CFGR.SWS confirms the switch, so flash is never read with too few wait states.
| rcc | RCC block (e.g. RCC). |
| flash | Flash interface block (e.g. FLASH). |
| source | RCC_CFGR_SYSCLK_HSI, RCC_CFGR_SYSCLK_HSE or RCC_CFGR_SYSCLK_PLL. |
| latency | Wait states for the new SYSCLK (RM0390 Table 5); see flashSetLatency(). |
| DRIVER_STATUS_OK | Switched, and the latency is set. |
| DRIVER_STATUS_ERR_INVALID_PARAM | source or latency is invalid. |
| DRIVER_STATUS_ERR_NOT_INITIALIZED | source is not ready. |
| DRIVER_STATUS_ERR_TIMEOUT | SWS never reported source. |
| DRIVER_STATUS_ERR_HW_FAULT | ACR.LATENCY did not read back as written. |
Definition at line 413 of file rcc.c.
References FlashRegisters_t::ACR, RccRegisters_t::CFGR, RccRegisters_t::CR, DRIVER_STATUS_ERR_INVALID_PARAM, DRIVER_STATUS_ERR_NOT_INITIALIZED, DRIVER_STATUS_ERR_TIMEOUT, DRIVER_STATUS_OK, FLASH_ACR_LATENCY_Msk, FLASH_ACR_LATENCY_Pos, flashSetLatency(), RCC_CFGR_SW_Msk, RCC_CFGR_SW_Pos, RCC_CFGR_SYSCLK_HSE, RCC_CFGR_SYSCLK_HSI, RCC_CFGR_SYSCLK_PLL, RCC_CLOCK_READY_TIMEOUT_ITERATIONS, RCC_CR_HSERDY, RCC_CR_HSIRDY, RCC_CR_PLLRDY, rccActiveSysclkSource(), and rccSysclkSwitch().
Referenced by bspClockInit(), and rccSysclkSwitch().
|
static |
Map a GPIO port to its AHB1ENR bit.
| port | Port to identify, compared by address. |
| bit | Receives the GPIOxEN bit; untouched on failure. |
| DRIVER_STATUS_OK | port is GPIOA to GPIOH. |
| DRIVER_STATUS_ERR_INVALID_PARAM | Otherwise. |
Definition at line 25 of file rcc.c.
References DRIVER_STATUS_ERR_INVALID_PARAM, DRIVER_STATUS_OK, GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, RCC_AHB1ENR_GPIOAEN, RCC_AHB1ENR_GPIOBEN, RCC_AHB1ENR_GPIOCEN, RCC_AHB1ENR_GPIODEN, RCC_AHB1ENR_GPIOEEN, RCC_AHB1ENR_GPIOFEN, RCC_AHB1ENR_GPIOGEN, RCC_AHB1ENR_GPIOHEN, and rccGpioClockBit().
Referenced by rccGpioClockBit(), rccGpioClockDisable(), and rccGpioClockEnable().
|
static |
The SYSCLK source in use, from CFGR.SWS (not the requested CFGR.SW).
| rcc | RCC block. |
Definition at line 155 of file rcc.c.
References RccRegisters_t::CFGR, RCC_CFGR_SWS_Msk, RCC_CFGR_SWS_Pos, and rccActiveSysclkSource().
Referenced by rccActiveSysclkSource(), rccOscillatorDisableGuard(), rccPllDisable(), and rccSysclkSwitch().
|
static |
Report whether an oscillator feeds SYSCLK, directly or through the PLL.
RM0390 ignores clearing HSION/HSEON in either case, so checking SWS alone would report success for a write the hardware dropped.
| rcc | RCC block. |
| sysclk_value | The oscillator's SW/SWS value (RCC_CFGR_SYSCLK_HSI or _HSE). |
| pllsrc_value | The oscillator's PLLSRC value (RCC_PLLCFGR_PLLSRC_HSI or _HSE). |
| DRIVER_STATUS_OK | Not feeding SYSCLK. |
| DRIVER_STATUS_ERR_BUSY | Feeding SYSCLK. |
Definition at line 172 of file rcc.c.
References DRIVER_STATUS_ERR_BUSY, DRIVER_STATUS_OK, RccRegisters_t::PLLCFGR, RCC_CFGR_SYSCLK_PLL, RCC_PLLCFGR_PLLSRC, rccActiveSysclkSource(), and rccOscillatorDisableGuard().
Referenced by rccHseDisable(), rccHsiDisable(), and rccOscillatorDisableGuard().
|
static |
Poll a CR ready flag until it reaches expected or the budget runs out.
The flag is re-read after the loop, so a flag that settles on the last poll counts as success.
| rcc | RCC block. |
| ready_bit | RCC_CR_HSIRDY, RCC_CR_HSERDY or RCC_CR_PLLRDY. |
| expected | ready_bit to wait for set, 0 to wait for clear. |
| DRIVER_STATUS_OK | The flag is in the expected state. |
| DRIVER_STATUS_ERR_TIMEOUT | It is not, after RCC_CLOCK_READY_TIMEOUT_ITERATIONS polls. |
Definition at line 207 of file rcc.c.
References RccRegisters_t::CR, DRIVER_STATUS_ERR_TIMEOUT, DRIVER_STATUS_OK, RCC_CLOCK_READY_TIMEOUT_ITERATIONS, and rccWaitCrFlag().
Referenced by rccHseDisable(), rccHseEnable(), rccHsiDisable(), rccHsiEnable(), rccPllDisable(), rccPllEnable(), and rccWaitCrFlag().
|
static |
Check that hpre is one of the nine RCC_CFGR_HPRE_DIV* values.
| hpre | Candidate HPRE value. |
| DRIVER_STATUS_OK | Valid. |
| DRIVER_STATUS_ERR_INVALID_PARAM | Not a defined divisor. |
Definition at line 353 of file rcc.c.
References DRIVER_STATUS_ERR_INVALID_PARAM, DRIVER_STATUS_OK, RCC_CFGR_HPRE_DIV1, RCC_CFGR_HPRE_DIV128, RCC_CFGR_HPRE_DIV16, RCC_CFGR_HPRE_DIV2, RCC_CFGR_HPRE_DIV256, RCC_CFGR_HPRE_DIV4, RCC_CFGR_HPRE_DIV512, RCC_CFGR_HPRE_DIV64, RCC_CFGR_HPRE_DIV8, and rccValidateHpre().
Referenced by rccBusPrescalerConfig(), and rccValidateHpre().
|
static |
Check that ppre is one of the five RCC_CFGR_PPRE_DIV* values.
| ppre | Candidate PPRE1 or PPRE2 value. |
| DRIVER_STATUS_OK | Valid. |
| DRIVER_STATUS_ERR_INVALID_PARAM | Not a defined divisor. |
Definition at line 374 of file rcc.c.
References DRIVER_STATUS_ERR_INVALID_PARAM, DRIVER_STATUS_OK, RCC_CFGR_PPRE_DIV1, RCC_CFGR_PPRE_DIV16, RCC_CFGR_PPRE_DIV2, RCC_CFGR_PPRE_DIV4, RCC_CFGR_PPRE_DIV8, and rccValidatePpre().
Referenced by rccBusPrescalerConfig(), and rccValidatePpre().