quec_boot_uart.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /** @file
  2. quec_boot_uart.h
  3. @brief
  4. This file is used to define boot uart api for different Quectel Project.
  5. */
  6. /*================================================================
  7. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  8. Quectel Wireless Solution Proprietary and Confidential.
  9. =================================================================*/
  10. /*=================================================================
  11. EDIT HISTORY FOR MODULE
  12. This section contains comments describing changes made to the module.
  13. Notice that changes are listed in reverse chronological order.
  14. WHEN WHO WHAT, WHERE, WHY
  15. ------------ ------- -------------------------------------------------------------------------------
  16. 24/01/2021 Neo Init version
  17. =================================================================*/
  18. #ifndef QUEC_BOOT_UART_H
  19. #define QUEC_BOOT_UART_H
  20. #include "stdio.h"
  21. #include "stdlib.h"
  22. #include "string.h"
  23. #include "boot_fdl_channel.h"
  24. #include "drv_names.h"
  25. #include "quec_boot_pin_cfg.h"
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /*===========================================================================
  30. * Macro Definition
  31. ===========================================================================*/
  32. /*===========================================================================
  33. * Enum
  34. ===========================================================================*/
  35. typedef struct
  36. {
  37. ql_boot_uart_port_e port;
  38. uint8_t tx_pin;
  39. uint8_t tx_func;
  40. uint8_t rx_pin;
  41. uint8_t rx_func;
  42. } quec_boot_uart_func_s;
  43. typedef struct
  44. {
  45. uint32_t dev_name;
  46. ql_boot_uart_port_e uart_port;
  47. fdlChannel_t* channel;
  48. } quec_boot_uart_info_t;
  49. typedef struct
  50. {
  51. uint32_t baudrate;
  52. uint32_t icf_format;
  53. uint32_t icf_parity;
  54. uint32_t ifc_rx;
  55. uint32_t ifc_tx;
  56. } quec_boot_uart_setting_s;
  57. /*===========================================================================
  58. * Functions declaration
  59. ===========================================================================*/
  60. /*****************************************************************
  61. * Function: quec_boot_fota_urc_output
  62. *
  63. * Description:
  64. * output fota urc
  65. *
  66. * Parameters:
  67. * block_count [in] upgrated block
  68. * block [in] total block
  69. *
  70. * Return:
  71. * NULL
  72. *
  73. *****************************************************************/
  74. void quec_boot_fota_urc_output(int block_count, int block);
  75. /*****************************************************************
  76. * Function: quec_boot_urc_init
  77. *
  78. * Description:
  79. * boot urc init.
  80. *
  81. * Parameters:
  82. *
  83. * Return:
  84. * 0 success
  85. * -1 error
  86. *
  87. *****************************************************************/
  88. int quec_boot_urc_init();
  89. #ifdef __cplusplus
  90. } /*"C" */
  91. #endif
  92. #endif /* QUEC_BOOT_UART_H */