RP2040 PDMIn frequency based on sample rate

This commit is contained in:
root 2022-02-08 10:10:02 -06:00
parent fd2cbc00f4
commit ce191327e8

View File

@ -64,7 +64,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self,
// Use the state machine to manage pins. // Use the state machine to manage pins.
common_hal_rp2pio_statemachine_construct(&self->state_machine, common_hal_rp2pio_statemachine_construct(&self->state_machine,
pdmin, sizeof(pdmin) / sizeof(pdmin[0]), pdmin, sizeof(pdmin) / sizeof(pdmin[0]),
44100 * 32 * 2, // Clock at 44.1 khz to warm the DAC up. sample_rate * 32 * 2, // Frequency based on sample rate
NULL, 0, NULL, 0,
NULL, 1, 0, 0xffffffff, // out pin NULL, 1, 0, 0xffffffff, // out pin
data_pin, 1, // in pins data_pin, 1, // in pins