Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/M5Unified.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,29 @@ static constexpr const uint8_t _pin_table_mbus[][31] = {
return true;
}

bool M5Unified::_microphone_enabled_cb_papermono(void* args, bool enabled)
{
#if defined (CONFIG_IDF_TARGET_ESP32S3)
auto self = (M5Unified*)args;
auto& ioe1 = self->getIOExpander(0);
bool result = true;
if (enabled)
{
// The factory firmware enables PM1 BOOST before powering the PDM mic.
result = self->Power.M5pm1.setExtOutput(true);
}
// M5IOE1 GPIO12 is the Paper Mono PDM microphone power enable.
ioe1.setHighImpedance(M5IOE1_Class::gpio12, false);
ioe1.setDirection(M5IOE1_Class::gpio12, true);
ioe1.digitalWrite(M5IOE1_Class::gpio12, enabled);
return result;
#else
(void)args;
(void)enabled;
#endif
return true;
}


bool M5Unified::_microphone_enabled_cb_stopwatch(void* args, bool enabled)
{
Expand Down Expand Up @@ -2213,6 +2236,7 @@ static constexpr const uint8_t _pin_table_mbus[][31] = {
{ /// builtin PDM mic
mic_cfg.pin_ws = GPIO_NUM_45;
mic_cfg.pin_data_in = GPIO_NUM_46;
mic_enable_cb = _microphone_enabled_cb_papermono;
}
break;

Expand Down
1 change: 1 addition & 0 deletions src/M5Unified.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ namespace m5
static bool _microphone_enabled_cb_stickc(void* args, bool enabled);
static bool _microphone_enabled_cb_sticks3(void* args, bool enabled);
static bool _microphone_enabled_cb_papercolor(void* args, bool enabled);
static bool _microphone_enabled_cb_papermono(void* args, bool enabled);
static bool _microphone_enabled_cb_stopwatch(void* args, bool enabled);
static bool _microphone_enabled_cb_chain_captain(void* args, bool enabled);
static bool _microphone_enabled_cb_tab5(void* args, bool enabled);
Expand Down
Loading