Skip to content
Snippets Groups Projects
Commit 38eea1d2 authored by q3k's avatar q3k
Browse files

flow3r_bsp: add back badgelink data pin defs, fix pin inversions

parent 5def4c24
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment