Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
toerb
flow3r firmware
Commits
b390d098
Commit
b390d098
authored
1 year ago
by
schneider
Committed by
dx
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
espan: portexpander: detect rev6
parent
7841f5c0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
components/badge23/espan.c
+2
-0
2 additions, 0 deletions
components/badge23/espan.c
components/badge23/include/badge23/portexpander.h
+1
-0
1 addition, 0 deletions
components/badge23/include/badge23/portexpander.h
components/badge23/portexpander.c
+16
-0
16 additions, 0 deletions
components/badge23/portexpander.c
with
19 additions
and
0 deletions
components/badge23/espan.c
+
2
−
0
View file @
b390d098
...
...
@@ -54,6 +54,8 @@ void os_app_main(void)
leds_init
();
captouch_init
();
if
(
portexpander_rev6
())
printf
(
"REV6
\n
"
);
else
printf
(
"REV5
\n
"
);
vTaskDelay
(
2000
/
portTICK_PERIOD_MS
);
//set_global_vol_dB(0);
...
...
This diff is collapsed.
Click to expand it.
components/badge23/include/badge23/portexpander.h
+
1
−
0
View file @
b390d098
...
...
@@ -5,4 +5,5 @@
void
portexpander_set_badgelink
(
const
bool
enabled
);
void
portexpander_set_leds
(
const
bool
enabled
);
void
portexpander_set_lcd_reset
(
const
bool
enabled
);
bool
portexpander_rev6
(
void
);
void
portexpander_init
(
void
);
This diff is collapsed.
Click to expand it.
components/badge23/portexpander.c
+
16
−
0
View file @
b390d098
...
...
@@ -34,6 +34,17 @@ static esp_err_t pca9557_i2c_read(const uint8_t addr, const uint8_t reg, uint8_t
return
ret
;
}
static
bool
pca9557_detect
(
const
uint8_t
addr
)
{
uint8_t
data
;
esp_err_t
ret
=
pca9557_i2c_read
(
addr
,
0
,
&
data
);
if
(
ret
==
ESP_OK
)
{
return
true
;
}
else
{
return
false
;
}
}
static
uint8_t
pca9557_get
(
const
uint8_t
addr
)
{
uint8_t
pins
;
...
...
@@ -85,6 +96,11 @@ void portexpander_set_lcd_reset(const bool enabled)
pca9557_set
(
PEX2
,
pex2_state
);
}
bool
portexpander_rev6
(
void
)
{
return
pca9557_detect
(
PEX1
);
}
void
portexpander_init
(
void
)
{
pca9557_set_polarities
(
PEX1
,
0
);
...
...
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