fix(x12s): init periph clocks in ads79xx driver (#3810)

This commit is contained in:
Raphael Coeffic
2023-08-08 10:07:07 +10:00
committed by GitHub
parent 017ac82d59
commit e99980f1bf
4 changed files with 62 additions and 2 deletions
@@ -20,6 +20,8 @@
*/
#include "ads79xx.h"
#include "stm32_spi.h"
#include "stm32_gpio_driver.h"
#include "delays_driver.h"
#include "stm32_hal_ll.h"
@@ -39,6 +41,7 @@ static uint16_t ads79xx_rw(SPI_TypeDef* SPIx, uint16_t value)
void ads79xx_init(const stm32_spi_adc_t* adc)
{
stm32_gpio_enable_clock(adc->GPIOx);
LL_GPIO_InitTypeDef pinInit;
LL_GPIO_StructInit(&pinInit);
@@ -53,6 +56,7 @@ void ads79xx_init(const stm32_spi_adc_t* adc)
LL_GPIO_Init(adc->GPIOx, &pinInit);
auto SPIx = adc->SPIx;
stm32_spi_enable_clock(SPIx);
LL_SPI_DeInit(SPIx);
LL_SPI_InitTypeDef spiInit;