Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
multipass
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
multipass
Commits
112bb491
Commit
112bb491
authored
4 years ago
by
Daniel Friesel
Browse files
Options
Downloads
Patches
Plain Diff
stm32f446re: implement gpio.read
parent
da25f533
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/arch/stm32f446re-nucleo/driver/gpio.h
+9
-2
9 additions, 2 deletions
include/arch/stm32f446re-nucleo/driver/gpio.h
with
9 additions
and
2 deletions
include/arch/stm32f446re-nucleo/driver/gpio.h
+
9
−
2
View file @
112bb491
...
@@ -62,9 +62,16 @@ class GPIO {
...
@@ -62,9 +62,16 @@ class GPIO {
}
}
/*
/*
inline void output(unsigned char const pin, unsigned char const value) {
inline void output(unsigned char const pin, unsigned char const value) {
}
inline unsigned char read(unsigned char const pin) {
}*/
}*/
inline
unsigned
int
read
(
unsigned
char
const
pin
)
{
if
(
pin
<
pb_0
)
{
return
gpio_get
(
GPIOA
,
1
<<
pin
);
}
else
if
(
pin
<
pc_0
)
{
return
gpio_get
(
GPIOB
,
1
<<
(
pin
-
pb_0
));
}
else
if
(
pin
<
PIN_INVALID
)
{
return
gpio_get
(
GPIOC
,
1
<<
(
pin
-
pc_0
));
}
}
inline
void
write
(
unsigned
char
const
pin
,
unsigned
char
value
)
{
inline
void
write
(
unsigned
char
const
pin
,
unsigned
char
value
)
{
if
(
pin
<
pb_0
)
{
if
(
pin
<
pb_0
)
{
if
(
value
)
{
if
(
value
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment