global_header.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* Description */
  2. /* Module Name : vardef_hw.h */
  3. /* Process : VehSim */
  4. /* Specification : */
  5. /* Ino.100C0 */
  6. /* revision Revision: 1.0.0 */
  7. /* Last change made by Author: NG-Tiofack Kegne, Max Well */
  8. /* Date for last change $Date: 2014/09/16 13:20:35MESZ $ */
  9. /* Ino.400C0.000C0 */
  10. /* Module description : "Compiler specific Type definitions" */
  11. /* Ino.100C0.400C0.000C0 */
  12. /* Up Cell GmbH owns all the intellectual property rights, including \ */
  13. /* copyright and rights of confidence, in these computer programs. Such \ */
  14. /* intellectual property rights extend to the structure, sequence, \ */
  15. /* organisation and presentation of the programs and they may not be, in \ */
  16. /* whole or part, copied, used or transmitted in any form or by any means, \ */
  17. /* including electronically, without prior written permission of Up Cell GmbH */
  18. #if !defined(BASETYPES_H)
  19. /* Ino.220C0.07380.27380.000C0 */
  20. #define BASETYPES_H
  21. #include "ti_msp_dl_config.h"
  22. #define NUMBER_OF_CELLS 8
  23. typedef signed short int typSI16;
  24. typedef signed long int typSI32;
  25. typedef signed char typSI8;
  26. typedef unsigned short int typUI16;
  27. typedef unsigned long int typUI32;
  28. typedef unsigned char typUI8;
  29. typedef unsigned int typUBS;
  30. typedef signed int typSBS;
  31. typedef float typF32;
  32. typedef double typF64;
  33. typedef struct {
  34. typUI8 ENABLE : 1; // Cell enable status
  35. typUI8 EOVOLT : 1; // Overvoltage error flag
  36. typUI8 EUVOLT : 1; // Undervoltage error flag
  37. typUI8 EOCURR : 1; // Overcurrent error flag
  38. typUI8 EOTEMP : 1; // Overtemperature error flag
  39. typUI8 EUTEMP : 1; // Temperature sensor error flag
  40. typSI16 cell_volt; // Cell voltage (signed 16-bit integer)
  41. typSI16 cell_curr; // Cell current (signed 16-bit integer)
  42. typSI16 cell_temp; // Cell temperature (signed 16-bit integer)
  43. } CurrentCellValue;
  44. #define TRESHOLDOVERHEATINGTEMP 50
  45. // Enum for operation modes
  46. typedef enum {
  47. OPMODE_INIT,
  48. OPMODE_NORMAL_OPERATION,
  49. OPMODE_CAN_MESSAGE_RECEIVED,
  50. OPMODE_POWER_DOWN,
  51. OPMODE_ERROR_IN_SEGMENT,
  52. OPMODE_TESTMODUS_SEGMENT
  53. } OperationMode;
  54. typedef struct {
  55. typUI32 traceid;
  56. typUI32 deviceid;
  57. typUI32 userid;
  58. } DeviceID_Struct;
  59. extern typUI16 OverheatingThreshold;
  60. extern CurrentCellValue CurrentValue_Cell[NUMBER_OF_CELLS];
  61. extern volatile bool gCheckADC;
  62. extern volatile typUI32 gInterruptLine1Status;
  63. extern volatile bool gServiceInt;
  64. extern OperationMode CurrentMode;
  65. extern typUI8 MYORDER_ID;
  66. // Usage example
  67. extern DeviceID_Struct DeviceUID;
  68. #endif