[fix] spi drivers set cs pin in idle
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user