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
Josua Arndt jarnd.nosp@m.t@ia.nosp@m.s.rwt.nosp@m.h-aa.nosp@m.chen..nosp@m.de
Steffen Robertz steff.nosp@m.en.r.nosp@m.obert.nosp@m.z@rw.nosp@m.th-aa.nosp@m.chen.nosp@m..de

Definition in file periph_cpu.h.

#include "periph_cpu_common.h"
#include "atmega_regs_common.h"
#include "periph_conf.h"
#include "default_timer_config.h"
+ Include dependency graph for periph_cpu.h:

Go to the source code of this file.

Macros

#define CPU_ATMEGA_EXT_INTS
 Available external interrupt pins on the ATmega128rfa1 MCU.
 

Functions

static uint8_t atmega_pin2exti (uint8_t port_num, uint8_t pin_num)
 Get the interrupt vector number of the given GPIO pin.
 
static bool atmega_has_pin_exti (uint8_t port_num, uint8_t pin_num)
 Check if the given pin can be used as external interrupt.
 

Power management configuration

#define PM_NUM_MODES   (5)
 
#define AVR8_PM_SLEEP_MODE_0   SLEEP_MODE_PWR_DOWN
 Power Down.
 
#define AVR8_PM_SLEEP_MODE_1   SLEEP_MODE_PWR_SAVE
 Power Save.
 
#define AVR8_PM_SLEEP_MODE_2   SLEEP_MODE_STANDBY
 Standby.
 
#define AVR8_PM_SLEEP_MODE_3   SLEEP_MODE_ADC
 Sleep ADC low noise.
 

Defines for the I2C interface

#define I2C_PORT_REG   PORTD
 
#define I2C_PIN_MASK   (1 << PORTD1) | (1 << PORTD0)
 

EEPROM configuration

#define EEPROM_SIZE   (4096U) /* 4kB */
 

Available ports on the ATmega128rfa1 MCU

enum  {
  PORT_B = 1 , PORT_D = 3 , PORT_E = 4 , PORT_F = 5 ,
  PORT_G = 6
}
 

Macro Definition Documentation

◆ AVR8_PM_SLEEP_MODE_0

#define AVR8_PM_SLEEP_MODE_0   SLEEP_MODE_PWR_DOWN

Power Down.

Definition at line 34 of file periph_cpu.h.

◆ AVR8_PM_SLEEP_MODE_1

#define AVR8_PM_SLEEP_MODE_1   SLEEP_MODE_PWR_SAVE

Power Save.

Definition at line 35 of file periph_cpu.h.

◆ AVR8_PM_SLEEP_MODE_2

#define AVR8_PM_SLEEP_MODE_2   SLEEP_MODE_STANDBY

Standby.

Definition at line 36 of file periph_cpu.h.

◆ AVR8_PM_SLEEP_MODE_3

#define AVR8_PM_SLEEP_MODE_3   SLEEP_MODE_ADC

Sleep ADC low noise.

Definition at line 37 of file periph_cpu.h.

◆ CPU_ATMEGA_EXT_INTS

#define CPU_ATMEGA_EXT_INTS
Value:
{ GPIO_PIN(PORT_D, 0), \
GPIO_PIN(PORT_D, 1), \
GPIO_PIN(PORT_D, 2), \
GPIO_PIN(PORT_D, 3), \
GPIO_PIN(PORT_E, 4), \
GPIO_PIN(PORT_E, 5), \
GPIO_PIN(PORT_E, 6), \
GPIO_PIN(PORT_E, 7) }
@ PORT_E
port E
Definition periph_cpu.h:51
@ PORT_D
port D
Definition periph_cpu.h:50
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46

Available external interrupt pins on the ATmega128rfa1 MCU.

In order of their interrupt number.

Definition at line 58 of file periph_cpu.h.

◆ EEPROM_SIZE

#define EEPROM_SIZE   (4096U) /* 4kB */

Definition at line 100 of file periph_cpu.h.

◆ I2C_PIN_MASK

#define I2C_PIN_MASK   (1 << PORTD1) | (1 << PORTD0)

Definition at line 93 of file periph_cpu.h.

◆ I2C_PORT_REG

#define I2C_PORT_REG   PORTD

Definition at line 92 of file periph_cpu.h.

◆ PM_NUM_MODES

#define PM_NUM_MODES   (5)

Definition at line 33 of file periph_cpu.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PORT_B 

port B

PORT_D 

port D

PORT_E 

port E

PORT_F 

port F

PORT_G 

port G

Definition at line 44 of file periph_cpu.h.

Function Documentation

◆ atmega_has_pin_exti()

static bool atmega_has_pin_exti ( uint8_t  port_num,
uint8_t  pin_num 
)
inlinestatic

Check if the given pin can be used as external interrupt.

Definition at line 79 of file periph_cpu.h.

◆ atmega_pin2exti()

static uint8_t atmega_pin2exti ( uint8_t  port_num,
uint8_t  pin_num 
)
inlinestatic

Get the interrupt vector number of the given GPIO pin.

Definition at line 70 of file periph_cpu.h.