Init
This commit is contained in:
parent
70a78a02ae
commit
7758f89e60
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue