Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NNN50_CE_Test_UDP NNN50_linux_firmware NNN50_SoftAP_HelloWorld NNN50_BLEWIFISensor ... more
nmuart.h
00001 /** 00002 * 00003 * \file 00004 * 00005 * \brief This module contains NMC1000 UART protocol bus APIs implementation. 00006 * 00007 * Copyright (c) 2016 Atmel Corporation. All rights reserved. 00008 * 00009 * \asf_license_start 00010 * 00011 * \page License 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions are met: 00015 * 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 00019 * 2. Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * 00023 * 3. The name of Atmel may not be used to endorse or promote products derived 00024 * from this software without specific prior written permission. 00025 * 00026 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00027 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00028 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00029 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 00030 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00031 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00032 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00033 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 00034 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00035 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00036 * POSSIBILITY OF SUCH DAMAGE. 00037 * 00038 * \asf_license_stop 00039 * 00040 */ 00041 00042 #ifndef _NMUART_H_ 00043 #define _NMUART_H_ 00044 00045 #include "common/include/nm_common.h" 00046 00047 /* 00048 * @fn nm_uart_sync_cmd 00049 * @brief Check COM Port 00050 * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure 00051 */ 00052 sint8 nm_uart_sync_cmd (void); 00053 /** 00054 * @fn nm_uart_read_reg 00055 * @brief Read register 00056 * @param [in] u32Addr 00057 * Register address 00058 * @return Register value 00059 */ 00060 uint32 nm_uart_read_reg(uint32 u32Addr); 00061 00062 /** 00063 * @fn nm_uart_read_reg_with_ret 00064 * @brief Read register with error code return 00065 * @param [in] u32Addr 00066 * Register address 00067 * @param [out] pu32RetVal 00068 * Pointer to u32 variable used to return the read value 00069 * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure 00070 */ 00071 sint8 nm_uart_read_reg_with_ret (uint32 u32Addr, uint32* pu32RetVal); 00072 00073 /** 00074 * @fn nm_uart_write_reg 00075 * @brief write register 00076 * @param [in] u32Addr 00077 * Register address 00078 * @param [in] u32Val 00079 * Value to be written to the register 00080 * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure 00081 */ 00082 sint8 nm_uart_write_reg(uint32 u32Addr, uint32 u32Val); 00083 00084 /** 00085 * @fn nm_uart_read_block 00086 * @brief Read block of data 00087 * @param [in] u32Addr 00088 * Start address 00089 * @param [out] puBuf 00090 * Pointer to a buffer used to return the read data 00091 * @param [in] u16Sz 00092 * Number of bytes to read. The buffer size must be >= u16Sz 00093 * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure 00094 */ 00095 sint8 nm_uart_read_block(uint32 u32Addr, uint8 *puBuf, uint16 u16Sz); 00096 00097 /** 00098 * @fn nm_uart_write_block 00099 * @brief Write block of data 00100 * @param [in] u32Addr 00101 * Start address 00102 * @param [in] puBuf 00103 * Pointer to the buffer holding the data to be written 00104 * @param [in] u16Sz 00105 * Number of bytes to write. The buffer size must be >= u16Sz 00106 * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure 00107 */ 00108 sint8 nm_uart_write_block(uint32 u32Addr, uint8 *puBuf, uint16 u16Sz); 00109 00110 /** 00111 * @fn nm_uart_reconfigure 00112 * @brief Reconfigures the UART interface 00113 * @param [in] ptr 00114 * Pointer to a DWORD containing baudrate at this moment. 00115 * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure 00116 */ 00117 sint8 nm_uart_reconfigure(void *ptr); 00118 #endif /* _NMI2C_H_ */ 00119
Generated on Wed Jul 13 2022 16:32:37 by
1.7.2