libyggdrasil
v1.0.0
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
i
o
p
r
s
Functions
Variables
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
l
m
o
p
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
m
o
p
r
s
t
u
w
~
Variables
a
b
c
d
e
f
g
i
l
m
o
p
r
s
t
v
x
y
z
Typedefs
Enumerations
Related Functions
Files
File List
File Members
All
_
a
c
d
e
f
h
i
l
m
n
o
p
r
s
t
u
w
y
Functions
_
c
d
y
Variables
Typedefs
Enumerations
Enumerator
c
d
e
h
i
m
s
Macros
a
c
d
f
h
l
m
n
o
p
s
t
u
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
gpio.h
Go to the documentation of this file.
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
* _____.___. .___ .__.__ *
3
* \__ | | ____ ____ __| _/___________ _____|__| | *
4
* / | |/ ___\ / ___\ / __ |\_ __ \__ \ / ___/ | | *
5
* \____ / /_/ > /_/ > /_/ | | | \// __ \_\___ \| | |__ *
6
* / ______\___ /\___ /\____ | |__| (____ /____ >__|____/ *
7
* \/ /_____//_____/ \/ \/ \/ *
8
* - Midgard - *
9
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
10
* This software can be used by students and other personal of the *
11
* Bern University of Applied Sciences under the terms of the MIT *
12
* license. *
13
* For other persons this software is under the terms of the GNU *
14
* General Public License version 2. *
15
* *
16
* Copyright © 2021, Bern University of Applied Sciences. *
17
* All rights reserved. *
18
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26
#include <
c/common/types.h
>
27
28
#include <stm32f7xx_hal.h>
29
30
#define LOW_ACTIVE true
31
#define HIGH_ACTIVE false
32
36
typedef
GPIO_TypeDef*
port_t
;
37
41
typedef
u8
pin_t
;
42
46
typedef
struct
{
47
port_t
port
;
48
pin_t
pin
;
49
bool
lowActive;
50
}
gpio_t
;
51
58
C_LINKAGE
bool
yggdrasil_GPIO_Init
(
gpio_t
gpio);
59
66
C_LINKAGE
bool
yggdrasil_GPIO_Deinit
(
gpio_t
gpio);
67
74
C_LINKAGE
bool
yggdrasil_GPIO_Get
(
gpio_t
gpio);
75
82
C_LINKAGE
void
yggdrasil_GPIO_Set
(
gpio_t
gpio,
bool
state);
83
89
C_LINKAGE
void
yggdrasil_GPIO_Toggle
(
gpio_t
gpio);
90
99
C_LINKAGE
u16
yggdrasil_GPIO_GetMultiple
(
port_t
port,
u8
from,
u8
to);
100
110
C_LINKAGE
void
yggdrasil_GPIO_SetMultiple
(
port_t
port,
u8
from,
u8
to,
u16
value);
gpio_t::port
port_t port
Definition:
gpio.h:47
types.h
Commonly used type definitions and helper templates.
u16
uint16_t u16
Definition:
types.h:37
u8
uint8_t u8
Unsigned integer definitions.
Definition:
types.h:36
port_t
GPIO_TypeDef * port_t
GPIO port type.
Definition:
gpio.h:36
yggdrasil_GPIO_SetMultiple
C_LINKAGE void yggdrasil_GPIO_SetMultiple(port_t port, u8 from, u8 to, u16 value)
Set multiple GPIO states.
Definition:
gpio.cpp:69
yggdrasil_GPIO_Get
C_LINKAGE bool yggdrasil_GPIO_Get(gpio_t gpio)
Get GPIO state.
Definition:
gpio.cpp:86
yggdrasil_GPIO_Toggle
C_LINKAGE void yggdrasil_GPIO_Toggle(gpio_t gpio)
Toggle GPIO.
Definition:
gpio.cpp:109
yggdrasil_GPIO_GetMultiple
C_LINKAGE u16 yggdrasil_GPIO_GetMultiple(port_t port, u8 from, u8 to)
Get multiple GPIO states.
Definition:
gpio.cpp:63
gpio_t::pin
pin_t pin
Definition:
gpio.h:48
yggdrasil_GPIO_Init
bool yggdrasil_GPIO_Init(gpio_t gpio)
GPIO initialization.
Definition:
gpio.cpp:44
gpio_t
GPIO handle type.
Definition:
gpio.h:34
pin_t
u8 pin_t
GPIO pin type.
Definition:
gpio.h:41
C_LINKAGE
#define C_LINKAGE
Definition:
attributes.h:43
yggdrasil_GPIO_Deinit
C_LINKAGE bool yggdrasil_GPIO_Deinit(gpio_t gpio)
GPIO deinitialization.
Definition:
gpio.cpp:55
yggdrasil_GPIO_Set
C_LINKAGE void yggdrasil_GPIO_Set(gpio_t gpio, bool state)
Set GPIO state.
Definition:
gpio.cpp:99
Inc
c
midgard
driver
gpio.h
Generated by
1.8.20