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
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file periph_cpu.h.

#include "periph_conf.h"
#include <linux/gpio.h>
+ Include dependency graph for periph_cpu.h:

Go to the source code of this file.

Macros

#define PERIPH_TIMER_PROVIDES_SET
 Prevent shared timer functions from being used.
 

Power mode configuration

Length of the CPU_ID in octets

#define PM_NUM_MODES   (1U)
 
#define PROVIDES_PM_LAYERED_OFF
 We provide our own pm_off() function for the native CPU.
 

GPIO Configuration

#define GPIO_PORT_SHIFT   (24)
 The offset between Port and Pin.
 
#define GPIO_PIN(port, pin)   (gpio_t)((port << GPIO_PORT_SHIFT) | pin)
 Define a custom GPIO_PIN macro for native.
 
#define HAVE_GPIO_MODE_T
 
#define GPIOHANDLE_REQUEST_PULL_DOWN   (0xFF)
 
#define GPIOHANDLE_REQUEST_PULL_UP   (0xFF)
 
#define HAVE_GPIO_FLANK_T
 
enum  gpio_mode_t {
  GPIO_IN = GPIOHANDLE_REQUEST_INPUT , GPIO_IN_PD = GPIOHANDLE_REQUEST_INPUT | GPIOHANDLE_REQUEST_PULL_DOWN , GPIO_IN_PU = GPIOHANDLE_REQUEST_INPUT | GPIOHANDLE_REQUEST_PULL_UP , GPIO_OUT = GPIOHANDLE_REQUEST_OUTPUT ,
  GPIO_OD = GPIOHANDLE_REQUEST_OPEN_DRAIN , GPIO_OD_PU = GPIOHANDLE_REQUEST_OPEN_DRAIN | GPIOHANDLE_REQUEST_PULL_UP
}
 Available pin modes. More...
 
enum  gpio_flank_t { GPIO_FALLING = GPIOEVENT_EVENT_FALLING_EDGE , GPIO_RISING = GPIOEVENT_EVENT_RISING_EDGE , GPIO_BOTH = GPIO_FALLING | GPIO_RISING }
 

SPI Configuration

#define PERIPH_SPI_NEEDS_TRANSFER_BYTE
 Use the common transfer_byte SPI function.
 
#define PERIPH_SPI_NEEDS_TRANSFER_REG
 Use the common transfer_reg SPI function.
 
#define PERIPH_SPI_NEEDS_TRANSFER_REGS
 Use the common transfer_regs SPI function.
 

EEPROM configuration

#define EEPROM_SIZE   (1024U) /* 1kB */
 

Macro Definition Documentation

◆ EEPROM_SIZE

#define EEPROM_SIZE   (1024U) /* 1kB */

Definition at line 213 of file periph_cpu.h.

◆ GPIO_PIN

#define GPIO_PIN (   port,
  pin 
)    (gpio_t)((port << GPIO_PORT_SHIFT) | pin)

Define a custom GPIO_PIN macro for native.

Definition at line 64 of file periph_cpu.h.

◆ GPIO_PORT_SHIFT

#define GPIO_PORT_SHIFT   (24)

The offset between Port and Pin.

Definition at line 59 of file periph_cpu.h.

◆ GPIOHANDLE_REQUEST_PULL_DOWN

#define GPIOHANDLE_REQUEST_PULL_DOWN   (0xFF)

Definition at line 68 of file periph_cpu.h.

◆ GPIOHANDLE_REQUEST_PULL_UP

#define GPIOHANDLE_REQUEST_PULL_UP   (0xFF)

Definition at line 71 of file periph_cpu.h.

◆ HAVE_GPIO_FLANK_T

#define HAVE_GPIO_FLANK_T

Definition at line 91 of file periph_cpu.h.

◆ HAVE_GPIO_MODE_T

#define HAVE_GPIO_MODE_T

Definition at line 66 of file periph_cpu.h.

◆ PERIPH_SPI_NEEDS_TRANSFER_BYTE

#define PERIPH_SPI_NEEDS_TRANSFER_BYTE

Use the common transfer_byte SPI function.

Definition at line 175 of file periph_cpu.h.

◆ PERIPH_SPI_NEEDS_TRANSFER_REG

#define PERIPH_SPI_NEEDS_TRANSFER_REG

Use the common transfer_reg SPI function.

Definition at line 179 of file periph_cpu.h.

◆ PERIPH_SPI_NEEDS_TRANSFER_REGS

#define PERIPH_SPI_NEEDS_TRANSFER_REGS

Use the common transfer_regs SPI function.

Definition at line 183 of file periph_cpu.h.

◆ PERIPH_TIMER_PROVIDES_SET

#define PERIPH_TIMER_PROVIDES_SET

Prevent shared timer functions from being used.

Definition at line 151 of file periph_cpu.h.

◆ PM_NUM_MODES

#define PM_NUM_MODES   (1U)

Definition at line 39 of file periph_cpu.h.

◆ PROVIDES_PM_LAYERED_OFF

#define PROVIDES_PM_LAYERED_OFF

We provide our own pm_off() function for the native CPU.

Definition at line 45 of file periph_cpu.h.

◆ PROVIDES_PM_OFF

#define PROVIDES_PM_OFF

Definition at line 157 of file periph_cpu.h.

◆ PROVIDES_PM_SET_LOWEST

#define PROVIDES_PM_SET_LOWEST

Definition at line 158 of file periph_cpu.h.

Enumeration Type Documentation

◆ gpio_flank_t

Enumerator
GPIO_FALLING 

emit interrupt on falling flank

GPIO_RISING 

emit interrupt on rising flank

GPIO_BOTH 

emit interrupt on both flanks

Definition at line 92 of file periph_cpu.h.

◆ gpio_mode_t

Available pin modes.

Generally, a pin can be configured to be input or output. In output mode, a pin can further be put into push-pull or open drain configuration. Though this is supported by most platforms, this is not always the case, so driver implementations may return an error code if a mode is not supported.

Definition at line 82 of file periph_cpu.h.