display SPI now 10MHz; set PWM duty cycle to zero at stop to quiet output

This commit is contained in:
Dan Halbert 2021-08-11 10:48:53 -04:00
parent 24e61a7da8
commit 35aac3d26b
2 changed files with 5 additions and 3 deletions

View File

@ -69,7 +69,7 @@ void board_init(void) {
&pin_GPIO24, // Command or data
&pin_GPIO22, // Chip select
&pin_GPIO23, // Reset
1000000, // Baudrate
10000000, // Baudrate
0, // Polarity
0); // Phase

View File

@ -225,9 +225,11 @@ void common_hal_audiopwmio_pwmaudioout_stop(audiopwmio_pwmaudioout_obj_t *self)
audio_dma_stop(&self->dma);
// Set to quiescent level.
pwm_hw->slice[self->left_pwm.slice].cc = self->quiescent_value;
common_hal_pwmio_pwmout_set_duty_cycle(&self->left_pwm, self->quiescent_value);
pwmio_pwmout_set_top(&self->left_pwm, PWM_TOP);
if (self->stereo) {
pwm_hw->slice[self->right_pwm.slice].cc = self->quiescent_value;
common_hal_pwmio_pwmout_set_duty_cycle(&self->right_pwm, self->quiescent_value);
pwmio_pwmout_set_top(&self->right_pwm, PWM_TOP);
}
}