From 7758f89e606f1eb6a4bfbf5cf8a89b398a7942ff Mon Sep 17 00:00:00 2001 From: cfif Date: Mon, 30 Mar 2026 17:24:55 +0300 Subject: [PATCH] Init --- SensorSPI.c | 5 ++++- SensorSPI.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SensorSPI.c b/SensorSPI.c index e557582..04b328e 100644 --- a/SensorSPI.c +++ b/SensorSPI.c @@ -6,7 +6,7 @@ bool setSpiSensor(tSensorSPI *env, uint16_t reg) { GpioPinSet(&env->conns->COON_A_B9_B10.En1, false); - GpioPinSet(&env->conns->COON_A_B9_B10.En1, true); + GpioPinSet(&env->conns->COON_A_B9_B10.En2, true); GpioPinSet(&env->conns->COON_A_B9_B10.Con.A, false); GpioPinSet(&env->conns->COON_A_B9_B10.Con.B, false); @@ -14,6 +14,9 @@ bool setSpiSensor(tSensorSPI *env, uint16_t reg) { bool result = SpiPortTransmit(&env->spiPorts->Spi1_IO, ®, 1000); + GpioPinSet(&env->conns->COON_A_B9_B10.En1, true); + GpioPinSet(&env->conns->COON_A_B9_B10.En2, true); + return result; } diff --git a/SensorSPI.h b/SensorSPI.h index 2f3dcef..d121e3f 100644 --- a/SensorSPI.h +++ b/SensorSPI.h @@ -30,5 +30,6 @@ typedef struct { } tSensorSPI; void SensorSpi_Init(tSensorSPI *env, tSpiPorts *spiPorts, tConns *conns); +bool setSpiSensor(tSensorSPI *env, uint16_t reg); #endif //SMART_COMPONENTS_SENSOR_H