50 uint8_t port, pin_num, pin_mask;
53 port = PIN_TO_PORT(pin);
54 port_base = PIN_TO_PORT_BASE(pin);
60 tmp = cfg & GPIO_HAL_PIN_CFG_EDGE_BOTH;
61 if(tmp == GPIO_HAL_PIN_CFG_EDGE_NONE) {
63 }
else if(tmp == GPIO_HAL_PIN_CFG_EDGE_RISING) {
67 }
else if(tmp == GPIO_HAL_PIN_CFG_EDGE_FALLING) {
71 }
else if(tmp == GPIO_HAL_PIN_CFG_EDGE_BOTH) {
76 tmp = cfg & GPIO_HAL_PIN_CFG_PULL_MASK;
77 if(tmp == GPIO_HAL_PIN_CFG_PULL_NONE) {
79 }
else if(tmp == GPIO_HAL_PIN_CFG_PULL_DOWN) {
81 }
else if(tmp == GPIO_HAL_PIN_CFG_PULL_UP) {
85 tmp = cfg & GPIO_HAL_PIN_CFG_INT_MASK;
86 if(tmp == GPIO_HAL_PIN_CFG_INT_DISABLE) {
88 }
else if(tmp == GPIO_HAL_PIN_CFG_INT_ENABLE) {
99 uint8_t port, pin_num, pin_mask;
104 port = PIN_TO_PORT(pin);
105 port_base = PIN_TO_PORT_BASE(pin);
114 cfg |= GPIO_HAL_PIN_CFG_PULL_UP;
116 cfg |= GPIO_HAL_PIN_CFG_PULL_DOWN;
118 cfg |= GPIO_HAL_PIN_CFG_PULL_NONE;
122 tmp = REG((port_base) +
GPIO_IE) & pin_mask;
124 cfg |= GPIO_HAL_PIN_CFG_INT_DISABLE;
126 cfg |= GPIO_HAL_PIN_CFG_INT_ENABLE;
130 if(REG((port_base) +
GPIO_IS) & pin_mask) {
131 cfg |= GPIO_HAL_PIN_CFG_EDGE_NONE;
133 if(REG((port_base) +
GPIO_IBE) & pin_mask) {
134 cfg |= GPIO_HAL_PIN_CFG_EDGE_BOTH;
136 if(REG((port_base) +
GPIO_IEV) & pin_mask) {
137 cfg |= GPIO_HAL_PIN_CFG_EDGE_RISING;
139 cfg |= GPIO_HAL_PIN_CFG_EDGE_FALLING;
#define GPIO_ENABLE_INTERRUPT(PORT_BASE, PIN_MASK)
Enable interrupt triggering for pins with PIN_MASK of port with PORT_BASE.
#define GPIO_C_BASE
GPIO_C.
void gpio_hal_arch_no_port_write_pin(gpio_hal_pin_t pin, uint8_t value)
Write a GPIO pin.
uint32_t ioc_get_over(uint8_t port, uint8_t pin)
Get Port:Pin override function.
#define GPIO_TRIGGER_BOTH_EDGES(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to trigger an interrupt on both edges.
#define GPIO_SET_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE high.
#define GPIO_WRITE_PIN(PORT_BASE, PIN_MASK, value)
Set pins with PIN_MASK of port with PORT_BASE to value.
Header file with register and macro declarations for the cc2538 GPIO module.
#define GPIO_DETECT_EDGE(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to detect edge.
#define GPIO_CLR_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE low.
Header file with declarations for the I/O Control module.
#define IOC_OVERRIDE_DIS
Override Disabled.
#define GPIO_DETECT_RISING(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to trigger an interrupt on rising edge.
void gpio_hal_arch_no_port_set_pins(gpio_hal_pin_mask_t pins)
Set multiple pins to logical high.
#define GPIO_PIN_MASK(PIN)
Converts a pin number to a pin mask.
#define GPIO_DETECT_FALLING(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to trigger an interrupt on falling edge.
#define GPIO_READ_PIN(PORT_BASE, PIN_MASK)
Read pins with PIN_MASK of port with PORT_BASE.
__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
Enable External Interrupt.
#define GPIO_DISABLE_INTERRUPT(PORT_BASE, PIN_MASK)
Disable interrupt triggering for pins with PIN_MASK of port with PORT_BASE.
#define GPIO_SOFTWARE_CONTROL(PORT_BASE, PIN_MASK)
Configure the pin to be software controlled with PIN_MASK of port with PORT_BASE. ...
void gpio_hal_arch_no_port_write_pins(gpio_hal_pin_mask_t pins, gpio_hal_pin_mask_t value)
Write multiple pins.
#define GPIO_IS
Interrupt sense.
#define GPIO_IEV
Interrupt event.
#define GPIO_B_BASE
GPIO_B.
void ioc_set_over(uint8_t port, uint8_t pin, uint8_t over)
Set Port:Pin override function.
gpio_hal_pin_mask_t gpio_hal_arch_no_port_read_pins(gpio_hal_pin_mask_t pins)
Read multiple pins.
void gpio_hal_arch_no_port_clear_pins(gpio_hal_pin_mask_t pins)
Clear multiple pins to logical low.
uint8_t gpio_hal_pin_t
GPIO pin number representation.
void gpio_hal_arch_no_port_pin_cfg_set(gpio_hal_pin_t pin, gpio_hal_pin_cfg_t cfg)
Configure a gpio pin.
#define GPIO_D_BASE
GPIO_D.
#define GPIO_A_BASE
GPIO_A.
uint32_t gpio_hal_pin_mask_t
GPIO pin mask representation.
gpio_hal_pin_cfg_t gpio_hal_arch_no_port_pin_cfg_get(gpio_hal_pin_t pin)
Read the configuration of a GPIO pin.
#define IOC_OVERRIDE_PDE
Pull Down Enable.
#define IOC_OVERRIDE_PUE
Pull Up Enable.
#define GPIO_TRIGGER_SINGLE_EDGE(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to trigger an interrupt on single edge (controlled by G...
#define GPIO_IE
Interrupt mask.
#define GPIO_IBE
Interrupt both edges.
Header file for the GPIO HAL.
uint32_t gpio_hal_pin_cfg_t
GPIO pin configuration.
#define GPIO_HAL_NULL_PORT
Convenience macro to use this as the port argument of macros.