Init
This commit is contained in:
parent
70a78a02ae
commit
7758f89e60
|
|
@ -6,7 +6,7 @@
|
||||||
bool setSpiSensor(tSensorSPI *env, uint16_t reg) {
|
bool setSpiSensor(tSensorSPI *env, uint16_t reg) {
|
||||||
|
|
||||||
GpioPinSet(&env->conns->COON_A_B9_B10.En1, false);
|
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.A, false);
|
||||||
GpioPinSet(&env->conns->COON_A_B9_B10.Con.B, 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);
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,5 +30,6 @@ typedef struct {
|
||||||
} tSensorSPI;
|
} tSensorSPI;
|
||||||
|
|
||||||
void SensorSpi_Init(tSensorSPI *env, tSpiPorts *spiPorts, tConns *conns);
|
void SensorSpi_Init(tSensorSPI *env, tSpiPorts *spiPorts, tConns *conns);
|
||||||
|
bool setSpiSensor(tSensorSPI *env, uint16_t reg);
|
||||||
|
|
||||||
#endif //SMART_COMPONENTS_SENSOR_H
|
#endif //SMART_COMPONENTS_SENSOR_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue