// // Created by cfif on 03.06.2024. // #ifndef SMART_COMPONENTS_SENSOR_H #define SMART_COMPONENTS_SENSOR_H #include "GpioPin.h" #include "SpiPorts.h" typedef struct { tGpioPin A; tGpioPin B; tGpioPin C; } tConABC; typedef struct { tConABC Con; tGpioPin En1; tGpioPin En2; tGpioPin En3; } tConn; typedef struct { tConn COON_A; tConn COON_B; tConn COON_C; tConn COON_D; tConn COON_E; tConn COON_F; } tConns; typedef struct { tConns *conns; tSpiPorts *spiPorts; } tSensorSPI; typedef enum { SENSOR_TYPE_A, SENSOR_TYPE_B, SENSOR_TYPE_C, SENSOR_TYPE_D, SENSOR_TYPE_E, SENSOR_TYPE_F } tSensorType; typedef enum { SENSOR_ADR_1 = 0, SENSOR_ADR_2 = 1, SENSOR_ADR_3 = 2, SENSOR_ADR_4 = 3, SENSOR_ADR_5 = 4, SENSOR_ADR_6 = 5, SENSOR_ADR_7 = 6, SENSOR_ADR_8 = 7, SENSOR_ADR_9 = 8, SENSOR_ADR_10 = 9, SENSOR_ADR_11 = 10, SENSOR_ADR_12 = 11, SENSOR_ADR_13 = 12, SENSOR_ADR_14 = 13, SENSOR_ADR_15 = 14, SENSOR_ADR_16 = 15, SENSOR_ADR_17 = 16, SENSOR_ADR_18 = 17, SENSOR_ADR_19 = 18, SENSOR_ADR_20 = 19 } tSensorAdr; void SensorSpi_Init(tSensorSPI *env, tSpiPorts *spiPorts, tConns *conns); bool setSpiSensor(tSensorSPI *env, tSensorType sensorType, tSensorAdr sensorAdr, uint16_t data); #endif //SMART_COMPONENTS_SENSOR_H