Loading...
Searching...
No Matches
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 device configuration. More...
 
struct  adc_conf_t
 ADC device configuration. More...
 
struct  i2c_conf_t
 I2C configuration structure. 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_CHANNEL_NUMOF   (4U)
 Number of available timer channels.
 
#define PERIPH_TIMER_PROVIDES_SET
 Prevent shared timer functions from being used.
 
#define DAC_NUMOF   (1U)
 DAC configuration, valid for all boards using this CPU.
 

Functions

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

Power mode configuration

#define PM_NUM_MODES   (4)
 
#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

◆ __IO

#define __IO   volatile

LPC2387 MCU defines.

Definition at line 33 of file periph_cpu.h.

◆ 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 173 of file periph_cpu.h.

◆ FIO_PORTS

#define FIO_PORTS   ((FIO_PORT_t*)FIO_BASE_ADDR)

Pointer to the Fast GPIO register.

Definition at line 68 of file periph_cpu.h.

◆ GPIO_PIN

#define GPIO_PIN (   port,
  pin 
)    (port<<5 | pin)

Macro for accessing GPIO pins.

Definition at line 91 of file periph_cpu.h.

◆ PERIPH_I2C_NEED_READ_REG

#define PERIPH_I2C_NEED_READ_REG

Definition at line 237 of file periph_cpu.h.

◆ PERIPH_I2C_NEED_WRITE_REG

#define PERIPH_I2C_NEED_WRITE_REG

Definition at line 238 of file periph_cpu.h.

◆ PERIPH_SPI_NEEDS_INIT_CS

#define PERIPH_SPI_NEEDS_INIT_CS

Declare needed generic SPI functions.

Definition at line 141 of file periph_cpu.h.

◆ PERIPH_SPI_NEEDS_TRANSFER_BYTE

#define PERIPH_SPI_NEEDS_TRANSFER_BYTE

Definition at line 142 of file periph_cpu.h.

◆ PERIPH_SPI_NEEDS_TRANSFER_REG

#define PERIPH_SPI_NEEDS_TRANSFER_REG

Definition at line 143 of file periph_cpu.h.

◆ PERIPH_SPI_NEEDS_TRANSFER_REGS

#define PERIPH_SPI_NEEDS_TRANSFER_REGS

Definition at line 144 of file periph_cpu.h.

◆ PERIPH_TIMER_PROVIDES_SET

#define PERIPH_TIMER_PROVIDES_SET

Prevent shared timer functions from being used.

Definition at line 135 of file periph_cpu.h.

◆ PINMODE

#define PINMODE   ((__IO uint32_t *)(PINSEL_BASE_ADDR + 0x40))

Pointer to the PINMODE register.

Definition at line 78 of file periph_cpu.h.

◆ PINSEL

#define PINSEL   ((__IO uint32_t *)(PINSEL_BASE_ADDR))

Pointer to the PINSEL register.

Definition at line 73 of file periph_cpu.h.

◆ PM_NUM_MODES

#define PM_NUM_MODES   (4)

Definition at line 40 of file periph_cpu.h.

◆ TIMER_CHANNEL_NUMOF

#define TIMER_CHANNEL_NUMOF   (4U)

Number of available timer channels.

Definition at line 130 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