Module_SmartBox.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Module_SmartBox.h
  3. *
  4. * Created on: 2022¦~5¤ë3¤é
  5. * Author: 7564
  6. */
  7. #ifndef MODULE_SMARTBOX_H_
  8. #define MODULE_SMARTBOX_H_
  9. #include <sys/time.h>
  10. #include <sys/timeb.h>
  11. #include <sys/types.h>
  12. #include <sys/stat.h>
  13. #include <sys/types.h>
  14. #include <sys/ioctl.h>
  15. #include <sys/socket.h>
  16. #include <sys/ipc.h>
  17. #include <sys/shm.h>
  18. #include <sys/mman.h>
  19. #include <linux/wireless.h>
  20. #include <linux/can.h>
  21. #include <linux/can/raw.h>
  22. #include <arpa/inet.h>
  23. #include <netinet/in.h>
  24. #include <unistd.h>
  25. #include <stdarg.h>
  26. #include <stdio.h> /*¼Ð·Ç¿é¤J¿é¥X©w¸q*/
  27. #include <stdlib.h> /*¼Ð·Ç¨ç¼Æ®w©w¸q*/
  28. #include <unistd.h> /*Unix ¼Ð·Ç¨ç¼Æ©w¸q*/
  29. #include <fcntl.h> /*Àɱ±¨î©w¸q*/
  30. #include <termios.h> /*PPSIX ²×ºÝ±±¨î©w¸q*/
  31. #include <errno.h> /*¿ù»~¸¹©w¸q*/
  32. #include <string.h>
  33. #include <time.h>
  34. #include <ctype.h>
  35. #include <ifaddrs.h>
  36. #include <math.h>
  37. #include "../../define.h"
  38. #include <stdbool.h>
  39. #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
  40. #define PASS 1
  41. #define FAIL -1
  42. #define YES 1
  43. #define NO 0
  44. #define NONE_GROUP_CAN_SELECTED 255
  45. #define NONE_RELAY_SELECTED 255
  46. #define PSU_MIN_VOL 500 // 0.1V
  47. #define PSU_MIN_CUR 20 // 0.1A
  48. #define CAP_GAP_FETCH 30 // 0.1kw
  49. #define CAP_GAP_RELEASE 50 // 0.1kw
  50. #define STABLE_CAP_GAP 10 // 0.1kw
  51. #define SMART_MODE 1 // 0 : FCFS, 1 : Average
  52. #define LIMIT_PWR_MODULE_GAP 2 // 1A
  53. #define RELEASE_STEP_CUR_SHARE 20 // 0.1A
  54. // Fetch Loop
  55. #define PSU_TG_VOL_GAP 100 // 0.1V
  56. #define PSU_TG_CUR_GAP 50 // 0.1A
  57. // Fetch Loop End
  58. // Release Loop
  59. #define PSU_LIMIT_CUR 50 // 0.1A
  60. // Release Loop End
  61. #define FETCH_SMART_CHK_TIME 5000 // 1ms
  62. #define FETCH_FINISH_WAIT_TIME 1000 // 1ms
  63. #define RELEASE_STABLE_CHK_TIME 5000 // 1ms
  64. #define RELEASE_SMART_CHK_TIME 2000 // 1ms
  65. #define WAIT_FOR_LIMIT_STABLE 2000 // 1ms
  66. #define RELEASE_FINISH_WAIT_TIME 1000 // 1ms
  67. #endif /* MODULE_SMARTBOX_H_ */