down_panel_prog.h 893 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _DOWN_PANEL_H
  2. #define _DOWN_PANEL_H
  3. #include "LcdComm.h"
  4. #include "equ.h"
  5. #define DOWN_CMD_START_DOWN 0x01
  6. #define DOWN_CMD_ERASE_FLASH 0x02
  7. #define DOWN_CMD_WRITE_DATA 0x03
  8. #define DOWN_CMD_READ_DATA 0x04
  9. #define DOWN_CMD_RUN_PROG 0x05
  10. #define DOWN_CMD_OK 1
  11. #define DOWN_CMD_ERR 0
  12. #define DOWN_FRAME_LEN_MAX 200
  13. #define DOWN_CMD_DOWN_PROG 0x0F
  14. struct down_program_comm
  15. {
  16. u8 status;
  17. u8 comm;
  18. s8 *file_name;
  19. u32 num; //程序长度
  20. u16 crc16; //程序校验
  21. u8 *probuf; //程序内容
  22. u16 frameno; //当前帧号
  23. u16 framenum; //程序总帧数
  24. struct timespec update_time;
  25. u32 bit_prog;
  26. u32 bit_echo;
  27. u32 us_recv;
  28. };
  29. int init_down_program(s32 index);
  30. int is_down_program(void);
  31. int down_program_recv_timeout(void);
  32. int down_program_recv(u8 *buf);
  33. int down_program_send (void);
  34. int down_program_exit(void);
  35. void down_program_task(void);
  36. #endif