lpc11u34/include/periph_cpu.h File Reference

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

Detailed Description

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

Go to the source code of this file.

Data Structures

struct  pwm_conf_t
 PWM configuration structure. More...
 
struct  spi_conf_t
 SPI configuration data structure. More...
 

Macros

#define CPUID_LEN   (16U)
 Length of the CPU_ID in octets.
 
#define ADC_NUMOF   (10U)
 Define number of available ADC lines. More...
 
#define GPIO_PIN(port, pin)   (gpio_t)((port << 8) | pin)
 Define a custom GPIO_PIN macro for the lpc11u34.
 
#define PWM_CHAN_NUMOF   (3U)
 Number of PWM channels per PWM peripheral.
 
#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
 
#define HAVE_GPIO_T
 Override the default GPIO type.
 
typedef uint16_t gpio_t
 
#define IN   (0x0000)
 Override the default GPIO mode values.
 
#define OUT   (0x0001)
 
#define PD   (0x1 << 3)
 
#define PU   (0x2 << 3)
 
#define OD   (0x1 << 10)
 
#define HAVE_GPIO_MODE_T
 
enum  gpio_mode_t {
  GPIO_IN = ((uint8_t)0x00), GPIO_IN_PD = ((uint8_t)IOC_OVERRIDE_PDE), GPIO_IN_PU = ((uint8_t)IOC_OVERRIDE_PUE), GPIO_OUT = ((uint8_t)IOC_OVERRIDE_OE),
  GPIO_OD = (0xff), GPIO_OD_PU = (0xff), GPIO_IN = (IN), GPIO_IN_PD = (IN | PD),
  GPIO_IN_PU = (IN | PU), GPIO_OUT = (OUT), GPIO_OD = (OUT | OD), GPIO_OD_PU = (OUT | OD | PU),
  GPIO_IN, GPIO_IN_PD, GPIO_IN_PU, GPIO_OUT,
  GPIO_OD, GPIO_OD_PU
}
 
#define HAVE_SPI_CLK_T
 Override SPI clock speed values. More...
 
enum  spi_clk_t {
  SPI_CLK_100KHZ = SPI_CLK_SEL(0, 1, 1), SPI_CLK_400KHZ = SPI_CLK_SEL(1, 1, 0), SPI_CLK_1MHZ = SPI_CLK_SEL(0, 0, 1), SPI_CLK_5MHZ = SPI_CLK_SEL(0, 0, 0),
  SPI_CLK_10MHZ = SPI_CLK_SEL(1, 0, 0), SPI_CLK_100KHZ = 0, SPI_CLK_400KHZ = 1, SPI_CLK_1MHZ = 2,
  SPI_CLK_5MHZ = 3, SPI_CLK_10MHZ = 4, SPI_CLK_100KHZ = 119, SPI_CLK_400KHZ = 29,
  SPI_CLK_1MHZ = 11, SPI_CLK_5MHZ = 2, SPI_CLK_10MHZ = 0, SPI_CLK_100KHZ = 100,
  SPI_CLK_400KHZ = 400, SPI_CLK_1MHZ = 1000, SPI_CLK_5MHZ = 5000, SPI_CLK_10MHZ = 10000,
  SPI_CLK_100KHZ = SPI_FREQUENCY_FREQUENCY_K125, SPI_CLK_400KHZ = SPI_FREQUENCY_FREQUENCY_K500, SPI_CLK_1MHZ = SPI_FREQUENCY_FREQUENCY_M1, SPI_CLK_5MHZ = SPI_FREQUENCY_FREQUENCY_M4,
  SPI_CLK_10MHZ = SPI_FREQUENCY_FREQUENCY_M8, SPI_CLK_100KHZ = 100000U, SPI_CLK_400KHZ = 400000U, SPI_CLK_1MHZ = 1000000U,
  SPI_CLK_5MHZ = 5000000U, SPI_CLK_10MHZ = 10000000U, SPI_CLK_100KHZ = (100000), SPI_CLK_400KHZ = (400000),
  SPI_CLK_1MHZ = (1000000), SPI_CLK_5MHZ = (5000000), SPI_CLK_10MHZ = (10000000), SPI_CLK_100KHZ = 0,
  SPI_CLK_400KHZ, SPI_CLK_1MHZ, SPI_CLK_5MHZ, SPI_CLK_10MHZ
}
 

