2021-04-11 17:27:48 +00:00
|
|
|
#ifndef __XILINX_GPIO_H
|
|
|
|
#define __XILINX_GPIO_H
|
|
|
|
|
|
|
|
#include "system_defs.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
__IO uint32_t DATA;
|
|
|
|
__IO uint32_t TRI;
|
|
|
|
__IO uint32_t DATA2;
|
|
|
|
__IO uint32_t TRI2;
|
|
|
|
} xilinx_gpio_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
__IO xilinx_gpio_t *instance;
|
|
|
|
} xilinx_gpio_handle_t;
|
|
|
|
|
|
|
|
sys_ret_t xilinx_gpio_init(xilinx_gpio_handle_t *handle);
|
|
|
|
sys_ret_t xilinx_gpio_pinmode(xilinx_gpio_handle_t *handle, uint32_t pin, uint8_t output);
|
|
|
|
sys_ret_t xilinx_gpio_write(xilinx_gpio_handle_t *handle, uint32_t pin, uint8_t value);
|
|
|
|
uint8_t xilinx_gpio_read(xilinx_gpio_handle_t *handle, uint32_t pin);
|
|
|
|
sys_ret_t xilinx_gpio_toggle(xilinx_gpio_handle_t *handle, uint32_t pin);
|
2021-04-12 18:23:31 +00:00
|
|
|
sys_ret_t xilinx_gpio_port_mode(xilinx_gpio_handle_t *handle, uint8_t bank, uint32_t output_mask);
|
|
|
|
sys_ret_t xilinx_gpio_port_write(xilinx_gpio_handle_t *handle, uint8_t bank, uint32_t value);
|
2021-04-11 17:27:48 +00:00
|
|
|
#endif
|