24#include "periph_cpu.h"
35#define GPIO_PORT_1 ((gpio_port_t)&PORT_1.base)
36#define GPIO_PORT_2 ((gpio_port_t)&PORT_2.base)
37#define GPIO_PORT_3 ((gpio_port_t)&PORT_3.base)
38#define GPIO_PORT_4 ((gpio_port_t)&PORT_4.base)
39#define GPIO_PORT_5 ((gpio_port_t)&PORT_5.base)
40#define GPIO_PORT_6 ((gpio_port_t)&PORT_6.base)
43#if defined(CPU_FAM_MSP430_F2XX_G2XX)
44# define GPIO_PORT_7 ((gpio_port_t)&PORT_7)
45# define GPIO_PORT_8 ((gpio_port_t)&PORT_8)
66#if defined(CPU_FAM_MSP430_F2XX_G2XX)
67 if (port >= (uintptr_t)(&
PORT_7)) {
78#if defined(CPU_FAM_MSP430_F2XX_G2XX)
79 if (port >= (uintptr_t)(&
PORT_7)) {
90#if defined(CPU_FAM_MSP430_F2XX_G2XX)
91 if (port >= (uintptr_t)(&
PORT_7)) {
103#if defined(CPU_FAM_MSP430_F2XX_G2XX)
104 if (port >= (uintptr_t)(&
PORT_7)) {
116#if defined(CPU_FAM_MSP430_F2XX_G2XX)
117 if (port >= (uintptr_t)(&
PORT_7)) {
129#if defined(CPU_FAM_MSP430_F2XX_G2XX)
130 if (port >= (uintptr_t)(&
PORT_7)) {
152#if defined(CPU_FAM_MSP430_F2XX_G2XX)
153 if (port >= (uintptr_t)(&
PORT_7)) {
165#if defined(CPU_FAM_MSP430_F2XX_G2XX)
166 if (port >= (uintptr_t)(&
PORT_7)) {
192#if defined(CPU_FAM_MSP430_F2XX_G2XX)
193 return (num > 0) && (num <= 8);
195 return (num > 0) && (num <= 6);
static uint8_t gpio_get_pin_num(gpio_t pin)
Extract the pin number from a gpio_t
static void gpio_ll_set(gpio_port_t port, uword_t mask)
Perform an reg |= mask operation on the I/O register of the port.
gpio_port_t gpio_port(uword_t num)
Get the gpio_port_t value of the port number num.
static gpio_port_t gpio_port_pack_addr(void *addr)
Pack a pointer into a gpio_port_t.
static void gpio_ll_switch_dir_output(gpio_port_t port, uword_t pins)
Turn GPIO pins specified by pins (obtained from gpio_ll_prepare_switch_dir) to outputs.
static void gpio_ll_switch_dir_input(gpio_port_t port, uword_t pins)
Turn GPIO pins specified by pins (obtained from gpio_ll_prepare_switch_dir) to inputs.
static uword_t gpio_ll_read(gpio_port_t port)
Get the current input value of all GPIO pins of the given port as bitmask.
static gpio_port_t gpio_get_port(gpio_t pin)
Extract the gpio_port_t from a gpio_t
uword_t gpio_port_num(gpio_port_t port)
Get the number of the GPIO port port refers to.
static void * gpio_port_unpack_addr(gpio_port_t port)
Extract a data pointer that was packed by gpio_port_pack_addr.
static bool is_gpio_port_num_valid(uint_fast8_t num)
Check if the given number is a valid argument for gpio_port.
static uword_t gpio_ll_read_output(gpio_port_t port)
Get the current output value of all GPIO pins of the given port as bitmask.
static void gpio_ll_clear(gpio_port_t port, uword_t mask)
Perform an reg &= ~mask operation on the I/O register of the port.
static void gpio_ll_toggle(gpio_port_t port, uword_t mask)
Perform an reg ^= mask operation on the I/O register of the port.
static void gpio_ll_write(gpio_port_t port, uword_t state)
Perform a masked write operation on the I/O register of the port.
uintptr_t gpio_port_t
GPIO port type.
uint< NUM > _t uword_t
Word sized unsigned integer.
msp430_port_p7_p8_t PORT_7
Register map of GPIO PORT 7.
#define RAMSTART
Lowest address of the RAM, peripherals are below.
GPIO Port 7/8 (different register layout than Ports 1-6)
Common MSP GPIO Port Registers.