Macro Definition Documentation

◆ ADC_NUMOF

#define ADC_NUMOF   (10U)

TODO: check this value

Definition at line 50 of file lpc11u34/include/periph_cpu.h.

◆ HAVE_SPI_CLK_T

#define HAVE_SPI_CLK_T
Note
The values expect the CPU to run at 12MHz
Todo:
Generalize the SPI driver

Definition at line 126 of file lpc11u34/include/periph_cpu.h.

Enumeration Type Documentation

◆ gpio_mode_t

Enumerator
GPIO_IN 

input, no pull

GPIO_IN_PD 

input, pull-down

GPIO_IN_PU 

input, pull-up

GPIO_OUT 

output

GPIO_OD 

not supported

GPIO_OD_PU 

not supported

GPIO_IN 

in without pull resistor

GPIO_IN_PD 

in with pull-down

GPIO_IN_PU 

in with pull-up

GPIO_OUT 

push-pull output

GPIO_OD 

open-drain output

GPIO_OD_PU 

open-drain output with pull-up

GPIO_IN 

configure as input without pull resistor

GPIO_IN_PD 

configure as input with pull-down resistor

GPIO_IN_PU 

configure as input with pull-up resistor

GPIO_OUT 

configure as output in push-pull mode

GPIO_OD 

configure as output in open-drain mode without pull resistor

GPIO_OD_PU 

configure as output in open-drain mode with pull resistor enabled

Definition at line 81 of file lpc11u34/include/periph_cpu.h.

◆ spi_clk_t

enum spi_clk_t
Enumerator
SPI_CLK_100KHZ 

16/128 -> 125KHz

SPI_CLK_400KHZ 

16/32 -> 500KHz

SPI_CLK_1MHZ 

16/16 -> 1MHz

SPI_CLK_5MHZ 

16/4 -> 4MHz

SPI_CLK_10MHZ 

16/2 -> 8MHz

SPI_CLK_100KHZ 

drive the SPI bus with 100KHz

SPI_CLK_400KHZ 

drive the SPI bus with 400KHz

SPI_CLK_1MHZ 

drive the SPI bus with 1MHz

SPI_CLK_5MHZ 

drive the SPI bus with 5MHz

SPI_CLK_10MHZ 

drive the SPI bus with 10MHz

SPI_CLK_100KHZ 

drive the SPI bus with 100KHz

SPI_CLK_400KHZ 

drive the SPI bus with 400KHz

SPI_CLK_1MHZ 

drive the SPI bus with 1MHz

SPI_CLK_5MHZ 

drive the SPI bus with 5MHz

SPI_CLK_10MHZ 

actual: 12 MHz

SPI_CLK_100KHZ 

drive the SPI bus with 100KHz

SPI_CLK_400KHZ 

drive the SPI bus with 400KHz

SPI_CLK_1MHZ 

drive the SPI bus with 1MHz

SPI_CLK_5MHZ 

drive the SPI bus with 5MHz

SPI_CLK_10MHZ 

drive the SPI bus with 10MHz

SPI_CLK_100KHZ 

100KHz

SPI_CLK_400KHZ 

400KHz

SPI_CLK_1MHZ 

1MHz

SPI_CLK_5MHZ 

5MHz

SPI_CLK_10MHZ 

10MHz

SPI_CLK_100KHZ 

drive the SPI bus with 100KHz

SPI_CLK_400KHZ 

drive the SPI bus with 400KHz

SPI_CLK_1MHZ 

drive the SPI bus with 1MHz

SPI_CLK_5MHZ 

drive the SPI bus with 5MHz

SPI_CLK_10MHZ 

drive the SPI bus with 10MHz

SPI_CLK_100KHZ 

100KHz

SPI_CLK_400KHZ 

400KHz

SPI_CLK_1MHZ 

1MHz

SPI_CLK_5MHZ 

5MHz

SPI_CLK_10MHZ 

10MHz

SPI_CLK_100KHZ 

drive the SPI bus with 100KHz

SPI_CLK_400KHZ 

drive the SPI bus with 400KHz

SPI_CLK_1MHZ 

drive the SPI bus with 1MHz

SPI_CLK_5MHZ 

drive the SPI bus with 5MHz

SPI_CLK_10MHZ 

drive the SPI bus with 10MHz

Definition at line 127 of file lpc11u34/include/periph_cpu.h.