Add LSI configuration function to RCC
This commit is contained in:
parent
3e97d4fe7e
commit
699569ec99
10
drv/rcc.c
10
drv/rcc.c
@ -60,6 +60,16 @@ void rcc_configure(enum RccPreset preset)
|
||||
regs->APB2ENR = apb2_enr;
|
||||
}
|
||||
|
||||
void rcc_configure_lsi(bool enable)
|
||||
{
|
||||
regs->CSR.LSION = enable;
|
||||
|
||||
//ensure LSI is enabled
|
||||
if (enable) {
|
||||
while (regs->CSR.LSIRDY != 0x1);
|
||||
}
|
||||
}
|
||||
|
||||
void rcc_enable(enum RccAhb ahb_mask, enum RccApb1 apb1_mask,
|
||||
enum RccApb2 apb2_mask)
|
||||
{
|
||||
|
||||
@ -112,6 +112,12 @@ struct RccClocks {
|
||||
*/
|
||||
void rcc_configure(enum RccPreset preset);
|
||||
|
||||
/**
|
||||
* Configures the Low Speed Internal (LSI) oscillator for low power
|
||||
* applications.
|
||||
*/
|
||||
void rcc_configure_lsi(bool enable);
|
||||
|
||||
/**
|
||||
* Enables peripherals on the different buses. The enums values can used as
|
||||
* masks to enable multiple peripherals at the same time. Invalid values will be
|
||||
|
||||
Loading…
Reference in New Issue
Block a user