![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
#include <io.h>#include <stdarg.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <types.h>#include "log.h"
Go to the source code of this file.
Classes | |
| struct | gpio_mux_t |
Macros | |
| #define | PIO_NUM_IO_BITS 5 |
| #define | GPIO_PIN(x, y) (((uint32_t) (x << PIO_NUM_IO_BITS)) | y) |
Typedefs | |
| typedef uint32_t | gpio_drv_t |
| typedef uint32_t | gpio_t |
Enumerations | |
| enum | { GPIO_INPUT = 0 , GPIO_OUTPUT = 1 , GPIO_PERIPH_MUX2 = 2 , GPIO_PERIPH_MUX3 = 3 , GPIO_PERIPH_MUX4 = 4 , GPIO_PERIPH_MUX5 = 5 , GPIO_PERIPH_MUX6 = 6 , GPIO_PERIPH_MUX7 = 7 , GPIO_PERIPH_MUX8 = 8 , GPIO_PERIPH_MUX14 = 14 , GPIO_DISABLED = 0xf } |
| enum | { GPIO_LEVEL_LOW = 0 , GPIO_LEVEL_HIGH } |
| enum | { GPIO_PORTA = 0 , GPIO_PORTB , GPIO_PORTC , GPIO_PORTD , GPIO_PORTE , GPIO_PORTF , GPIO_PORTG , GPIO_PORTH , GPIO_PORTI , GPIO_PORTJ , GPIO_PORTK , GPIO_PORTL , GPIO_PORTM , GPIO_PORTN } |
| enum | gpio_pull_t { GPIO_PULL_UP = 0 , GPIO_PULL_DOWN = 1 , GPIO_PULL_NONE = 2 } |
Functions | |
| void | sunxi_gpio_init (gpio_t pin, int cfg) |
| Initialize the specified GPIO pin with the given configuration. | |
| void | sunxi_gpio_set_value (gpio_t pin, int value) |
| Set the value of the specified GPIO pin. | |
| int | sunxi_gpio_read (gpio_t pin) |
| Read the value of the specified GPIO pin. | |
| void | sunxi_gpio_set_pull (gpio_t pin, enum gpio_pull_t pull) |
| Set the pull configuration for the specified GPIO pin. | |
| void | sunxi_gpio_set_drv (gpio_t pin, gpio_drv_t drv) |
| Sets the drive strength of a Sunxi GPIO pin. | |
| #define GPIO_PIN | ( | x, | |
| y | |||
| ) | (((uint32_t) (x << PIO_NUM_IO_BITS)) | y) |
| #define PIO_NUM_IO_BITS 5 |
| typedef uint32_t gpio_drv_t |
| anonymous enum |
| anonymous enum |
| enum gpio_pull_t |
| void sunxi_gpio_init | ( | gpio_t | pin, |
| int | cfg | ||
| ) |
Initialize the specified GPIO pin with the given configuration.
| pin | The GPIO pin to initialize. |
| cfg | The configuration value for the GPIO pin. |
Initialize the specified GPIO pin with the given configuration.
This function initializes a Sunxi GPIO pin with the specified configuration. It sets the pin's configuration based on the provided parameters.
| pin | The GPIO pin to initialize. |
| cfg | The configuration value for the GPIO pin. |
| int sunxi_gpio_read | ( | gpio_t | pin | ) |
Read the value of the specified GPIO pin.
| pin | The GPIO pin to read the value from. |
Read the value of the specified GPIO pin.
This function reads the current value of a Sunxi GPIO pin and returns it.
| pin | The GPIO pin to read the value from. |
| void sunxi_gpio_set_drv | ( | gpio_t | pin, |
| gpio_drv_t | drv | ||
| ) |
Sets the drive strength of a Sunxi GPIO pin.
This function sets the drive strength for the specified GPIO pin.
| pin | The GPIO pin to set the drive strength for. |
| drv | The drive strength value to set (GPIO_DRV_LOW, GPIO_DRV_MEDIUM, or GPIO_DRV_HIGH). |
| void sunxi_gpio_set_pull | ( | gpio_t | pin, |
| enum gpio_pull_t | pull | ||
| ) |
Set the pull configuration for the specified GPIO pin.
| pin | The GPIO pin to set the pull configuration for. |
| pull | The pull configuration to be set for the GPIO pin. |
Set the pull configuration for the specified GPIO pin.
This function sets the pull-up, pull-down, or no pull configuration for the specified GPIO pin.
| pin | The GPIO pin to set the pull configuration for. |
| pull | The pull configuration to set (GPIO_PULL_UP, GPIO_PULL_DOWN, or GPIO_PULL_NONE). |
| void sunxi_gpio_set_value | ( | gpio_t | pin, |
| int | value | ||
| ) |
Set the value of the specified GPIO pin.
| pin | The GPIO pin to set the value for. |
| value | The value to be set (0 or 1) for the GPIO pin. |
Set the value of the specified GPIO pin.
This function sets the value of a Sunxi GPIO pin to the specified value (0 or 1).
| pin | The GPIO pin to set the value for. |
| value | The value to set (0 or 1). |