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