You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

137 line
4.5 KiB

  1. /**
  2. *
  3. * \file
  4. *
  5. * \brief This module contains NMC1500 M2M driver APIs declarations.
  6. *
  7. * Copyright (c) 2015 - 2017 Atmel Corporation. All rights reserved.
  8. *
  9. * \asf_license_start
  10. *
  11. * \page License
  12. *
  13. * Redistribution and use in source and binary forms, with or without
  14. * modification, are permitted provided that the following conditions are met:
  15. *
  16. * 1. Redistributions of source code must retain the above copyright notice,
  17. * this list of conditions and the following disclaimer.
  18. *
  19. * 2. Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. *
  23. * 3. The name of Atmel may not be used to endorse or promote products derived
  24. * from this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
  27. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  28. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  29. * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
  30. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  31. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  32. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  33. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  34. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  35. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * \asf_license_stop
  39. *
  40. */
  41. #ifndef _NMDRV_H_
  42. #define _NMDRV_H_
  43. #include "common/include/nm_common.h"
  44. /**
  45. * @struct tstrM2mRev
  46. * @brief Structure holding firmware version parameters and build date/time
  47. */
  48. typedef struct {
  49. uint32 u32Chipid; /* HW revision which will be basically the chip ID */
  50. uint8 u8FirmwareMajor; /* Version Major Number which represents the official release base */
  51. uint8 u8FirmwareMinor; /* Version Minor Number which represents the engineering release base */
  52. uint8 u8FirmwarePatch; /* Version pathc Number which represents the pathces release base */
  53. uint8 u8DriverMajor; /* Version Major Number which represents the official release base */
  54. uint8 u8DriverMinor; /* Version Minor Number which represents the engineering release base */
  55. uint8 u8DriverPatch; /* Version Patch Number which represents the pathces release base */
  56. uint8 BuildDate[sizeof(__DATE__)];
  57. uint8 BuildTime[sizeof(__TIME__)];
  58. uint8 _PAD8_;
  59. uint16 u16FirmwareSvnNum;
  60. uint16 _PAD16_[2];
  61. } tstrM2mRev;
  62. /**
  63. * @struct tstrM2mBinaryHeader
  64. * @brief Structure holding compatibility version info for firmware binaries
  65. */
  66. typedef struct {
  67. tstrM2mRev binVerInfo;
  68. uint32 flashOffset;
  69. uint32 payloadSize;
  70. } tstrM2mBinaryHeader;
  71. #ifdef __cplusplus
  72. extern "C" {
  73. #endif
  74. /**
  75. * @fn nm_get_firmware_info(tstrM2mRev* M2mRev)
  76. * @brief Get Firmware version info
  77. * @param [out] M2mRev
  78. * pointer holds address of structure "tstrM2mRev" that contains the firmware version parameters
  79. * @version 1.0
  80. */
  81. sint8 nm_get_firmware_info(tstrM2mRev *M2mRev);
  82. /**
  83. * @fn nm_get_firmware_full_info(tstrM2mRev* pstrRev)
  84. * @brief Get Firmware version info
  85. * @param [out] M2mRev
  86. * pointer holds address of structure "tstrM2mRev" that contains the firmware version parameters
  87. * @version 1.0
  88. */
  89. sint8 nm_get_firmware_full_info(tstrM2mRev *pstrRev);
  90. /**
  91. * @fn nm_get_ota_firmware_info(tstrM2mRev* pstrRev)
  92. * @brief Get Firmware version info
  93. * @param [out] M2mRev
  94. * pointer holds address of structure "tstrM2mRev" that contains the firmware version parameters
  95. * @version 1.0
  96. */
  97. sint8 nm_get_ota_firmware_info(tstrM2mRev *pstrRev);
  98. /*
  99. * @fn nm_drv_init
  100. * @brief Initialize NMC1000 driver
  101. * @return ZERO in case of success and Negative error code in case of failure
  102. */
  103. sint8 nm_drv_init_download_mode(void);
  104. /*
  105. * @fn nm_drv_init
  106. * @brief Initialize NMC1000 driver
  107. * @return M2M_SUCCESS in case of success and Negative error code in case of failure
  108. * @param [in] arg
  109. * Generic argument TBD
  110. * @return ZERO in case of success and Negative error code in case of failure
  111. */
  112. sint8 nm_drv_init(void *arg);
  113. /**
  114. * @fn nm_drv_deinit
  115. * @brief Deinitialize NMC1000 driver
  116. * @author M. Abdelmawla
  117. * @param [in] arg
  118. * Generic argument TBD
  119. * @return ZERO in case of success and Negative error code in case of failure
  120. */
  121. sint8 nm_drv_deinit(void *arg);
  122. #ifdef __cplusplus
  123. }
  124. #endif
  125. #endif /*_NMDRV_H_*/