Contiki-NG
|
Files | |
file | gpio-hal-arch.c |
Implementation file for the CC2538 GPIO HAL functions. | |
file | gpio-hal-arch.h |
Header file for the CC2538 GPIO HAL functions. | |
Functions | |
void | gpio_hal_arch_no_port_pin_cfg_set (gpio_hal_pin_t pin, gpio_hal_pin_cfg_t cfg) |
Configure a gpio pin. | |
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. | |
void | gpio_hal_arch_no_port_write_pin (gpio_hal_pin_t pin, uint8_t value) |
Write a GPIO pin. | |
void | gpio_hal_arch_no_port_set_pins (gpio_hal_pin_mask_t pins) |
Set multiple pins to logical high. | |
void | gpio_hal_arch_no_port_clear_pins (gpio_hal_pin_mask_t pins) |
Clear multiple pins to logical low. | |
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_write_pins (gpio_hal_pin_mask_t pins, gpio_hal_pin_mask_t value) |
Write multiple pins. | |
void gpio_hal_arch_no_port_clear_pins | ( | gpio_hal_pin_mask_t | pins | ) |
Clear multiple pins to logical low.
pins | An ORd pin mask of the pins to clear |
A pin will be set to logical low if its position in pins is set. For example you can clear pins 0 and 3 by passing 0x09.
It is the platform developer's responsibility to provide an implementation.
The implementation can be provided as a global symbol, an inline function or a function-like macro, as described above.
Definition at line 167 of file gpio-hal-arch.c.
References GPIO_A_BASE, GPIO_B_BASE, GPIO_C_BASE, GPIO_CLR_PIN, and GPIO_D_BASE.
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.
pin | The GPIO pin number (0...GPIO_HAL_PIN_COUNT - 1) |
It is the platform developer's responsibility to provide an implementation.
The implementation can be provided as a global symbol, an inline function or a function-like macro, as described above.
Definition at line 97 of file gpio-hal-arch.c.
References GPIO_IBE, GPIO_IE, GPIO_IEV, GPIO_IS, GPIO_PIN_MASK, ioc_get_over(), IOC_OVERRIDE_PDE, and IOC_OVERRIDE_PUE.
void gpio_hal_arch_no_port_pin_cfg_set | ( | gpio_hal_pin_t | pin, |
gpio_hal_pin_cfg_t | cfg ) |
Configure a gpio pin.
pin | The GPIO pin number (0...GPIO_HAL_PIN_COUNT - 1) |
cfg | The configuration |
cfg is an OR mask of GPIO_HAL_PIN_CFG_xyz
The implementation of this function also has to make sure that pin is configured as software-controlled GPIO.
It is the platform developer's responsibility to provide an implementation.
The implementation can be provided as a global symbol, an inline function or a function-like macro, as described above.
Definition at line 48 of file gpio-hal-arch.c.
References GPIO_DETECT_EDGE, GPIO_DETECT_FALLING, GPIO_DETECT_RISING, GPIO_DISABLE_INTERRUPT, GPIO_ENABLE_INTERRUPT, GPIO_PIN_MASK, GPIO_SOFTWARE_CONTROL, GPIO_TRIGGER_BOTH_EDGES, GPIO_TRIGGER_SINGLE_EDGE, IOC_OVERRIDE_DIS, IOC_OVERRIDE_PDE, IOC_OVERRIDE_PUE, and ioc_set_over().
gpio_hal_pin_mask_t gpio_hal_arch_no_port_read_pins | ( | gpio_hal_pin_mask_t | pins | ) |
Read multiple pins.
pins | An ORd pin mask of the pins to read |
An | ORd mask of the pins that are high |
If the position of the pin in pins is set and the pin is logical high then the position of the pin in the return value will be set. For example, if you pass 0x09 as the value of pins and the return value is 0x08 then pin 3 is logical high and pin 0 is logical low.
It is the platform developer's responsibility to provide an implementation.
The implementation can be provided as a global symbol, an inline function or a function-like macro, as described above.
Definition at line 176 of file gpio-hal-arch.c.
References GPIO_A_BASE, GPIO_B_BASE, GPIO_C_BASE, GPIO_D_BASE, and GPIO_READ_PIN.
void gpio_hal_arch_no_port_set_pins | ( | gpio_hal_pin_mask_t | pins | ) |
Set multiple pins to logical high.
pins | An ORd pin mask of the pins to set |
A pin will be set to logical high if its position in pins is set. For example you can set pins 0 and 3 by passing 0x09.
It is the platform developer's responsibility to provide an implementation.
The implementation can be provided as a global symbol, an inline function or a function-like macro, as described above.
Definition at line 158 of file gpio-hal-arch.c.
References GPIO_A_BASE, GPIO_B_BASE, GPIO_C_BASE, GPIO_D_BASE, and GPIO_SET_PIN.
void gpio_hal_arch_no_port_write_pin | ( | gpio_hal_pin_t | pin, |
uint8_t | value ) |
Write a GPIO pin.
pin | The GPIO pin number (0...GPIO_HAL_PIN_COUNT - 1) |
value | 0: Logical low; 1: Logical high |
It is the platform developer's responsibility to provide an implementation.
The implementation can be provided as a global symbol, an inline function or a function-like macro, as described above.
Definition at line 148 of file gpio-hal-arch.c.
References GPIO_HAL_NULL_PORT.
void gpio_hal_arch_no_port_write_pins | ( | gpio_hal_pin_mask_t | pins, |
gpio_hal_pin_mask_t | value ) |
Write multiple pins.
pins | An ORd pin mask of the pins to write |
value | An ORd mask of the value to write |
The function will modify GPIO pins that have their position in the mask set. pins, the function will write the value specified in the corresponding position in value.
For example, you can set pin 3 and clear pin 0 by a single call to this function. To achieve this, pins must be 0x09 and value 0x08.
It is the platform developer's responsibility to provide an implementation.
There is no guarantee that this function will result in an atomic operation.
The implementation can be provided as a global symbol, an inline function or a function-like macro, as described above.
Definition at line 189 of file gpio-hal-arch.c.
References GPIO_A_BASE, GPIO_B_BASE, GPIO_C_BASE, GPIO_D_BASE, and GPIO_WRITE_PIN.