diff options
| author | Avi Levkovich <avi@twine-s.com> | 2021-01-12 10:28:10 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2021-01-12 10:28:10 +0200 |
| commit | 38d2b46c7ca963a31ee43ae5bb1623dca2bc3e7c (patch) | |
| tree | d32a769242e70d0ec16bb31a800d24d90922e8d9 /Software/Embedded_SW/Embedded/Modules/General | |
| parent | 05c1491a79416934cd4e1c13a0972fe621f97056 (diff) | |
| parent | bfd323badd5c5039f49779e3a08452d203bf284e (diff) | |
| download | Tango-38d2b46c7ca963a31ee43ae5bb1623dca2bc3e7c.tar.gz Tango-38d2b46c7ca963a31ee43ae5bb1623dca2bc3e7c.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/General')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/General/BuiltInTest.c | 131 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/General/BuiltInTest.h | 15 |
2 files changed, 146 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/General/BuiltInTest.c b/Software/Embedded_SW/Embedded/Modules/General/BuiltInTest.c new file mode 100644 index 000000000..646f189e7 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Modules/General/BuiltInTest.c @@ -0,0 +1,131 @@ +/* + * BuiltInTest.c + * + * Created on: jAN 5 2021 + * Author: shlomo + * This file includes the BuiltInTest indication handling functions: + * Motors, heaters, temperature sensors,pressure sensors,dancers + */ + +#include "drivers/Motors/Motor.h" +#include "drivers/Heater/TemperatureSensor.h" +#include "drivers/FPGA/FPGA_SPI_Comm.h" +#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" +#include "drivers/FPGA/FPGA.h" +#include "drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.h" + +#include <PMR/Diagnostics/EventType.pb-c.h> + +#include "Modules/General/GeneralHardware.h" +#include "modules/control/control.h" +#include "modules/AlarmHandling/AlarmHandling.h" +#include "modules/thread/thread_ex.h" +#include "modules/heaters/heaters_ex.h" +#include "modules/ids/ids_ex.h" + +uint32_t BuiltInTestControlId; +uint32_t BuiltInTest_VoltageMeter(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_I2C_Comm(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_UART_Comm(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_Blower(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_Fan(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_Encoders(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_Heater(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_Dispenser(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_PressureSensor(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_PT_Sensor(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_Motor(uint32_t IfIndex) +{ + return OK; +} +uint32_t BuiltInTest_Main_State(uint32_t IfIndex, uint32_t BusyFlag) +{ + uint8_t Motor_i,Heater_i,PT_Sensor_i,Dispenser_i; + uint32_t Status = OK; + /* + * + *Test motors (configured, used(4x,arc,flat, btsr)), + *Test heaters (if cold, current) + *Test pt100, + *Test pressure sensors (dispensers, head, whs) + *Test ??? + One report on init, define a way to report multiple failures. + */ + BuiltInTest_VoltageMeter(0); + BuiltInTest_I2C_Comm(I2C2_BASE); + BuiltInTest_I2C_Comm(I2C3_BASE); + BuiltInTest_I2C_Comm(I2C4_BASE); + BuiltInTest_UART_Comm(0); + for (Motor_i = 0; Motor_i<NUM_OF_MOTORS;Motor_i++) + { + if (isMotorConfigured(Motor_i)) + { + Status |= BuiltInTest_Motor(Motor_i); + } + } + for (Heater_i = 0; Heater_i<HEATER_TYPE_MAX_HEATERS;Heater_i++) + { + //if (isHeaterConfigured(Heater_i)) + { + Status |= BuiltInTest_Heater(Heater_i); + } + } + for (PT_Sensor_i = 0; PT_Sensor_i<MAX_HEAD_CARD_TEMP_SENS_ID_1;PT_Sensor_i++) + { + //if (isHeaterConfigured(PT_Sensor_i)) + { + Status |= BuiltInTest_PT_Sensor(PT_Sensor_i); + } + } + for (Dispenser_i = 0; Dispenser_i<MAX_SYSTEM_DISPENSERS;Dispenser_i++) + { + //if (isDispenserConfigured(Dispenser_i)) + { + Status |= BuiltInTest_Dispenser(Dispenser_i); + } + } + //Status |= BuiltInTest_PressureSensor(HEAD_FLOW_METER); + //Status |= BuiltInTest_PressureSensor(NU_FLOW_METER); + //Status |= BuiltInTest_PressureSensor(DRIER_FLOW_METER); + //Status |= BuiltInTest_PressureSensor(TUNNEL_SENSOR_IN); + //Status |= BuiltInTest_PressureSensor(TUNNEL_SENSOR_OUT); + + //Test motors + return OK; +} +void BuiltInTest_Start(void) +{ + BuiltInTestControlId = AddControlCallback("BuiltInTest", BuiltInTest_Main_State, eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); + //return; +} + diff --git a/Software/Embedded_SW/Embedded/Modules/General/BuiltInTest.h b/Software/Embedded_SW/Embedded/Modules/General/BuiltInTest.h new file mode 100644 index 000000000..02c427c67 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Modules/General/BuiltInTest.h @@ -0,0 +1,15 @@ +/* + * BuiltInTest.h + * + * Created on: Jan 4 2021 + * Author: shlomo + */ + +#ifndef MODULES_GENERAL_BUILT_IN_TEST_H_ +#define MODULES_GENERAL_BUILT_IN_TEST_H_ + + +void BuiltInTest_Start(void); + + +#endif /* MODULES_GENERAL_SAFETY_H_ */ |
