23 #include "periph_cpu.h"
34 #define GPIO_PORT_1 ((gpio_port_t)&PORT_1.base)
35 #define GPIO_PORT_2 ((gpio_port_t)&PORT_2.base)
36 #define GPIO_PORT_3 ((gpio_port_t)&PORT_3.base)
37 #define GPIO_PORT_4 ((gpio_port_t)&PORT_4.base)
38 #define GPIO_PORT_5 ((gpio_port_t)&PORT_5.base)
39 #define GPIO_PORT_6 ((gpio_port_t)&PORT_6.base)
42 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
43 # define GPIO_PORT_7 ((gpio_port_t)&PORT_7)
44 # define GPIO_PORT_8 ((gpio_port_t)&PORT_8)
65 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
66 if (port >= (uintptr_t)(&
PORT_7)) {
77 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
78 if (port >= (uintptr_t)(&
PORT_7)) {
89 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
90 if (port >= (uintptr_t)(&
PORT_7)) {
102 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
103 if (port >= (uintptr_t)(&
PORT_7)) {
115 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
116 if (port >= (uintptr_t)(&
PORT_7)) {
128 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
129 if (port >= (uintptr_t)(&
PORT_7)) {
151 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
152 if (port >= (uintptr_t)(&
PORT_7)) {
164 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
165 if (port >= (uintptr_t)(&
PORT_7)) {
191 #if defined(CPU_FAM_MSP430_F2XX_G2XX)
192 return (num > 0) && (num <= 8);
194 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_port_unpack_addr(gpio_port_t port)
Extract a data pointer that was packed by gpio_port_pack_addr.
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 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.