Go to the documentation of this file.
29 #include <avr/interrupt.h>
34 #include "periph_conf.h"
35 #include "periph_cpu.h"
41 #define ATMEGA_GPIO_BASE_PORT_A (0x20)
42 #define ATMEGA_GPIO_OFFSET_PORT_H (0xCB)
43 #define ATMEGA_GPIO_OFFSET_PIN_PORT (0x02)
44 #define ATMEGA_GPIO_OFFSET_PIN_PIN (0x03)
59 return (pin >> 4) & 0x0f;
68 uint16_t port_addr = port_num * ATMEGA_GPIO_OFFSET_PIN_PIN;
70 port_addr += ATMEGA_GPIO_BASE_PORT_A;
71 port_addr += ATMEGA_GPIO_OFFSET_PIN_PORT;
75 port_addr += ATMEGA_GPIO_OFFSET_PORT_H;
static uint8_t atmega_pin_num(gpio_t pin)
Extract the pin number of the given pin.
static uint16_t atmega_port_addr(gpio_t pin)
Generate the PORTx address of the give pin.
static uint8_t atmega_port_num(gpio_t pin)
Extract the port number of the given pin.
Low-level GPIO peripheral driver interface definitions.
static uint16_t atmega_pin_addr(gpio_t pin)
Generate the PINx address of the given pin.
static uint16_t atmega_ddr_addr(gpio_t pin)
Generate the DDRx address of the given pin.