Macros and inline functions for accessing GPIOs of the ATmega family. More...

Detailed Description

Macros and inline functions for accessing GPIOs of the ATmega family.

Author
René Herthel rene-.nosp@m.hert.nosp@m.hel@o.nosp@m.utlo.nosp@m.ok.de
Francisco Acosta franc.nosp@m.isco.nosp@m..acos.nosp@m.ta@i.nosp@m.nria..nosp@m.fr
Laurent Navet laure.nosp@m.nt.n.nosp@m.avet@.nosp@m.gmai.nosp@m.l.com

Definition in file atmega_gpio.h.

#include <stdio.h>
#include <avr/interrupt.h>
#include "cpu.h"
#include "board.h"
#include "periph/gpio.h"
#include "periph_conf.h"
#include "periph_cpu.h"
+ Include dependency graph for atmega_gpio.h:

Go to the source code of this file.

#define ATMEGA_GPIO_BASE_PORT_A   (0x20)
 
#define ATMEGA_GPIO_OFFSET_PORT_H   (0xCB)
 
#define ATMEGA_GPIO_OFFSET_PIN_PORT   (0x02)
 
#define ATMEGA_GPIO_OFFSET_PIN_PIN   (0x03)
 
static uint8_t atmega_pin_num (gpio_t pin)
 Extract the pin number of the given pin.
 
static uint8_t atmega_port_num (gpio_t pin)
 Extract the port number of the given pin.
 
static uint16_t atmega_port_addr (gpio_t pin)
 Generate the PORTx address of the give pin.
 
static uint16_t atmega_ddr_addr (gpio_t pin)
 Generate the DDRx address of the given pin.
 
static uint16_t atmega_pin_addr (gpio_t pin)
 Generate the PINx address of the given pin.