108#define RCC_RESET_FLAGS_Msk \
109 (RCC_CSR_BORRSTF | RCC_CSR_PINRSTF | RCC_CSR_PORRSTF | RCC_CSR_SFTRSTF | RCC_CSR_IWDGRSTF \
110 | RCC_CSR_WWDGRSTF | RCC_CSR_LPWRRSTF)
204 uint32_t n, uint32_t p);
244 uint32_t ppre1, uint32_t ppre2);
268 uint32_t source, uint32_t latency);
The status every fallible driver function returns.
Flash interface registers: access latency, prefetch and caches (RM0390 section 3.8).
GPIO registers for ports A to H (RM0390 section 7.4).
DriverStatus_e
Outcome of a driver call: a category for control flow, not a diagnosis.
#define DRIVER_MUST_CHECK
Make ignoring a function's result a compile error (with -Werror).
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.
void rccWwdgClockEnable(RccRegisters_t *rcc)
Enable the WWDG's clock; needed before any WWDG access.
DRIVER_MUST_CHECK DriverStatus_e rccHseEnable(RccRegisters_t *rcc, uint32_t bypass)
Turn on the external oscillator (HSE) and wait until ready.
void rccWwdgClockDisable(RccRegisters_t *rcc)
Disable the WWDG's clock.
DRIVER_MUST_CHECK DriverStatus_e rccPllDisable(RccRegisters_t *rcc)
Turn off the PLL and wait until PLLRDY clears.
DRIVER_MUST_CHECK DriverStatus_e rccGpioClockDisable(RccRegisters_t *rcc, const GpioRegisters_t *port)
Disable a GPIO port's clock.
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 rccHsiEnable(RccRegisters_t *rcc)
Turn on the 16 MHz internal oscillator (HSI) and wait until ready.
DRIVER_MUST_CHECK DriverStatus_e rccPllEnable(RccRegisters_t *rcc)
Turn on the PLL and wait for lock.
DRIVER_MUST_CHECK DriverStatus_e rccHseDisable(RccRegisters_t *rcc)
Turn off HSE and wait until HSERDY clears.
uint32_t rccResetFlags(const RccRegisters_t *rcc)
The reset-cause flags set since they were last cleared.
void rccPwrClockDisable(RccRegisters_t *rcc)
Disable PWR's clock.
void rccUsart2ClockEnable(RccRegisters_t *rcc)
Enable USART2's clock.
void rccUsart2ClockDisable(RccRegisters_t *rcc)
Disable USART2's clock.
DRIVER_MUST_CHECK DriverStatus_e rccGpioClockEnable(RccRegisters_t *rcc, const GpioRegisters_t *port)
Enable a GPIO port'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 rccClearResetFlags(RccRegisters_t *rcc)
Clear every reset-cause flag (CSR.RMVF).
void rccPwrClockEnable(RccRegisters_t *rcc)
Enable PWR's clock; needed before any PWR access.
DRIVER_MUST_CHECK DriverStatus_e rccHsiDisable(RccRegisters_t *rcc)
Turn off HSI and wait until HSIRDY clears.
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.
RCC registers: oscillators, PLL, bus clocks, peripheral clock gating and reset flags (RM0390 section ...
Flash interface register block.
GPIO port register block.