lpc1768/include/periph_cpu.h File Reference

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

Detailed Description

CPU specific definitions for internal peripheral handling.

Author
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de
Bas Stottelaar basst.nosp@m.otte.nosp@m.laar@.nosp@m.gmai.nosp@m.l.com

Definition in file lpc1768/include/periph_cpu.h.

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

Go to the source code of this file.

Macros

#define GPIO_PIN(port, pin)   (gpio_t)((port << 5) | pin)
 Define a custom GPIO_PIN macro for the lpc1768.
 
#define PROVIDES_PM_LAYERED_OFF
 CPU provides own pm_off() function.
 
#define PM_NUM_MODES   (2U)
 Power management configuration.
 

Override the default GPIO type

#define HAVE_GPIO_T
 
typedef uint8_t gpio_t
 

Override the default GPIO mode values

#define PIN_DIR_IN   (0x00 << 0)
 
#define PIN_DIR_OUT   (0x01 << 0)
 
#define PIN_MODE_PU   (0x00 << 1)
 
#define PIN_MODE_PD   (0x02 << 1)
 
#define PIN_MODE_NONE   (0x03 << 1)
 
#define PIN_MODE_OD   (0x01 << 3)
 
#define HAVE_GPIO_MODE_T
 
enum  gpio_mode_t {
  GPIO_IN = ((uint8_t)OVERRIDE_DISABLE), GPIO_IN_ANALOG = ((uint8_t)OVERRIDE_ANALOG), GPIO_IN_PD = ((uint8_t)OVERRIDE_PULLDOWN), GPIO_IN_PU = ((uint8_t)OVERRIDE_PULLUP),
  GPIO_OUT = ((uint8_t)OVERRIDE_ENABLE), GPIO_OD = (0xff), GPIO_OD_PU = (0xff), GPIO_IN,
  GPIO_IN_PD, GPIO_IN_PU, GPIO_OUT, GPIO_OD,
  GPIO_OD_PU, GPIO_IN_OUT, GPIO_IN_OD, GPIO_IN_OD_PU,
  GPIO_IN = (PIN_DIR_IN | PIN_MODE_NONE), GPIO_IN_PD = (PIN_DIR_IN | PIN_MODE_PD), GPIO_IN_PU = (PIN_DIR_IN | PIN_MODE_PU), GPIO_OUT = (PIN_DIR_OUT | PIN_MODE_NONE),
  GPIO_OD = (PIN_DIR_OUT | PIN_MODE_OD), GPIO_OD_PU = (PIN_DIR_OUT | PIN_MODE_OD | PIN_MODE_PU), GPIO_IN, GPIO_IN_PD,
  GPIO_IN_PU, GPIO_OUT, GPIO_OD, GPIO_OD_PU
}
 

Enumeration Type Documentation

◆ gpio_mode_t

Enumerator
GPIO_IN 

input, no pull

GPIO_IN_ANALOG 

input, analog

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 

input

GPIO_IN_PD 

input with pull-down

GPIO_IN_PU 

input with pull-up

GPIO_OUT 

output

GPIO_OD 

open-drain output

GPIO_OD_PU 

open-drain output with pull-up

GPIO_IN_OUT 

input and output

GPIO_IN_OD 

input and open-drain output

GPIO_IN_OD_PU 

input and open-drain output

GPIO_IN 

in without pull-up/down

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 56 of file lpc1768/include/periph_cpu.h.