File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,26 @@ bool AP3_PDM::begin(pin_size_t pinPDMData, pin_size_t pinPDMClock)
3737 return (true );
3838}
3939
40+ bool AP3_PDM::end ()
41+ {
42+ uint32_t retval = am_hal_pdm_disable (_PDMhandle);
43+ if (retval != AP3_OK)
44+ {
45+ return false ;
46+ }
47+ retval = (uint32_t )am_hal_pdm_power_control (_PDMhandle, AM_HAL_PDM_POWER_OFF, false );
48+ if (retval != AP3_OK)
49+ {
50+ return retval;
51+ }
52+ retval = am_hal_pdm_deinitialize (_PDMhandle);
53+ if (retval != AP3_OK)
54+ {
55+ return false ;
56+ }
57+ return true ;
58+ }
59+
4060bool AP3_PDM::available (void )
4161{
4262 if (buff1New || buff2New)
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ class AP3_PDM
9696 // AP3_PDM(uint16_t *userBuffer, uint32_t bufferSize);
9797
9898 bool begin (pin_size_t pinPDMData = MIC_DATA, pin_size_t pinPDMClock = MIC_CLOCK);
99+ bool end ();
99100 bool available (void ); // Goes true if circular buffer is not empty
100101 bool isOverrun (void ); // Goes true if head crosses tail
101102
You can’t perform that action at this time.
0 commit comments