Add rcc_enable_peripheral_clock() et al, and respective prototypes.
This commit is contained in:
parent
97440d8406
commit
a5a9648144
@ -363,4 +363,20 @@ typedef enum {
|
|||||||
PLL, HSE, HSI, LSE, LSI
|
PLL, HSE, HSI, LSE, LSI
|
||||||
} osc_t;
|
} osc_t;
|
||||||
|
|
||||||
|
void rcc_osc_ready_int_clear(osc_t osc);
|
||||||
|
void rcc_osc_ready_int_enable(osc_t osc);
|
||||||
|
void rcc_osc_ready_int_disable(osc_t osc);
|
||||||
|
int rcc_osc_ready_int_flag(osc_t osc);
|
||||||
|
void rcc_css_int_clear(void);
|
||||||
|
int rcc_css_int_flag(void);
|
||||||
|
void rcc_wait_for_osc_ready(osc_t osc);
|
||||||
|
void rcc_osc_on(osc_t osc);
|
||||||
|
void rcc_osc_off(osc_t osc);
|
||||||
|
void rcc_css_enable(void);
|
||||||
|
void rcc_css_disable(void);
|
||||||
|
void rcc_osc_bypass_enable(osc_t osc);
|
||||||
|
void rcc_osc_bypass_disable(osc_t osc);
|
||||||
|
void rcc_enable_peripheral_clock(volatile u32 *reg, u32 peripheral_en);
|
||||||
|
void rcc_disable_peripheral_clock(volatile u32 *reg, u32 peripheral_en);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
11
lib/rcc.c
11
lib/rcc.c
@ -223,3 +223,14 @@ void rcc_osc_bypass_disable(osc_t osc)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rcc_enable_peripheral_clock(volatile u32 *reg, u32 peripheral_en)
|
||||||
|
{
|
||||||
|
*reg |= peripheral_en;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rcc_disable_peripheral_clock(volatile u32 *reg, u32 peripheral_en)
|
||||||
|
{
|
||||||
|
*reg &= ~peripheral_en;
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user