From 49815e78ea919480437a58eb152ad36fc88fba8d Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Tue, 12 Feb 2019 11:21:31 +0200 Subject: WHS - minor changes --- Software/Embedded_SW/Embedded/DataDef.h | 2 +- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 20 ++++++++++---------- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h | 4 +++- .../Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 16 ++++++++++++++++ .../Embedded/Drivers/FPGA/FPGA_SPI_Comm.h | 1 + Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c | 15 --------------- 6 files changed, 31 insertions(+), 27 deletions(-) (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index 041240264..1b3552be0 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -210,7 +210,7 @@ typedef enum POWER_ON_OFF, THREAD_JOGGING , THREAD_LOAD , -}PANEL_BUTTONS_LEDS_ID; +}PANEL_BUTTON_OR_CRAT_ID; typedef enum { diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c index 49b1ce649..aacd12940 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c @@ -552,7 +552,7 @@ bool WHS_GPI_CHILLER_FAULT() return F2_GPI_Reg.bits.F2_GPI_CHILLER_FAULT; } -bool WHS_GPI_WASTE_OVERFULL() +bool WHS_GPI_WASTE_OVERFULL()//waste tank overflow { return F2_GPI_Reg.bits.F2_WASTE_OVERFULL_NO; } @@ -562,12 +562,12 @@ bool WHS_GPI_SW_FILTER_PRES() return F3_GPI_01_Reg.bits.F3_GPI_SW_FILTER_PRES; } -bool WHS_GPI_WCONTAINER_FULL() +bool WHS_GPI_WCONTAINER_FULL()//waste tank full { return F3_GPI_01_Reg.bits.F3_GPI_WCONTAINER_FULL; } -bool WHS_GPI_WCONTAINER_WARN() +bool WHS_GPI_WCONTAINER_WARN()//waste tank empty { return F3_GPI_01_Reg.bits.F3_GPI_WCONTAINER_WARN; } @@ -720,7 +720,7 @@ uint8_t Cartridges_LEDS(CARTREGE Cartridge, OPERATION_MODE LED_Mode) // CART1_LA return Status; } */ -uint8_t Pannel_Leds(PANEL_BUTTONS_LEDS_ID Pannel_Led_Id, OPERATION_MODE LED_Mode) +uint8_t Pannel_Leds(PANEL_BUTTON_OR_CRAT_ID Pannel_Led_Id, OPERATION_MODE LED_Mode) { uint8_t Status = OK; @@ -798,20 +798,20 @@ uint8_t Init_Machine_Leds() } -bool Read_Cartridge_Button(PANEL_BUTTONS_LEDS_ID Cartridge)//TODO Update the polarity!!! +bool Is_Cartridge_Present(PANEL_BUTTON_OR_CRAT_ID Cartridge)//TODO Update the polarity!!! { - bool IsCartPressed = false; + bool IsCartPresent = false; if((Cartridge == CART_1) && (F3_CARTx_PRES_02_Direct & BIT7)) - IsCartPressed = true; + IsCartPresent = true; else if((Cartridge == CART_2) && (F3_CARTx_PRES_02_Direct & BIT6)) - IsCartPressed = true; + IsCartPresent = true; else if((Cartridge == CART_3) && (F3_CARTx_PRES_02_Direct & BIT5)) - IsCartPressed = true; + IsCartPresent = true; - return IsCartPressed; + return IsCartPresent; } uint32_t Control_Dryer_Fan(bool StartStop, uint8_t PWM_Command_Precent)//use START or STOP, 0 - 100% diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h index 1def86036..b7d2ce549 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h @@ -234,7 +234,9 @@ uint32_t Control_Dryer_Fan(bool StartStop, uint8_t PWM_Command_Precent); bool Check_Disp_Sfaty_Stop_Indication(uint8_t Dispenser_ID); bool Emergency_Push_Button_Report(); bool Dryer_Door_Switch(); -uint8_t Pannel_Leds(PANEL_BUTTONS_LEDS_ID Pannel_Led_Id, OPERATION_MODE LED_Mode); +uint8_t Pannel_Leds(PANEL_BUTTON_OR_CRAT_ID Pannel_Led_Id, OPERATION_MODE LED_Mode); uint8_t Init_Machine_Leds(); +bool Is_Cartridge_Present(PANEL_BUTTON_OR_CRAT_ID Cartridge); + #endif /* DRIVERS_FPGA_FPGA_GPIO_FPGA_GPIO_H_ */ diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index f2026b611..5abd0b69b 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -749,6 +749,22 @@ void FPGA_SetMotMaxSpeed(TimerMotors_t _motorId)//Mov MillisecWriteToMotor(_motorId, temp, 4, NULL); } +void FPGA_SetGoToPosition(TimerMotors_t _motorId)//GoTo +{ + uint32_t temp; + + temp = x_GOTO; + temp = temp << 24; + + if (MotorDriverRequest[_motorId].Position > 0x3FFFFF) //TODO to check if it is needed here + MotorDriverRequest[_motorId].Position = 0x3FFFFF; + + temp |= MotorDriverRequest[_motorId].Position; + Fpga_Spi[_motorId].TX_MOSI = temp; + + MillisecWriteToMotor(_motorId, temp, 4, NULL); + +} void FPGA_SetMotMicroStep(TimerMotors_t _motorId)// { diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h index e3ea0babe..cc9d85cca 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h @@ -34,5 +34,6 @@ int SPISendFPGARequest(TEMPERATURE_SENSOR_ID_ENUM SensorId,uint32_t Data, uint32 int SPIGetFPGAResponse(TEMPERATURE_SENSOR_ID_ENUM SensorId,uint32_t *Data); void FPGA_SetMotHome(TimerMotors_t _motorId); extern SPI Fpga_Spi[NUM_OF_MOTORS]; +void FPGA_SetGoToPosition(TimerMotors_t _motorId);//GoTo diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c index 5fc5b71a4..d416caf0e 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c @@ -352,22 +352,7 @@ uint32_t MotorSetMicroStep(TimerMotors_t _motorId, uint32_t microstep) return OK; } -void FPGA_SetGoToPosition(TimerMotors_t _motorId)//GoTo -{ - uint32_t temp; - - temp = x_GOTO; - temp = temp << 24; - - if (MotorDriverRequest[_motorId].Position > 0x3FFFFF) //TODO to check if it is needed here - MotorDriverRequest[_motorId].Position = 0x3FFFFF; - temp |= MotorDriverRequest[_motorId].Position; - Fpga_Spi[_motorId].TX_MOSI = temp; - - MillisecWriteToMotor(_motorId, temp, 4, NULL); - -} uint32_t MotorMove(TimerMotors_t _motorId,bool direction, uint32_t Steps) { -- cgit v1.3.1 From c601ade532078ac38a6333bfae49892be4c99519 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 12 Feb 2019 14:44:31 +0200 Subject: update motor goto stub and control --- .../Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 19 +++++++++++++++++++ .../Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h | 1 + Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c | 15 --------------- .../Embedded/Modules/Stubs_Handler/Stub_Motor.c | 2 +- 4 files changed, 21 insertions(+), 16 deletions(-) (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index f2026b611..594b3d1a4 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -803,6 +803,25 @@ void FPGA_SetMotMicroStep(TimerMotors_t _motorId)// } } + +void FPGA_SetGoToPosition(TimerMotors_t _motorId)//GoTo +{ + uint32_t temp; + + temp = x_GOTO; + temp = temp << 24; + + if (MotorDriverRequest[_motorId].Position > 0x3FFFFF) //TODO to check if it is needed here + MotorDriverRequest[_motorId].Position = 0x3FFFFF; + + temp |= (MotorDriverRequest[_motorId].Position);; + Fpga_Spi[_motorId].TX_MOSI = temp; + + //MillisecWriteToMotor(_motorId, temp, 4, NULL); + FPGA_SPI_Transnit(_motorId); + +} + void FPGA_SetMotPosition(TimerMotors_t _motorId)//Mov { uint32_t temp; diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h index e3ea0babe..cc9d85cca 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h @@ -34,5 +34,6 @@ int SPISendFPGARequest(TEMPERATURE_SENSOR_ID_ENUM SensorId,uint32_t Data, uint32 int SPIGetFPGAResponse(TEMPERATURE_SENSOR_ID_ENUM SensorId,uint32_t *Data); void FPGA_SetMotHome(TimerMotors_t _motorId); extern SPI Fpga_Spi[NUM_OF_MOTORS]; +void FPGA_SetGoToPosition(TimerMotors_t _motorId);//GoTo diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c index 5fc5b71a4..d416caf0e 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c @@ -352,22 +352,7 @@ uint32_t MotorSetMicroStep(TimerMotors_t _motorId, uint32_t microstep) return OK; } -void FPGA_SetGoToPosition(TimerMotors_t _motorId)//GoTo -{ - uint32_t temp; - - temp = x_GOTO; - temp = temp << 24; - - if (MotorDriverRequest[_motorId].Position > 0x3FFFFF) //TODO to check if it is needed here - MotorDriverRequest[_motorId].Position = 0x3FFFFF; - temp |= MotorDriverRequest[_motorId].Position; - Fpga_Spi[_motorId].TX_MOSI = temp; - - MillisecWriteToMotor(_motorId, temp, 4, NULL); - -} uint32_t MotorMove(TimerMotors_t _motorId,bool direction, uint32_t Steps) { diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c index 319f85454..65ede8fac 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c @@ -539,7 +539,7 @@ void Stub_MotorMovRequest(MessageContainer* requestContainer) #else TimerMotors_t Motor_Id = (TimerMotors_t)request->motor_id; //to remove warning - MotorMove(Motor_Id, Direction, Pos_Value ); + if(GoTo_Flag) { MotorGoTo(Motor_Id, Pos_Value ); -- cgit v1.3.1 From b9fd29334f8a95099c70e714c2462c5ddd6ca2b9 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Wed, 13 Feb 2019 08:47:19 +0200 Subject: remove duplicate function --- .../Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index 79bab7157..4782edc87 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -749,22 +749,22 @@ void FPGA_SetMotMaxSpeed(TimerMotors_t _motorId)//Mov MillisecWriteToMotor(_motorId, temp, 4, NULL); } -void FPGA_SetGoToPosition(TimerMotors_t _motorId)//GoTo -{ - uint32_t temp; - - temp = x_GOTO; - temp = temp << 24; - - if (MotorDriverRequest[_motorId].Position > 0x3FFFFF) //TODO to check if it is needed here - MotorDriverRequest[_motorId].Position = 0x3FFFFF; - - temp |= MotorDriverRequest[_motorId].Position; - Fpga_Spi[_motorId].TX_MOSI = temp; - - MillisecWriteToMotor(_motorId, temp, 4, NULL); - -} +//void FPGA_SetGoToPosition(TimerMotors_t _motorId)//GoTo +//{ +// uint32_t temp; +// +// temp = x_GOTO; +// temp = temp << 24; +// +// if (MotorDriverRequest[_motorId].Position > 0x3FFFFF) //TODO to check if it is needed here +// MotorDriverRequest[_motorId].Position = 0x3FFFFF; +// +// temp |= MotorDriverRequest[_motorId].Position; +// Fpga_Spi[_motorId].TX_MOSI = temp; +// +// MillisecWriteToMotor(_motorId, temp, 4, NULL); +// +//} void FPGA_SetMotMicroStep(TimerMotors_t _motorId)// { -- cgit v1.3.1 From 61f032b6de194c885ff76b0e0f550d0527790c33 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Wed, 13 Feb 2019 09:23:33 +0200 Subject: Mapping the Array AlarmItem to ALARM_MAP_IN_FLASH --- .../Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 518100ae0..b9cfe38d5 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -48,7 +48,7 @@ #include "drivers/FPGA/Moters_Driver/L6470.h" #include "drivers/Motors/Motor.h" #include "drivers/Heater/TemperatureSensor.h" - +#include "drivers/Flash_ram/FlashProgram.h" Task_Handle AlarmHandling_Task_Handle; Mailbox_Handle AlarmHandlingMsgQ = NULL; @@ -114,7 +114,13 @@ typedef struct }AlarmStatusItem; AlarmStatusItem AlarmState[MAX_SYSTEM_ALARMS]; -const AlarmHandlingItemStruc AlarmItem[MAX_SYSTEM_ALARMS]={ +#define FLASH_MAP _Pragma("location = MOTOR_MAP_IN_FLASH") +/* +* Use this pragma directive to specify the location—the absolute address—of the global +* or static variable whose declaration follows the pragma directive (only if using it without #define for example: #pragma location = MOTOR_MAP_IN_FLASH) +* The variables must be declared either __no_init or const! +*/ +FLASH_MAP const AlarmHandlingItemStruc AlarmItem[MAX_SYSTEM_ALARMS]={ {eHundredMillisecond,LimitSwitchAlarm,LimitSwitchAlarmEmpty_1,0,false,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,EVENT_TYPE__DISPENSER_1_EMPTY,"Dispenser 1 Empty"}, {eHundredMillisecond,LimitSwitchAlarm,LimitSwitchAlarmEmpty_2,1,false,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,EVENT_TYPE__DISPENSER_2_EMPTY,"Dispenser 2 Empty"}, {eHundredMillisecond,LimitSwitchAlarm,LimitSwitchAlarmEmpty_3,2,false,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,EVENT_TYPE__DISPENSER_3_EMPTY,"Dispenser 3 Empty"}, -- cgit v1.3.1 From c38d74c14e0354d4e0c882ae3dcca74919bf3599 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 13 Feb 2019 11:21:44 +0000 Subject: Updated IDS_print.c - bug fix in ids presegment --- Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 5ee8a150d..9dd2822d6 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -319,9 +319,9 @@ uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId) DispenserPreSegmentReady[DispenserId] = false; REPORT_MSG(DispenserId,"IDS_Valve_Presegment start"); IDS_Dispenser_Set_Flow_Params(DispenserId,0,0); - if (JobTicket->segments[DispenserId]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision != DISPENSER_STEP_DIVISION__Auto) + if (JobTicket->segments[SegmentId]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision != DISPENSER_STEP_DIVISION__Auto) { - MotorSetMicroStep(HW_Motor_Id, JobTicket->segments[DispenserId]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision); + MotorSetMicroStep(HW_Motor_Id, JobTicket->segments[SegmentId]->brushstops[JobBrushStopId]->dispensers[Dispenser_i]->dispenserstepdivision); } else { -- cgit v1.3.1 From 00d7aacc1a57a4ee7b5c96b4531eae1e444dae7f Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Wed, 13 Feb 2019 17:01:56 +0200 Subject: Start NFC I2c --- .../Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h | 16 +++++ .../I2C_Communication/RFID_NFC/NFC_I2C/NFC_I2C.c | 74 ++++++++++++++++++++++ .../I2C_Communication/RFID_NFC/PN7150/PN7150.c | 38 +++++++++++ .../I2C_Communication/RFID_NFC/PN7150/PN7150.h | 15 +++++ 4 files changed, 143 insertions(+) create mode 100644 Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC_I2C/NFC_I2C.c create mode 100644 Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.c create mode 100644 Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.h (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h index 942846679..1196356a7 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h @@ -1601,6 +1601,22 @@ typedef union }bits; unsigned short ushort; }F3_GPI_01; + +//F1_GPO_02_bus +typedef union +{ + struct + { + bool F1_CART1_RST : 1; //0 F1_FAN1_PWMCTRL + bool F1_CART2_RST : 1; //1 F1_FAN2_PWMCTRL + bool F1_CART3_RST : 1; //2 F1_FAN3_PWMCTRL + bool F1_FAN4_PWMCTRL : 1; //3 + bool F1_FAN5_PWMCTRL : 1; //4 + unsigned short RESERVE :11; //5-15 + }bits; + unsigned short ushort; +}F1_GPO_REG2; + // ---------------------------------- //L6470_MOSI = 0x00; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC_I2C/NFC_I2C.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC_I2C/NFC_I2C.c new file mode 100644 index 000000000..dddd0b4e2 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/NFC_I2C/NFC_I2C.c @@ -0,0 +1,74 @@ +/* + * NFC_I2C.c + * + * Created on: Feb 13, 2019 + * Author: avi + */ +#include +#include +#include +#include + + + +uint32_t I2C_NFC_Config(uint32_t I2C_Slave_Add,uint32_t channel ) +{ + uint32_t Status = OK; + + const uint32_t MUX_I2C_BASE = 4; + + uint8_t NFC_Config_Buf[3]; + + NFC_Config_Buf[0] = 0x00; + NFC_Config_Buf[1] = channel; + NFC_Config_Buf[2] = 0x80; + + Status = I2C_Write(MUX_I2C_BASE, I2C_Slave_Add, NFC_Config_Buf, 3); + + return Status; +} + +uint32_t Enable_I2C_NFC_Channel(PANEL_BUTTON_OR_CRAT_ID Cart_ID) +{ + uint32_t Status = OK; + + const uint32_t I2C_Slave_Add = 0xE0; + uint32_t Channel; + + Channel = 0x01 << (Cart_ID - 1); + + Status = I2C_NFC_Config(I2C_Slave_Add, Channel); + + return Status; +} + + +uint32_t I2C_NFC_Set_For_Read_Ch(uint32_t I2C_Slave_Add ) +{ + uint32_t Status = OK; + + const uint32_t MUX_I2C_BASE = 4; + const uint8_t SetRead = 0x01; + + Status = I2C_Write(MUX_I2C_BASE, I2C_Slave_Add, &SetRead, 1); + + return Status; +} +/* +static uint8_t I2C_Read_buf[2] = {0,0}; + +uint32_t I2C_ADC_Read_Ch(uint32_t I2C_Slave_Add ) +{ + uint32_t VsampleInBits = 0,temp; + + uint8_t No_BytesToRead = 2; + + I2C_Read(MUX_I2C_BASE, I2C_Slave_Add, I2C_Read_buf, No_BytesToRead ); + + temp = (I2C_Read_buf[0] << 8) | I2C_Read_buf[1]; + + VsampleInBits=temp & 0x0fff; + + return VsampleInBits; +} +*/ diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.c new file mode 100644 index 000000000..afb151a61 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.c @@ -0,0 +1,38 @@ +/* + * PN7150.c + * + * Created on: Feb 13, 2019 + * Author: avi + */ + +#include +#include +#include +#include "include.h" +#include "drivers/FPGA/FPGA_Comm.h" + +#define NFC_HARDWARE_RESET 0x01 + +F1_GPO_REG2 Reset_NFC; + +void Reset_NFC_Device(PANEL_BUTTON_OR_CRAT_ID Cart_ID)//reset pin. Set the device in Hard Power Down +{ + assert (Cart_ID<=CART_3); + + switch(Cart_ID) + { + case CART_1: + Reset_NFC.bits.F1_CART1_RST = NFC_HARDWARE_RESET; + break; + case CART_2: + Reset_NFC.bits.F1_CART2_RST = NFC_HARDWARE_RESET; + break; + case CART_3: + Reset_NFC.bits.F1_CART3_RST = NFC_HARDWARE_RESET; + break; + default: + break; + } + + F1_GPO_02_bus = Reset_NFC.ushort; +} diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.h new file mode 100644 index 000000000..61c3beb31 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/PN7150/PN7150.h @@ -0,0 +1,15 @@ +/* + * PN7150.h + * + * Created on: Feb 13, 2019 + * Author: avi + */ + +#ifndef DRIVERS_RFID_NFC_PN7150_PN7150_H_ +#define DRIVERS_RFID_NFC_PN7150_PN7150_H_ + +void Reset_NFC_Device(PANEL_BUTTON_OR_CRAT_ID Cart_ID); + + + +#endif /* DRIVERS_RFID_NFC_PN7150_PN7150_H_ */ -- cgit v1.3.1 From 36a592cec6ef4c8234aa067138465c9e354fcefd Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 13 Feb 2019 15:08:27 +0000 Subject: Updated Heaters_print.c improve spike printing --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 50b4658c1..f45c7f216 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -540,7 +540,7 @@ uint32_t HeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) } if (abs(readValue - HeaterPreviousRead[index])>2000) { - Report("Temperature Spike",__FILE__,__LINE__,HeaterPreviousRead[index],RpWarning,readValue, index); + Report("Temperature Spike",__FILE__,index,HeaterPreviousRead[index],RpWarning,readValue, index); return ERROR; } HeaterPreviousRead[index] = readValue; @@ -689,7 +689,7 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) } if (abs(readValue - HeaterPreviousRead[index])>2000) { - Report("Temperature Spike",__FILE__,__LINE__,HeaterPreviousRead[index],RpWarning,readValue, index); + Report("Temperature Spike",__FILE__,index,HeaterPreviousRead[index],RpWarning,readValue, index); return ERROR; } HeaterPreviousRead[index] = readValue; @@ -808,7 +808,7 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) } if (abs(readValue - HeaterPreviousRead[index])>2000) { - Report("Temperature Spike",__FILE__,__LINE__,HeaterPreviousRead[index],RpWarning,readValue, index); + Report("Temperature Spike",__FILE__,index,HeaterPreviousRead[index],RpWarning,readValue, index); return ERROR; } HeaterPreviousRead[index] = readValue; -- cgit v1.3.1 From b70e0d83227c075f29ceec5ebaf4cfbc34554d79 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 13 Feb 2019 15:16:28 +0000 Subject: Updated Heaters_print.c log initial prev heaters read --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index f45c7f216..a2bda1f65 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -437,6 +437,7 @@ uint32_t PrepareHeater(int HeaterId, uint32_t SetTemperatue) //DCInitialHeating[HeaterId] = true; HeaterReady[HeaterId] = false; HeaterPreviousRead[HeaterId] = TemperatureSensorRead(HeaterId2PT100Id[HeaterId]); + Report("PrepareHeater Read", __FILE__,__LINE__,HeaterId, SetTemperatue, HeaterPreviousRead[HeaterId], 0); if (ControlIdtoMaxHeaterId [HeaterId] == 0xFF) ControlIdtoMaxHeaterId [HeaterId] = AddControlCallback( DcHeaterMaxTempCBFunction, eOneSecond,TemperatureSensorRead,(IfTypeHeaters*0x100+HeaterId),HeaterId2PT100Id[HeaterId],0); @@ -447,6 +448,7 @@ uint32_t PrepareHeater(int HeaterId, uint32_t SetTemperatue) { ControlIdtoHeaterId [HeaterId] = AddControlCallback( HeaterControlCBFunction, Frequency/*eOneSecond*/,TemperatureSensorRead,(IfTypeHeaters*0x100+HeaterId),DryerInternalPT100Id,0); HeaterPreviousRead[HeaterId] = TemperatureSensorRead(DryerInternalPT100Id); + Report("PrepareHeater Read", __FILE__,__LINE__,HeaterId, SetTemperatue, HeaterPreviousRead[HeaterId], 0); HeaterPreviousRead[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain] = TemperatureSensorRead(HeaterId2PT100Id[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain]); HeaterPreviousRead[HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary] = TemperatureSensorRead(HeaterId2PT100Id[HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary]); } -- cgit v1.3.1 From a42f2ebe0053a912ac8c14fd05831b8fae8e0506 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 14 Feb 2019 11:02:28 +0200 Subject: version 1.3.7.1: cancel cone presence checks, load dancer middle point from file, tech board support for drier head, --- Software/Embedded_SW/Embedded/.cproject | 2 +- .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- Software/Embedded_SW/Embedded/DataDef.h | 7 +- .../Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 19 -- .../Embedded_SW/Embedded/Drivers/Motors/Motor.h | 2 +- .../Embedded/Drivers/Motors/MotorActions.c | 7 +- Software/Embedded_SW/Embedded/Main.c | 11 +- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 59 +++--- .../Embedded_SW/Embedded/Modules/Control/control.h | 4 +- .../Modules/Diagnostics/DiagnosticActions.c | 1 + .../Embedded/Modules/Diagnostics/Diagnostics.c | 4 +- .../Modules/Diagnostics/DiagnosticsHoming.c | 26 ++- .../Embedded/Modules/General/GeneralHardware.c | 11 +- .../Embedded/Modules/Heaters/Heaters_print.c | 20 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 2 + .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 4 +- .../Embedded/Modules/Thread/ThreadLoad.c | 23 ++- .../Embedded/Modules/Thread/Thread_Winder.c | 5 +- .../StateMachines/Initialization/InitSequence.c | 207 +++++++++++++++++++++ .../StateMachines/Initialization/InitSequence.h | 16 ++ .../PMR/Messages/Debugging/DebugLogCategory.proto | 2 +- .../stubs/ProcessParametersBuild.cs | 45 +++++ 22 files changed, 390 insertions(+), 89 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c create mode 100644 Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h create mode 100644 Software/Stubs Collection/stubs/ProcessParametersBuild.cs (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/.cproject b/Software/Embedded_SW/Embedded/.cproject index d1abfd6c1..7e5ec8096 100644 --- a/Software/Embedded_SW/Embedded/.cproject +++ b/Software/Embedded_SW/Embedded/.cproject @@ -14,7 +14,7 @@ - + - +