Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
46637b26
Commit
46637b26
authored
5 years ago
by
Woazboat
Committed by
Florian Kargl
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat(portexpander): New function for setting multiple pins at once
parent
8a5926b5
No related branches found
No related tags found
1 merge request
!65
Refactor portexpander code + new function for setting multiple pins at once
Pipeline
#1722
passed
5 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/card10/portexpander.c
+9
-0
9 additions, 0 deletions
lib/card10/portexpander.c
lib/card10/portexpander.h
+1
-0
1 addition, 0 deletions
lib/card10/portexpander.h
with
10 additions
and
0 deletions
lib/card10/portexpander.c
+
9
−
0
View file @
46637b26
...
...
@@ -105,3 +105,12 @@ void portexpander_set(uint8_t pin, uint8_t value)
portexpander_write
(
PE_C_OUTPUT_PORT
,
output_state
);
}
}
void
portexpander_set_mask
(
uint8_t
mask
,
uint8_t
values
)
{
if
(
detected
)
{
output_state
&=
~
(
mask
&
~
values
);
output_state
|=
mask
&
values
;
portexpander_write
(
PE_C_OUTPUT_PORT
,
output_state
);
}
}
This diff is collapsed.
Click to expand it.
lib/card10/portexpander.h
+
1
−
0
View file @
46637b26
...
...
@@ -7,6 +7,7 @@
void
portexpander_init
(
void
);
uint8_t
portexpander_get
(
void
);
void
portexpander_set
(
uint8_t
pin
,
uint8_t
value
);
void
portexpander_set_mask
(
uint8_t
mask
,
uint8_t
values
);
bool
portexpander_detected
(
void
);
#endif
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