Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,11 @@ ifneq (,$(filter periph_gpio_irq,$(USEMODULE)))
FEATURES_REQUIRED += periph_gpio
endif

# Enable optionally periph_gpio_ext when the MCU supports it as feature
ifneq (,$(filter periph_gpio,$(USEMODULE)))
FEATURES_OPTIONAL += periph_gpio_ext
endif

ifneq (,$(filter devfs_hwrng,$(USEMODULE)))
FEATURES_REQUIRED += periph_hwrng
endif
Expand Down
9 changes: 5 additions & 4 deletions boards/atmega256rfr2-xpro/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define BOARD_H

#include "cpu.h"
#include "periph_cpu.h"
#include "periph/gpio.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -48,10 +49,10 @@ extern "C" {
*/
#define LED0_PIN GPIO_PIN(PORT_B, 4)
#define LED0_MODE GPIO_OUT
#define LED0_ENABLE_PORT DDRB |= LED0_PIN
#define LED0_ON PORTB |= LED0_PIN
#define LED0_OFF PORTB &= ~LED0_PIN
#define LED0_TOGGLE PORTB ^= LED0_PIN
#define LED0_ENABLE_PORT DDRB |= LED0_PIN.pin
#define LED0_ON PORTB |= LED0_PIN.pin
#define LED0_OFF PORTB &= ~LED0_PIN.pin
#define LED0_TOGGLE PORTB ^= LED0_PIN.pin
/** @} */

/**
Expand Down
1 change: 1 addition & 0 deletions boards/avr-rss2/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "cpu.h"
#include "periph/gpio.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions boards/b-l072z-lrwan1/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <stdint.h>

#include "cpu.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions boards/b-l475e-iot01a/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <stdint.h>

#include "cpu.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 2 additions & 0 deletions boards/common/blxxxpill/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#ifndef BOARD_COMMON_H
#define BOARD_COMMON_H

#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
4 changes: 2 additions & 2 deletions boards/common/nucleo64/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ static const motor_driver_config_t motor_driver_config[] = {
.motors = {
{
.pwm_channel = 0,
.gpio_enable = 0,
.gpio_enable = GPIO_UNDEF,
.gpio_dir0 = ARDUINO_PIN_15,
.gpio_dir1_or_brake = 0,
.gpio_dir1_or_brake = GPIO_UNDEF,
.gpio_dir_reverse = 0,
.gpio_enable_invert = 0,
.gpio_brake_invert = 0,
Expand Down
2 changes: 2 additions & 0 deletions boards/lobaro-lorabox/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef BOARD_H
#define BOARD_H

#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
2 changes: 2 additions & 0 deletions boards/maple-mini/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef BOARD_H
#define BOARD_H

#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
18 changes: 9 additions & 9 deletions boards/mega-xplained/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ extern "C" {
* @{
*/
/* LED0,2 currently unsupported due to lack of GPIO_OD support */
#define LED1_ENABLE_PORT DDRB |= LED1_PIN
#define LED1_ON PORTB |= LED1_PIN
#define LED1_OFF PORTB &= ~LED1_PIN
#define LED1_TOGGLE PORTB ^= LED1_PIN

#define LED3_ENABLE_PORT DDRB |= LED3_PIN
#define LED3_ON PORTB |= LED3_PIN
#define LED3_OFF PORTB &= ~LED3_PIN
#define LED3_TOGGLE PORTB ^= LED3_PIN
#define LED1_ENABLE_PORT DDRB |= LED1_PIN.pin
#define LED1_ON PORTB |= LED1_PIN.pin
#define LED1_OFF PORTB &= ~LED1_PIN.pin
#define LED1_TOGGLE PORTB ^= LED1_PIN.pin

#define LED3_ENABLE_PORT DDRB |= LED3_PIN.pin
#define LED3_ON PORTB |= LED3_PIN.pin
#define LED3_OFF PORTB &= ~LED3_PIN.pin
#define LED3_TOGGLE PORTB ^= LED3_PIN.pin
/** @} */

/**
Expand Down
5 changes: 4 additions & 1 deletion boards/nz32-sc151/include/sx127x_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ static const sx127x_params_t sx127x_params[] =
.dio0_pin = GPIO_PIN(PORT_B, 0),
.dio1_pin = GPIO_PIN(PORT_B, 1),
.dio2_pin = GPIO_PIN(PORT_C, 6),
.dio3_pin = GPIO_PIN(PORT_A, 10)
.dio3_pin = GPIO_PIN(PORT_A, 10),
.dio4_pin = GPIO_UNDEF,
.dio5_pin = GPIO_UNDEF,
.paselect = SX127X_PA_RFO
}
};

Expand Down
2 changes: 2 additions & 0 deletions boards/opencm904/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef BOARD_H
#define BOARD_H

#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
1 change: 1 addition & 0 deletions boards/p-l496g-cell02/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <stdint.h>

#include "cpu.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions boards/pyboard/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <stdint.h>

#include "cpu.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 2 additions & 0 deletions boards/stm32f030f4-demo/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#ifndef BOARD_H
#define BOARD_H

#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
1 change: 1 addition & 0 deletions boards/stm32f0discovery/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define BOARD_H

#include "cpu.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions boards/stm32f3discovery/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define BOARD_H

#include "cpu.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions boards/stm32l0538-disco/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define BOARD_H

#include "cpu.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions boards/stm32l476g-disco/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <stdint.h>

#include "cpu.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions boards/ublox-c030-u201/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <stdint.h>

#include "cpu.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
Expand Down
13 changes: 13 additions & 0 deletions cpu/atmega1281/include/periph_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,21 @@ enum {
PORT_E = 4, /**< port E */
PORT_F = 5, /**< port F */
PORT_G = 6, /**< port G */
GPIO_EXT_PORT = 7 /**< first GPIO extender port */
};

/**
* @brief Available ports on the ATmega1281 family as GPIO register definitions
*/
#define GPIO_CPU_PORTS \
GPIO_CPU_PORT(0x22), /* port A */ \
GPIO_CPU_PORT(0x25), /* port B */ \
GPIO_CPU_PORT(0x28), /* port C */ \
GPIO_CPU_PORT(0x2b), /* port D */ \
GPIO_CPU_PORT(0x2e), /* port E */ \
GPIO_CPU_PORT(0x31), /* port F */ \
GPIO_CPU_PORT(0x34), /* port G */

/**
* @brief Available external interrupt pins on the ATmega1281 family
*
Expand Down
17 changes: 11 additions & 6 deletions cpu/atmega1284p/include/periph_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,26 @@
extern "C" {
#endif

/**
* @brief Define a CPU specific GPIO pin generator macro
*/
#define GPIO_PIN(x, y) ((x << 4) | y)

/**
* @brief Available ports on the ATmega1284p family
*/
enum {
PORT_A = 0, /**< port A */
PORT_B = 1, /**< port B */
PORT_C = 2, /**< port C */
PORT_D = 3 /**< port D */
PORT_D = 3, /**< port D */
GPIO_EXT_PORT = 4 /**< first GPIO extender port */
};

/**
* @brief Available ports on the ATmega1284p family as GPIO register definitions
*/
#define GPIO_CPU_PORTS \
GPIO_CPU_PORT(0x22), /* port A */ \
GPIO_CPU_PORT(0x25), /* port B */ \
GPIO_CPU_PORT(0x28), /* port C */ \
GPIO_CPU_PORT(0x2b), /* port D */

/**
* @brief Available external interrupt pins on the ATmega1284p family
*
Expand Down
23 changes: 18 additions & 5 deletions cpu/atmega128rfa1/include/periph_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,27 @@ extern "C" {
* @{
*/
enum {
PORT_B = 1, /**< port B */
PORT_D = 3, /**< port D */
PORT_E = 4, /**< port E */
PORT_F = 5, /**< port F */
PORT_G = 6, /**< port G */
PORT_B = 1, /**< port B */
PORT_D = 3, /**< port D */
PORT_E = 4, /**< port E */
PORT_F = 5, /**< port F */
PORT_G = 6, /**< port G */
GPIO_EXT_PORT = 7 /**< first GPIO extender port */
};
/** @} */

