task #5

Merged
Steins7 merged 35 commits from task into dev 2024-08-04 18:30:16 +00:00
2 changed files with 16 additions and 0 deletions
Showing only changes of commit 699569ec99 - Show all commits

View File

@ -60,6 +60,16 @@ void rcc_configure(enum RccPreset preset)
regs->APB2ENR = apb2_enr; 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, void rcc_enable(enum RccAhb ahb_mask, enum RccApb1 apb1_mask,
enum RccApb2 apb2_mask) enum RccApb2 apb2_mask)
{ {

View File

@ -112,6 +112,12 @@ struct RccClocks {
*/ */
void rcc_configure(enum RccPreset preset); 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 * 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 * masks to enable multiple peripherals at the same time. Invalid values will be