Git
Wiki
Site
projects
/
soft
/
lpc122x
/
core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74574d0
)
Add gpio_read() helper
author
Nathael Pajani
<nathael.pajani@ed3l.fr>
Tue, 26 Apr 2016 23:00:19 +0000
(
01:00
+0200)
committer
Nathael Pajani
<nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:03:04 +0000
(17:03 +0100)
include/drivers/gpio.h
patch
|
blob
|
history
diff --git
a/include/drivers/gpio.h
b/include/drivers/gpio.h
index
777284d
..
86bb8bb
100644
(file)
--- a/
include/drivers/gpio.h
+++ b/
include/drivers/gpio.h
@@
-99,6
+99,12
@@
void gpio_off(void);
gpio_port->toggle = (1 << gpio.pin);\
}
+static inline uint32_t gpio_read(const struct pio gpio)
+{
+ struct lpc_gpio* gpio_port = LPC_GPIO_REGS(gpio.port);
+ return (gpio_port->in & (1 << gpio.pin));
+}
+
/* GPIO Configuration
* This function calls the config_pio() function for the gpio with the given
Techno-Innov
42 impasse de la Combe du Bois
01150 Blyes - France
contact@techno-innov.fr
Design et hébergement du site :
Techno-Innov
Techno-Innov
- SARL Coopérative
539 169 417 RCS Bourg-en-Bresse
Ce site n'utilise pas de cookies, désolé pour les gourmands !