/**
* @brief Available ports on the ATmega128rfa1 MCU as GPIO register definitions
*/
#define GPIO_CPU_PORTS \
GPIO_CPU_PORT(0 ), /* n/a */ \
GPIO_CPU_PORT(0x25), /* port B */ \
GPIO_CPU_PORT(0 ), /* n/a */ \
GPIO_CPU_PORT(0x2b), /* port D */ \
GPIO_CPU_PORT(0x2e), /* port E */ \
GPIO_CPU_PORT(0x31), /* port F */ \
GPIO_CPU_PORT(0x34), /* port G */

/**
* @brief Available external interrupt pins on the ATmega128rfa1 MCU
*
Expand Down
39 changes: 28 additions & 11 deletions cpu/atmega2560/include/periph_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,36 @@ extern "C" {
* @brief Available ports on the ATmega2560 family
*/
enum {
PORT_A = 0, /**< port A */
PORT_B = 1, /**< port B */
PORT_C = 2, /**< port C */
PORT_D = 3, /**< port D */
PORT_E = 4, /**< port E */
PORT_F = 5, /**< port F */
PORT_G = 6, /**< port G */
PORT_H = 7, /**< port H */
PORT_J = 8, /**< port J */
PORT_K = 9, /**< port K */
PORT_L = 10 /**< port L */
PORT_A = 0, /**< port A */
PORT_B = 1, /**< port B */
PORT_C = 2, /**< port C */
PORT_D = 3, /**< port D */
PORT_E = 4, /**< port E */
PORT_F = 5, /**< port F */
PORT_G = 6, /**< port G */
PORT_H = 7, /**< port H */
PORT_J = 8, /**< port J */
PORT_K = 9, /**< port K */
PORT_L = 10, /**< port L */
GPIO_EXT_PORT = 11 /**< first GPIO extender port */
};

/**
* @brief Available ports on the ATmega2560 family as GPIO register definitions
*/
#define GPIO_CPU_PORTS \
GPIO_CPU_PORT(0x22), /* port A */ \
GPIO_CPU_PORT(0x25), /* port B */ \
GPIO_CPU_PORT(0x28), /* port C */ \
GPIO_CPU_PORT(0x2b), /* port D */ \
GPIO_CPU_PORT(0x2e), /* port E */ \
GPIO_CPU_PORT(0x31), /* port F */ \
GPIO_CPU_PORT(0x34), /* port G */ \
GPIO_CPU_PORT(0x102), /* port H */ \
GPIO_CPU_PORT(0x105), /* port J */ \
GPIO_CPU_PORT(0x108), /* port K */ \
GPIO_CPU_PORT(0x10b), /* port L */

/**
* @brief Available external interrupt pins on the ATmega2560 family
*
Expand Down
23 changes: 18 additions & 5 deletions cpu/atmega256rfr2/include/periph_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,27 @@ extern "C" {
* @{
*/
enum {
PORT_B = 1, /**< port B */
PORT_D = 3, /**< port D */
PORT_E = 4, /**< port E */
PORT_F = 5, /**< port F */
PORT_G = 6, /**< port G */
PORT_B = 1, /**< port B */
PORT_D = 3, /**< port D */
PORT_E = 4, /**< port E */
PORT_F = 5, /**< port F */
PORT_G = 6, /**< port G */
GPIO_EXT_PORT = 7 /**< first GPIO extender port */
};
/** @} */

/**
* @brief Available ports on the ATmega256rfr2 MCU as GPIO register definitions
*/
#define GPIO_CPU_PORTS \
GPIO_CPU_PORT(0 ), /* n/a */ \
GPIO_CPU_PORT(0x25), /* port B */ \
GPIO_CPU_PORT(0 ), /* n/a */ \
GPIO_CPU_PORT(0x2b), /* port D */ \
GPIO_CPU_PORT(0x2e), /* port E */ \
GPIO_CPU_PORT(0x31), /* port F */ \
GPIO_CPU_PORT(0x34), /* port G */

/**
* @brief Available external interrupt pins on the ATmega256rfr family
*
Expand Down
Loading