Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

148 linhas
4.9 KiB

  1. /**
  2. *
  3. * \file
  4. *
  5. * \brief This module contains WINC3400 M2M driver APIs declarations.
  6. *
  7. * Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
  8. *
  9. * \asf_license_start
  10. *
  11. * \page License
  12. *
  13. * Subject to your compliance with these terms, you may use Microchip
  14. * software and any derivatives exclusively with Microchip products.
  15. * It is your responsibility to comply with third party license terms applicable
  16. * to your use of third party software (including open source software) that
  17. * may accompany Microchip software.
  18. *
  19. * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
  20. * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
  21. * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
  22. * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
  23. * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
  24. * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
  25. * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
  26. * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
  27. * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
  28. * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
  29. * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
  30. *
  31. * \asf_license_stop
  32. *
  33. */
  34. #ifndef _NMDRV_H_
  35. #define _NMDRV_H_
  36. #include "common/include/nm_common.h"
  37. /**
  38. * @struct tstrM2mRev
  39. * @brief Structure holding firmware version parameters and build date/time
  40. */
  41. typedef struct {
  42. uint16 u16FirmwareHifInfo; /* Fw HIF Info */
  43. uint8 u8FirmwareMajor; /* Version Major Number */
  44. uint8 u8FirmwareRsvd; /* Reserved */
  45. uint8 u8FirmwareMinor; /* Version Minor */
  46. uint8 u8FirmwarePatch; /* Patch Number */
  47. uint8 BuildDate[sizeof(__DATE__)]; // 12 bytes
  48. uint8 BuildTime[sizeof(__TIME__)]; // 9 bytes
  49. } tstrM2mRev;
  50. #ifdef __cplusplus
  51. extern "C" {
  52. #endif
  53. /**
  54. * @fn nm_get_hif_info(uint16 *pu16FwHifInfo, uint16 *pu16OtaHifInfo);
  55. * @brief Get Hif info of images in both partitions (Firmware and Ota).
  56. * @param [out] pu16FwHifInfo
  57. * Pointer holding Hif info of image in the active partition.
  58. * @param [out] pu16OtaHifInfo
  59. * Pointer holding Hif info of image in the inactive partition.
  60. * @return ZERO in case of success and Negative error code in case of failure
  61. */
  62. sint8 nm_get_hif_info(uint16 *pu16FwHifInfo, uint16 *pu16OtaHifInfo);
  63. /**
  64. * @fn nm_get_firmware_full_info(tstrM2mRev* pstrRev)
  65. * @brief Get Firmware version info
  66. * @param [out] pstrRev
  67. * Pointer holds address of structure @ref tstrM2mRev that contains the version parameters
  68. * of image in the active partition.
  69. * @return ZERO in case of success and Negative error code in case of failure
  70. */
  71. sint8 nm_get_firmware_full_info(tstrM2mRev* pstrRev);
  72. /**
  73. * @fn nm_get_ota_firmware_info(tstrM2mRev* pstrRev)
  74. * @brief Get Firmware version info
  75. * @param [out] pstrRev
  76. * Pointer holds address of structure @ref tstrM2mRev that contains the version parameters
  77. * of image in the inactive partition.
  78. * @return ZERO in case of success and Negative error code in case of failure
  79. */
  80. sint8 nm_get_ota_firmware_info(tstrM2mRev* pstrRev);
  81. /*
  82. * @fn nm_drv_init
  83. * @brief Initialize NMC1000 driver
  84. * @return ZERO in case of success and Negative error code in case of failure
  85. */
  86. sint8 nm_drv_init_download_mode(uint32 req_serial_number);
  87. /*
  88. * @fn nm_drv_init
  89. * @brief Initialize NMC1000 driver
  90. * @return M2M_SUCCESS in case of success and Negative error code in case of failure
  91. * @param [in] arg - Generic argument passed on to nm_drv_init_start
  92. * @param [in] req_serial_number
  93. * @return ZERO in case of success and Negative error code in case of failure
  94. */
  95. sint8 nm_drv_init(void * arg, uint32 req_serial_number);
  96. /*
  97. * @fn nm_drv_init_hold
  98. * @brief First part of nm_drv_init, up to the point of initializing spi for flash access.
  99. * @see nm_drv_init
  100. * @return M2M_SUCCESS in case of success and Negative error code in case of failure
  101. * @param [in] req_serial_number
  102. * Parameter inherited from nm_drv_init
  103. * @return ZERO in case of success and Negative error code in case of failure
  104. */
  105. sint8 nm_drv_init_hold(uint32 req_serial_number);
  106. /*
  107. * @fn nm_drv_init_start
  108. * @brief Second part of nm_drv_init, continuing from where nm_drv_init_hold left off.
  109. * @see nm_drv_init
  110. * @return M2M_SUCCESS in case of success and Negative error code in case of failure
  111. * @param [in] arg
  112. * Parameter inherited from nm_drv_init
  113. * @return ZERO in case of success and Negative error code in case of failure
  114. */
  115. sint8 nm_drv_init_start(void * arg);
  116. /**
  117. * @fn nm_drv_deinit
  118. * @brief Deinitialize NMC1000 driver
  119. * @author M. Abdelmawla
  120. * @param [in] arg - Generic argument unused.
  121. * @return ZERO in case of success and Negative error code in case of failure
  122. */
  123. sint8 nm_drv_deinit(void * arg);
  124. /**
  125. * @fn nm_cpu_start(void)
  126. * @brief Start CPU from the WINC module
  127. * @return ZERO in case of success and Negative error code in case of failure
  128. */
  129. sint8 nm_cpu_start(void);
  130. #ifdef __cplusplus
  131. }
  132. #endif
  133. #endif /*_NMDRV_H_*/