[fix] spi drivers set cs pin in idle

This commit is contained in:
2023-05-21 21:08:09 +02:00
parent 6d313aaa54
commit 26f5cfe3ce
2 changed files with 4 additions and 0 deletions

View File

@@ -40,6 +40,8 @@ void ad9833_init(ad9833_handle_t *hfg, SPI_HandleTypeDef *hspi, GPIO_TypeDef *cs
hfg->cs_port = cs_port;
hfg->cs_pin = cs_pin;
HAL_GPIO_WritePin(hfg->cs_port, hfg->cs_pin, GPIO_PIN_SET);
hfg->_regCtl = 0;
hfg->_regCtl |= (1 << AD_B28); // always write 2 words consecutively for frequency
ad9833_transmit16(hfg, hfg->_regCtl);