File tree 2 files changed +21
-0
lines changed
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)
37
37
return (true );
38
38
}
39
39
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
+
40
60
bool AP3_PDM::available (void )
41
61
{
42
62
if (buff1New || buff2New)
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ class AP3_PDM
96
96
// AP3_PDM(uint16_t *userBuffer, uint32_t bufferSize);
97
97
98
98
bool begin (pin_size_t pinPDMData = MIC_DATA, pin_size_t pinPDMClock = MIC_CLOCK);
99
+ bool end ();
99
100
bool available (void ); // Goes true if circular buffer is not empty
100
101
bool isOverrun (void ); // Goes true if head crosses tail
101
102
You can’t perform that action at this time.
0 commit comments