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
dos
flow3r firmware
Commits
38eea1d2
Commit
38eea1d2
authored
1 year ago
by
q3k
Browse files
Options
Downloads
Patches
Plain Diff
flow3r_bsp: add back badgelink data pin defs, fix pin inversions
parent
5def4c24
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/flow3r_bsp/flow3r_bsp.h
+13
-1
13 additions, 1 deletion
components/flow3r_bsp/flow3r_bsp.h
components/flow3r_bsp/flow3r_bsp_spio.c
+25
-5
25 additions, 5 deletions
components/flow3r_bsp/flow3r_bsp_spio.c
with
38 additions
and
6 deletions
components/flow3r_bsp/flow3r_bsp.h
+
13
−
1
View file @
38eea1d2
...
...
@@ -193,4 +193,16 @@ void flow3r_bsp_spio_badgelink_left_enable(bool tip_on, bool ring_on);
//
// flow3r_bsp_spio_update must be called for this setting to actually propagate
// to hardware.
void
flow3r_bsp_spio_badgelink_right_enable
(
bool
tip_on
,
bool
ring_on
);
\ No newline at end of file
void
flow3r_bsp_spio_badgelink_right_enable
(
bool
tip_on
,
bool
ring_on
);
// Pin mapping information of programmable badge I/O. These are GPIO numbers
// that can be used with the ESP-IDF API.
typedef
struct
{
// Left jack, headphone/line out.
uint8_t
badgelink_left_tip
;
uint8_t
badgelink_left_ring
;
// Right jack, line in.
uint8_t
badgelink_right_tip
;
uint8_t
badgelink_right_ring
;
}
flow3r_bsp_spio_programmable_pins_t
;
extern
const
flow3r_bsp_spio_programmable_pins_t
flow3r_bsp_spio_programmable_pins
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
components/flow3r_bsp/flow3r_bsp_spio.c
+
25
−
5
View file @
38eea1d2
...
...
@@ -35,7 +35,9 @@ typedef struct {
typedef
struct
{
flow3r_bsp_iopin_t
tip_badgelink_enable
;
flow3r_bsp_iopin_t
tip_badgelink_data
;
flow3r_bsp_iopin_t
ring_badgelink_enable
;
flow3r_bsp_iopin_t
ring_badgelink_data
;
}
flow3r_bsp_iodef_trrs_t
;
typedef
struct
{
...
...
@@ -71,6 +73,12 @@ static const flow3r_bsp_iodef_t iodef = {
.
charger_state
=
IODUMMY
,
.
jacksense_right
=
IODUMMY
,
};
const
flow3r_bsp_spio_programmable_pins_t
flow3r_bsp_spio_programmable_pins
=
{
.
badgelink_left_tip
=
6
,
.
badgelink_left_ring
=
7
,
.
badgelink_right_tip
=
4
,
.
badgelink_right_ring
=
5
,
};
#define PORTEXP_NONE
#elif defined(CONFIG_FLOW3R_HW_GEN_P4) || defined(CONFIG_FLOW3R_HW_GEN_P3)
static
const
flow3r_bsp_iodef_t
iodef
=
{
...
...
@@ -85,16 +93,22 @@ static const flow3r_bsp_iodef_t iodef = {
.
right
=
IPEX
(
7
,
1
,
.
invert
=
true
),
},
.
trrs_left
=
{
.
tip_badgelink_enable
=
OPEX
(
6
,
0
),
.
ring_badgelink_enable
=
OPEX
(
7
,
0
),
.
tip_badgelink_enable
=
OPEX
(
6
,
0
,
.
invert
=
true
),
.
ring_badgelink_enable
=
OPEX
(
7
,
0
,
.
invert
=
true
),
},
.
trrs_right
=
{
.
tip_badgelink_enable
=
OPEX
(
5
,
0
),
.
ring_badgelink_enable
=
OPEX
(
4
,
0
),
.
tip_badgelink_enable
=
OPEX
(
5
,
0
,
.
invert
=
true
),
.
ring_badgelink_enable
=
OPEX
(
4
,
0
,
.
invert
=
true
),
},
.
charger_state
=
IODUMMY
,
.
jacksense_right
=
IODUMMY
,
};
const
flow3r_bsp_spio_programmable_pins_t
flow3r_bsp_spio_programmable_pins
=
{
.
badgelink_left_tip
=
6
,
.
badgelink_left_ring
=
7
,
.
badgelink_right_tip
=
4
,
.
badgelink_right_ring
=
5
,
};
#define PORTEXP_MAX7321S
#elif defined(CONFIG_FLOW3R_HW_GEN_P6)
static
const
flow3r_bsp_iodef_t
iodef
=
{
...
...
@@ -119,6 +133,12 @@ static const flow3r_bsp_iodef_t iodef = {
.
charger_state
=
IPEX
(
2
,
1
),
.
jacksense_right
=
IPEX
(
6
,
1
),
};
const
flow3r_bsp_spio_programmable_pins_t
flow3r_bsp_spio_programmable_pins
=
{
.
badgelink_left_tip
=
7
,
.
badgelink_left_ring
=
6
,
.
badgelink_right_tip
=
4
,
.
badgelink_right_ring
=
5
,
};
#define PORTEXP_MAX7321S
#else
#error "spio unimplemented for this badge generation"
...
...
@@ -271,7 +291,7 @@ esp_err_t flow3r_bsp_spio_init(void) {
INITIO
(
trrs_left
.
ring_badgelink_enable
);
INITIO
(
trrs_right
.
tip_badgelink_enable
);
INITIO
(
trrs_right
.
ring_badgelink_enable
);
return
_portexp_update
();
}
...
...
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