diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-11 13:59:52 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-11 13:59:52 +0200 |
| commit | 4568cd0ed72a7e4c38d54a3820652e761e3510bc (patch) | |
| tree | 075f728f6f5ad38caee24ceb1cc0c7aaf1821b0c /Software | |
| parent | c96ecaf239db6d1270958841e2efd9fba3360c6e (diff) | |
| parent | 5fa5212d329651dfed37575e8bd942e974030083 (diff) | |
| download | Tango-4568cd0ed72a7e4c38d54a3820652e761e3510bc.tar.gz Tango-4568cd0ed72a7e4c38d54a3820652e761e3510bc.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software')
5 files changed, 68 insertions, 32 deletions
diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index 60a6dfe12..0027a2aa1 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -244,16 +244,21 @@ typedef enum }CARTREGE; */ -typedef struct + +typedef union { - bool DRAWER_BIG; //bit 0 - bool DRAWER_SMALL0;//bit 1 - bool DRAWER_SMALL1;//bit 2 - bool DRAWER_SMALL2;//bit 3 - bool DRAWER_SMALL3;//bit 4 - bool SYSTEM_FAN0; //bit 5 - bool SYSTEM_FAN1; //bit 6 - bool SYSTEM_FAN2; //bit 7 + struct + { + uint8_t DRAWER_BIG:1; //bit 0 + uint8_t DRAWER_SMALL0:1;//bit 1 + uint8_t DRAWER_SMALL1:1;//bit 2 + uint8_t DRAWER_SMALL2:1;//bit 3 + uint8_t DRAWER_SMALL3:1;//bit 4 + uint8_t SYSTEM_FAN0:1; //bit 5 + uint8_t SYSTEM_FAN1:1; //bit 6 + uint8_t SYSTEM_FAN2:1; //bit 7 + }bit; + uint8_t Uchar; }FANS_STATUS; enum diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c index 454e82c28..0b98891c5 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c @@ -195,7 +195,7 @@ uint32_t Calculate_Tacho_Fan_Speed(uint32_t OSC_IN, uint8_t PPR, uint16_t Presca uint32_t Fans_Speed_RPM[MAX_FANS]; -FANS_STATUS Read_Fans_Tacho() +uint8_t Read_Fans_Tacho() { FANS_STATUS Fans_Status; @@ -212,9 +212,9 @@ FANS_STATUS Read_Fans_Tacho() Fans_Speed_RPM[SYSTEM_2] = Calculate_Tacho_Fan_Speed(29166666, 0X02, F1_Prescaler1_reg5, F1_Tacho_reg7); if( Fans_Speed_RPM[DRAWER_B] < 1000 ) // need to work around 3000 RPM - Fans_Status.DRAWER_BIG = ERROR;// not working / Low Speed + Fans_Status.bit.DRAWER_BIG = ERROR;// not working / Low Speed else - Fans_Status.DRAWER_BIG = OK;//working (Speed ~0x400) + Fans_Status.bit.DRAWER_BIG = OK;//working (Speed ~0x400) // The 4 small Fans in the drawer // F1_gpi_FANS @@ -222,10 +222,10 @@ FANS_STATUS Read_Fans_Tacho() // “1” Fan working if (F1_gpi_FANS == 0x0F ) { - Fans_Status.DRAWER_SMALL0 = OK;//working - Fans_Status.DRAWER_SMALL1 = OK;//working - Fans_Status.DRAWER_SMALL2 = OK;//working - Fans_Status.DRAWER_SMALL3 = OK;//working + Fans_Status.bit.DRAWER_SMALL0 = OK;//working + Fans_Status.bit.DRAWER_SMALL1 = OK;//working + Fans_Status.bit.DRAWER_SMALL2 = OK;//working + Fans_Status.bit.DRAWER_SMALL3 = OK;//working } else { @@ -236,70 +236,70 @@ FANS_STATUS Read_Fans_Tacho() if(( Fans_Speed_RPM[DRAWER_S0] < 3000 ) && ( F1_FAN1_TACH == 0)) // need to work around 5000 RPM { - Fans_Status.DRAWER_SMALL0 = ERROR;/// not working / Low Speed + Fans_Status.bit.DRAWER_SMALL0 = ERROR;/// not working / Low Speed } else { - Fans_Status.DRAWER_SMALL0 = OK;//working (Speed ~0x400) + Fans_Status.bit.DRAWER_SMALL0 = OK;//working (Speed ~0x400) } if(( Fans_Speed_RPM[DRAWER_S1] < 3000 ) && ( F1_FAN2_TACH == 0)) // Small Fan in the drawer // need to work around 5000 RPM { - Fans_Status.DRAWER_SMALL1 = ERROR;// not working / Low Speed + Fans_Status.bit.DRAWER_SMALL1 = ERROR;// not working / Low Speed } else { - Fans_Status.DRAWER_SMALL1 = OK;//working (Speed ~0x400) + Fans_Status.bit.DRAWER_SMALL1 = OK;//working (Speed ~0x400) } if(( Fans_Speed_RPM[DRAWER_S2] < 3000 ) && ( F1_FAN3_TACH == 0)) // Small Fan in the drawer // need to work around 5000 RPM { - Fans_Status.DRAWER_SMALL2 = ERROR;// not working / Low Speed + Fans_Status.bit.DRAWER_SMALL2 = ERROR;// not working / Low Speed } else { - Fans_Status.DRAWER_SMALL2 = OK;//working (Speed ~0x400) + Fans_Status.bit.DRAWER_SMALL2 = OK;//working (Speed ~0x400) } if(( Fans_Speed_RPM[DRAWER_S3] < 3000 ) && ( F1_FAN4_TACH == 0)) // Small Fan in the drawer // need to work around 3050 RPM { - Fans_Status.DRAWER_SMALL3 = ERROR;// not working / Low Speed + Fans_Status.bit.DRAWER_SMALL3 = ERROR;// not working / Low Speed } else { - Fans_Status.DRAWER_SMALL3 = OK;//working (Speed ~0x400) < 1000 ) // need to work around 5000 RPM + Fans_Status.bit.DRAWER_SMALL3 = OK;//working (Speed ~0x400) < 1000 ) // need to work around 5000 RPM } } if( Fans_Speed_RPM[SYSTEM_0] < 1000 ) // need to work around 3050 RPM { - Fans_Status.SYSTEM_FAN0 = ERROR;// not working / Low Speed + Fans_Status.bit.SYSTEM_FAN0 = ERROR;// not working / Low Speed } else { - Fans_Status.SYSTEM_FAN0 = OK;//working (Speed ~0x400) + Fans_Status.bit.SYSTEM_FAN0 = OK;//working (Speed ~0x400) } if( Fans_Speed_RPM[SYSTEM_1] < 1000 ) // need to work around 3050 RPM { - Fans_Status.SYSTEM_FAN1 = ERROR;// not working / Low Speed + Fans_Status.bit.SYSTEM_FAN1 = ERROR;// not working / Low Speed } else { - Fans_Status.SYSTEM_FAN1 = OK;//working (Speed ~0x400) + Fans_Status.bit.SYSTEM_FAN1 = OK;//working (Speed ~0x400) } if( Fans_Speed_RPM[SYSTEM_2] < 1000 ) // need to work around 3050 RPM { - Fans_Status.SYSTEM_FAN2 = ERROR;// not working / Low Speed + Fans_Status.bit.SYSTEM_FAN2 = ERROR;// not working / Low Speed } else { - Fans_Status.SYSTEM_FAN2 = OK;//working (Speed ~0x400) + Fans_Status.bit.SYSTEM_FAN2 = OK;//working (Speed ~0x400) } #endif - return Fans_Status; + return Fans_Status.Uchar; } //------------------------- WHS ---------------------- diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h index 93e0046b6..1c2bbfb1a 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h @@ -6,7 +6,7 @@ int FPGA_Test_ReadBack(unsigned char FPGA_NUM, unsigned short Value, unsigned sh int FPGA_ReadVersion(unsigned char FPGA_NUM, unsigned char *Version, unsigned char *Year, unsigned char *Month, unsigned char *Day); void FPGA_Init(); //void FPGA_Read_limit_Switches(void); -uint32_t Read_Fans_Tacho(); +uint8_t Read_Fans_Tacho(); //uint32_t WHS_Read_Blower_Tach(); diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.c new file mode 100644 index 000000000..4eb388d39 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.c @@ -0,0 +1,10 @@ +/* + * IO.c + * + * Created on: Mar 11, 2019 + * Author: avi + */ + + + + diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.h new file mode 100644 index 000000000..5f79c7bcd --- /dev/null +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.h @@ -0,0 +1,21 @@ +/* + * IO.h + * + * Created on: Mar 11, 2019 + * Author: avi + * + */ + + + + +#ifndef DRIVERS_I2C_COMMUNICATION_DISPENSERS_IO_PORT_IO_H_ +#define DRIVERS_I2C_COMMUNICATION_DISPENSERS_IO_PORT_IO_H_ + + /*===============================================================================================================* + I2C ADDRESS + *===============================================================================================================*/ + + + +#endif /* DRIVERS_I2C_COMMUNICATION_DISPENSERS_IO_PORT_IO_H_ */ |
