![]() |
|
|||
File indexing completed on 2025-05-11 08:23:50
0001 /****************************************************************************** 0002 * Copyright (C) 2002 - 2020 Xilinx, Inc. All rights reserved. 0003 * SPDX-License-Identifier: MIT 0004 ******************************************************************************/ 0005 0006 /****************************************************************************/ 0007 /** 0008 * 0009 * @file xuartlite_l.c 0010 * @addtogroup uartlite_v3_5 0011 * @{ 0012 * 0013 * This file contains low-level driver functions that can be used to access the 0014 * device. The user should refer to the hardware device specification for more 0015 * details of the device operation. 0016 0017 * <pre> 0018 * MODIFICATION HISTORY: 0019 * 0020 * Ver Who Date Changes 0021 * ----- ---- -------- ----------------------------------------------- 0022 * 1.00b rpm 04/25/02 First release 0023 * 1.12a rpm 07/16/07 Fixed arg type for RecvByte 0024 * 2.00a ktn 10/20/09 The macros have been renamed to remove _m from the name. 0025 * 3.2 sk 11/10/15 Used UINTPTR instead of u32 for Baseaddress CR# 867425. 0026 * Changed the prototypes of XUartLite_SendByte, 0027 * XUartLite_RecvByte APIs. 0028 * </pre> 0029 * 0030 ******************************************************************************/ 0031 0032 /***************************** Include Files *********************************/ 0033 0034 #ifndef __rtems__ 0035 #include "xuartlite_l.h" 0036 #else 0037 #include <dev/serial/uartlite_l.h> 0038 #endif /* __rtems__ */ 0039 0040 /************************** Constant Definitions *****************************/ 0041 0042 0043 /**************************** Type Definitions *******************************/ 0044 0045 0046 /***************** Macros (Inline Functions) Definitions *********************/ 0047 0048 0049 /************************** Function Prototypes ******************************/ 0050 0051 0052 /************************** Variable Prototypes ******************************/ 0053 0054 0055 /****************************************************************************/ 0056 /** 0057 * 0058 * This functions sends a single byte using the UART. It is blocking in that it 0059 * waits for the transmitter to become non-full before it writes the byte to 0060 * the transmit register. 0061 * 0062 * @param BaseAddress is the base address of the device 0063 * @param Data is the byte of data to send 0064 * 0065 * @return None. 0066 * 0067 * @note None. 0068 * 0069 ******************************************************************************/ 0070 void XUartLite_SendByte(UINTPTR BaseAddress, u8 Data) 0071 { 0072 while (XUartLite_IsTransmitFull(BaseAddress)); 0073 0074 XUartLite_WriteReg(BaseAddress, XUL_TX_FIFO_OFFSET, Data); 0075 } 0076 0077 0078 /****************************************************************************/ 0079 /** 0080 * 0081 * This functions receives a single byte using the UART. It is blocking in that 0082 * it waits for the receiver to become non-empty before it reads from the 0083 * receive register. 0084 * 0085 * @param BaseAddress is the base address of the device 0086 * 0087 * @return The byte of data received. 0088 * 0089 * @note None. 0090 * 0091 ******************************************************************************/ 0092 u8 XUartLite_RecvByte(UINTPTR BaseAddress) 0093 { 0094 while (XUartLite_IsReceiveEmpty(BaseAddress)); 0095 0096 return (u8)XUartLite_ReadReg(BaseAddress, XUL_RX_FIFO_OFFSET); 0097 } 0098 0099 /** @} */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |