lpc_peripherals.c File Reference

This file provides LPC peripheral numbers according to LPC17xx datasheet. More...

#include <stdint.h>
#include "LPC17xx.h"
#include "lpc_peripherals.h"
#include "FreeRTOS.h"
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
peripheralThe peripheral type.
See also
lpc_pclk_t
Parameters
dividerThe 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
peripheralThe peripheral type.
See also
lpc_pconp_t
Parameters
onIf true, peripheral is turned on, otherwise turned off