NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_gpio.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2024 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
18#ifndef neorv32_gpio_h
19#define neorv32_gpio_h
20
21#include <stdint.h>
22
23
24/**********************************************************************/
29typedef volatile struct __attribute__((packed,aligned(4))) {
30 const uint32_t INPUT[2];
31 uint32_t OUTPUT[2];
33
35#define NEORV32_GPIO ((neorv32_gpio_t*) (NEORV32_GPIO_BASE))
39/**********************************************************************/
44void neorv32_gpio_pin_set(int pin, int value);
45void neorv32_gpio_pin_toggle(int pin);
46uint32_t neorv32_gpio_pin_get(int pin);
47void neorv32_gpio_port_set(uint64_t d);
48void neorv32_gpio_port_toggle(uint64_t toggle);
49uint64_t neorv32_gpio_port_get(void);
53#endif // neorv32_gpio_h
void neorv32_gpio_pin_toggle(int pin)
Definition neorv32_gpio.c:62
void neorv32_gpio_port_toggle(uint64_t toggle)
Definition neorv32_gpio.c:104
int neorv32_gpio_available(void)
Definition neorv32_gpio.c:26
void neorv32_gpio_pin_set(int pin, int value)
Definition neorv32_gpio.c:43
void neorv32_gpio_port_set(uint64_t d)
Definition neorv32_gpio.c:89
uint64_t neorv32_gpio_port_get(void)
Definition neorv32_gpio.c:119
uint32_t neorv32_gpio_pin_get(int pin)
Definition neorv32_gpio.c:76
Definition neorv32_gpio.h:29