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/nmuart.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 NMC1000 UART protocol bus APIs implementation. |
tsungta | 28:2abbf8463fa8 | 6 | * |
tsungta | 28:2abbf8463fa8 | 7 | * Copyright (c) 2016 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 _NMUART_H_ |
tsungta | 28:2abbf8463fa8 | 43 | #define _NMUART_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 | * @fn nm_uart_sync_cmd |
tsungta | 28:2abbf8463fa8 | 49 | * @brief Check COM Port |
tsungta | 28:2abbf8463fa8 | 50 | * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure |
tsungta | 28:2abbf8463fa8 | 51 | */ |
tsungta | 28:2abbf8463fa8 | 52 | sint8 nm_uart_sync_cmd(void); |
tsungta | 28:2abbf8463fa8 | 53 | /** |
tsungta | 28:2abbf8463fa8 | 54 | * @fn nm_uart_read_reg |
tsungta | 28:2abbf8463fa8 | 55 | * @brief Read register |
tsungta | 28:2abbf8463fa8 | 56 | * @param [in] u32Addr |
tsungta | 28:2abbf8463fa8 | 57 | * Register address |
tsungta | 28:2abbf8463fa8 | 58 | * @return Register value |
tsungta | 28:2abbf8463fa8 | 59 | */ |
tsungta | 28:2abbf8463fa8 | 60 | uint32 nm_uart_read_reg(uint32 u32Addr); |
tsungta | 28:2abbf8463fa8 | 61 | |
tsungta | 28:2abbf8463fa8 | 62 | /** |
tsungta | 28:2abbf8463fa8 | 63 | * @fn nm_uart_read_reg_with_ret |
tsungta | 28:2abbf8463fa8 | 64 | * @brief Read register with error code return |
tsungta | 28:2abbf8463fa8 | 65 | * @param [in] u32Addr |
tsungta | 28:2abbf8463fa8 | 66 | * Register address |
tsungta | 28:2abbf8463fa8 | 67 | * @param [out] pu32RetVal |
tsungta | 28:2abbf8463fa8 | 68 | * Pointer to u32 variable used to return the read value |
tsungta | 28:2abbf8463fa8 | 69 | * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure |
tsungta | 28:2abbf8463fa8 | 70 | */ |
tsungta | 28:2abbf8463fa8 | 71 | sint8 nm_uart_read_reg_with_ret(uint32 u32Addr, uint32* pu32RetVal); |
tsungta | 28:2abbf8463fa8 | 72 | |
tsungta | 28:2abbf8463fa8 | 73 | /** |
tsungta | 28:2abbf8463fa8 | 74 | * @fn nm_uart_write_reg |
tsungta | 28:2abbf8463fa8 | 75 | * @brief write register |
tsungta | 28:2abbf8463fa8 | 76 | * @param [in] u32Addr |
tsungta | 28:2abbf8463fa8 | 77 | * Register address |
tsungta | 28:2abbf8463fa8 | 78 | * @param [in] u32Val |
tsungta | 28:2abbf8463fa8 | 79 | * Value to be written to the register |
tsungta | 28:2abbf8463fa8 | 80 | * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure |
tsungta | 28:2abbf8463fa8 | 81 | */ |
tsungta | 28:2abbf8463fa8 | 82 | sint8 nm_uart_write_reg(uint32 u32Addr, uint32 u32Val); |
tsungta | 28:2abbf8463fa8 | 83 | |
tsungta | 28:2abbf8463fa8 | 84 | /** |
tsungta | 28:2abbf8463fa8 | 85 | * @fn nm_uart_read_block |
tsungta | 28:2abbf8463fa8 | 86 | * @brief Read block of data |
tsungta | 28:2abbf8463fa8 | 87 | * @param [in] u32Addr |
tsungta | 28:2abbf8463fa8 | 88 | * Start address |
tsungta | 28:2abbf8463fa8 | 89 | * @param [out] puBuf |
tsungta | 28:2abbf8463fa8 | 90 | * Pointer to a buffer used to return the read data |
tsungta | 28:2abbf8463fa8 | 91 | * @param [in] u16Sz |
tsungta | 28:2abbf8463fa8 | 92 | * Number of bytes to read. The buffer size must be >= u16Sz |
tsungta | 28:2abbf8463fa8 | 93 | * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure |
tsungta | 28:2abbf8463fa8 | 94 | */ |
tsungta | 28:2abbf8463fa8 | 95 | sint8 nm_uart_read_block(uint32 u32Addr, uint8 *puBuf, uint16 u16Sz); |
tsungta | 28:2abbf8463fa8 | 96 | |
tsungta | 28:2abbf8463fa8 | 97 | /** |
tsungta | 28:2abbf8463fa8 | 98 | * @fn nm_uart_write_block |
tsungta | 28:2abbf8463fa8 | 99 | * @brief Write block of data |
tsungta | 28:2abbf8463fa8 | 100 | * @param [in] u32Addr |
tsungta | 28:2abbf8463fa8 | 101 | * Start address |
tsungta | 28:2abbf8463fa8 | 102 | * @param [in] puBuf |
tsungta | 28:2abbf8463fa8 | 103 | * Pointer to the buffer holding the data to be written |
tsungta | 28:2abbf8463fa8 | 104 | * @param [in] u16Sz |
tsungta | 28:2abbf8463fa8 | 105 | * Number of bytes to write. The buffer size must be >= u16Sz |
tsungta | 28:2abbf8463fa8 | 106 | * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure |
tsungta | 28:2abbf8463fa8 | 107 | */ |
tsungta | 28:2abbf8463fa8 | 108 | sint8 nm_uart_write_block(uint32 u32Addr, uint8 *puBuf, uint16 u16Sz); |
tsungta | 28:2abbf8463fa8 | 109 | |
tsungta | 28:2abbf8463fa8 | 110 | /** |
tsungta | 28:2abbf8463fa8 | 111 | * @fn nm_uart_reconfigure |
tsungta | 28:2abbf8463fa8 | 112 | * @brief Reconfigures the UART interface |
tsungta | 28:2abbf8463fa8 | 113 | * @param [in] ptr |
tsungta | 28:2abbf8463fa8 | 114 | * Pointer to a DWORD containing baudrate at this moment. |
tsungta | 28:2abbf8463fa8 | 115 | * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure |
tsungta | 28:2abbf8463fa8 | 116 | */ |
tsungta | 28:2abbf8463fa8 | 117 | sint8 nm_uart_reconfigure(void *ptr); |
tsungta | 28:2abbf8463fa8 | 118 | #endif /* _NMI2C_H_ */ |
tsungta | 28:2abbf8463fa8 | 119 |