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