Name

Peripheral Clock and Power Control — Description

Synopsis

#include <cyg/hal/hal_io.h>
    

pin = CYGHWR_HAL_LPC1XXX_CLOCK( device , divider );

CYGHWR_HAL_LPC1XXX_CLOCK_ENABLE ( desc );

CYGHWR_HAL_LPC1XXX_CLOCK_DISABLE ( desc );

Description

The LPC1XXX HAL provides a number of macros to support the management of peripheral power supply and clock frequencies. The macro CYGHWR_HAL_LPC1XXX_CLOCK( device, divider ) encodes a control descriptor into a 32 bit value. The first argument is the name of the device to be described. The second argument gives the divider to be applied to CCLK for the peripheral clock; it can take the values 1, 2, 4 or 8 for most peripherals and 6 (instead of 8) for the CAN device.

The remaining functions all take a peripheral clock/power descriptor as an argument. CYGHWR_HAL_LPC1XXX_CLOCK_ENABLE( desc ) turns on the power to the peripheral and sets the clock to the rate given in the descriptor. Likewise CYGHWR_HAL_LPC1XXX_CLOCK_DISABLE( desc ) disables the power to the device.