lpc_peripherals.c File Reference
This file provides LPC peripheral numbers according to LPC17xx datasheet. More...
Include dependency graph for lpc_peripherals.c:

Functions | |
void | lpc_pconp (lpc_pconp_t peripheral, bool on) |
void | lpc_pclk (lpc_pclk_t peripheral, clkdiv_t divider) |
Detailed Description
This file provides LPC peripheral numbers according to LPC17xx datasheet.
Function Documentation
void lpc_pclk | ( | lpc_pclk_t | peripheral, |
clkdiv_t | divider | ||
) |
Sets the peripheral clock divider.
- Parameters
-
peripheral The peripheral type.
- See also
- lpc_pclk_t
- Parameters
-
divider The divider type
- Note
- The reset value for all peripherals is clkdiv_4
This is a quick and dirty trick to use uint64_t such that we don't have to use if/else statements to pick either PCLKSEL0 or PCLKSEL1 register.
void lpc_pconp | ( | lpc_pconp_t | peripheral, |
bool | on | ||
) |
Powers ON or powers OFF the peripheral
- Parameters
-
peripheral The peripheral type.
- See also
- lpc_pconp_t
- Parameters
-
on If true, peripheral is turned on, otherwise turned off