periph_cpu.h File Reference

CPU specific definitions for internal peripheral handling. More...

Detailed Description

CPU specific definitions for internal peripheral handling.

Author
Kaspar Schleiser kaspa.nosp@m.r@sc.nosp@m.hleis.nosp@m.er.d.nosp@m.e

Definition in file periph_cpu.h.

#include <stdint.h>
#include "cpu.h"
+ Include dependency graph for periph_cpu.h:

Go to the source code of this file.

Data Structures

struct  FIO_PORT_t
 Fast GPIO register definition struct. More...
 
struct  uart_conf_t
 UART device configuration. More...
 
struct  spi_conf_t
 SPI configuration structure type. More...
 
struct  adc_conf_t
 ADC device configuration. More...
 
struct  i2c_conf_t
 I2C configuration options. More...
 

Macros

#define FIO_PORTS   ((FIO_PORT_t*)FIO_BASE_ADDR)
 Pointer to the Fast GPIO register.
 
#define PINSEL   ((__IO uint32_t *)(PINSEL_BASE_ADDR))
 Pointer to the PINSEL register.
 
#define PINMODE   ((__IO uint32_t *)(PINSEL_BASE_ADDR + 0x40))
 Pointer to the PINMODE register.
 
#define GPIO_PIN(port, pin)   (port<<5 | pin)
 Macro for accessing GPIO pins.
 
#define TIMER_CHAN_NUMOF   (4U)
 Number of available timer channels.
 
#define DAC_NUMOF   (1U)
 DAC configuration, valid for all boards using this CPU. More...
 

Functions

int gpio_init_mux (unsigned pin, unsigned mux)
 Set up alternate function (PMUX setting) for a PORT pin. More...
 
#define __IO   volatile
 LPC2387 MCU defines.
 

Power mode configuration

#define PM_NUM_MODES   (3)
 
#define PERIPH_SPI_NEEDS_INIT_CS
 Declare needed generic SPI functions.
 
#define PERIPH_SPI_NEEDS_TRANSFER_BYTE
 
#define PERIPH_SPI_NEEDS_TRANSFER_REG
 
#define PERIPH_SPI_NEEDS_TRANSFER_REGS
 

Macro Definition Documentation

◆ DAC_NUMOF

#define DAC_NUMOF   (1U)

DAC configuration, valid for all boards using this CPU.

lpc23xx has a fixed mapping of DAC pins and a fixed number of DAC channels, so this DAC configuration is valid for all boards using this CPU. No need for any board specific configuration.

The DAC of the lpc23xx is mapped to the following fixed pin:

  • line 0 (ch0): P0.26

Definition at line 167 of file periph_cpu.h.

Function Documentation

◆ gpio_init_mux()

int gpio_init_mux ( unsigned  pin,
unsigned  mux 
)

Set up alternate function (PMUX setting) for a PORT pin.

Parameters
[in]pinPin to set the multiplexing for
[in]muxMux value