Init
This commit is contained in:
parent
fc93dbfc10
commit
0f3b615fc7
16
SensorSPI.c
16
SensorSPI.c
|
|
@ -261,6 +261,22 @@ bool setSpiSensor(tSensorSPI *env, tSensorType sensorType, tSensorAdr sensorAdr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case SENSOR_TYPE_C: {
|
||||||
|
|
||||||
|
GpioPinSet(&env->conns->COON_C.En1, false); // CS En1
|
||||||
|
|
||||||
|
setSensorTypeAdr(env, &env->conns->COON_C.Con, sensorAdr);
|
||||||
|
|
||||||
|
Delay(DelayCn);
|
||||||
|
bool result = SpiPortTransmit(&env->spiPorts->Spi2_IO, &data, 1000);
|
||||||
|
Delay(DelayCn);
|
||||||
|
|
||||||
|
GpioPinSet(&env->conns->COON_C.En1, true);
|
||||||
|
|
||||||
|
Delay(DelayCn);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue