mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Apr 03 11:45:06 2014 +0100
Revision:
149:1fb5f62b92bd
Parent:
targets/hal/TARGET_Freescale/TARGET_KSDK_MCUS/TARGET_KSDK_CODE/hal/uart/fsl_uart_hal.h@146:f64d43ff0c18
Child:
324:406fd2029f23
Synchronized with git revision 220c0bb39ceee40016e1e86350c058963d01ed42

Full URL: https://github.com/mbedmicro/mbed/commit/220c0bb39ceee40016e1e86350c058963d01ed42/

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 146:f64d43ff0c18 1 /*
mbed_official 146:f64d43ff0c18 2 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
mbed_official 146:f64d43ff0c18 3 * All rights reserved.
mbed_official 146:f64d43ff0c18 4 *
mbed_official 146:f64d43ff0c18 5 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 146:f64d43ff0c18 6 * are permitted provided that the following conditions are met:
mbed_official 146:f64d43ff0c18 7 *
mbed_official 146:f64d43ff0c18 8 * o Redistributions of source code must retain the above copyright notice, this list
mbed_official 146:f64d43ff0c18 9 * of conditions and the following disclaimer.
mbed_official 146:f64d43ff0c18 10 *
mbed_official 146:f64d43ff0c18 11 * o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 146:f64d43ff0c18 12 * list of conditions and the following disclaimer in the documentation and/or
mbed_official 146:f64d43ff0c18 13 * other materials provided with the distribution.
mbed_official 146:f64d43ff0c18 14 *
mbed_official 146:f64d43ff0c18 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 146:f64d43ff0c18 16 * contributors may be used to endorse or promote products derived from this
mbed_official 146:f64d43ff0c18 17 * software without specific prior written permission.
mbed_official 146:f64d43ff0c18 18 *
mbed_official 146:f64d43ff0c18 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 146:f64d43ff0c18 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 146:f64d43ff0c18 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 146:f64d43ff0c18 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 146:f64d43ff0c18 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 146:f64d43ff0c18 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 146:f64d43ff0c18 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 146:f64d43ff0c18 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 146:f64d43ff0c18 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 146:f64d43ff0c18 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 146:f64d43ff0c18 29 */
mbed_official 146:f64d43ff0c18 30 #ifndef __FSL_UART_HAL_H__
mbed_official 146:f64d43ff0c18 31 #define __FSL_UART_HAL_H__
mbed_official 146:f64d43ff0c18 32
mbed_official 146:f64d43ff0c18 33 #include <assert.h>
mbed_official 146:f64d43ff0c18 34 #include <stdint.h>
mbed_official 146:f64d43ff0c18 35 #include <stdbool.h>
mbed_official 146:f64d43ff0c18 36 #include "fsl_uart_features.h"
mbed_official 146:f64d43ff0c18 37 #include "fsl_device_registers.h"
mbed_official 146:f64d43ff0c18 38
mbed_official 146:f64d43ff0c18 39 /*!
mbed_official 146:f64d43ff0c18 40 * @addtogroup uart_hal
mbed_official 146:f64d43ff0c18 41 * @{
mbed_official 146:f64d43ff0c18 42 */
mbed_official 146:f64d43ff0c18 43
mbed_official 146:f64d43ff0c18 44 /*! @file*/
mbed_official 146:f64d43ff0c18 45
mbed_official 146:f64d43ff0c18 46 /*******************************************************************************
mbed_official 146:f64d43ff0c18 47 * Definitions
mbed_official 146:f64d43ff0c18 48 ******************************************************************************/
mbed_official 146:f64d43ff0c18 49
mbed_official 146:f64d43ff0c18 50 /*! @brief Error codes for the UART driver. */
mbed_official 146:f64d43ff0c18 51 typedef enum _uart_status
mbed_official 146:f64d43ff0c18 52 {
mbed_official 146:f64d43ff0c18 53 kStatus_UART_Success = 0,
mbed_official 146:f64d43ff0c18 54 kStatus_UART_BaudRateCalculationError,/*!< UART Baud Rate calculation error out of range */
mbed_official 146:f64d43ff0c18 55 kStatus_UART_BaudRatePercentDiffExceeded, /*!< UART Baud Rate exceeds percentage difference */
mbed_official 146:f64d43ff0c18 56 kStatus_UART_BitCountNotSupported, /*!< UART bit count config not supported */
mbed_official 146:f64d43ff0c18 57 kStatus_UART_StopBitCountNotSupported, /*!< UART stop bit count config not supported */
mbed_official 146:f64d43ff0c18 58 kStatus_UART_RxStandbyModeError, /*!< UART unable to place receiver in standby mode */
mbed_official 146:f64d43ff0c18 59 kStatus_UART_ClearStatusFlagError, /*!< UART clear status flag error */
mbed_official 146:f64d43ff0c18 60 kStatus_UART_MSBFirstNotSupported, /*!< UART MSB first feature not supported */
mbed_official 146:f64d43ff0c18 61 kStatus_UART_ResyncNotSupported, /*!< UART resync disable operation not supported */
mbed_official 146:f64d43ff0c18 62 kStatus_UART_TxNotDisabled, /*!< UART Transmitter not disabled before enabling feature */
mbed_official 146:f64d43ff0c18 63 kStatus_UART_RxNotDisabled, /*!< UART Receiver not disabled before enabling feature */
mbed_official 146:f64d43ff0c18 64 kStatus_UART_TxOrRxNotDisabled, /*!< UART Transmitter or Receiver not disabled */
mbed_official 146:f64d43ff0c18 65 kStatus_UART_TxBusy, /*!< UART transmit still in progress */
mbed_official 146:f64d43ff0c18 66 kStatus_UART_RxBusy, /*!< UART receive still in progress */
mbed_official 146:f64d43ff0c18 67 kStatus_UART_NoTransmitInProgress, /*!< UART no transmit in progress */
mbed_official 146:f64d43ff0c18 68 kStatus_UART_NoReceiveInProgress, /*!< UART no receive in progress */
mbed_official 146:f64d43ff0c18 69 kStatus_UART_InvalidInstanceNumber, /*!< Invalid UART instance number */
mbed_official 146:f64d43ff0c18 70 kStatus_UART_InvalidBitSetting, /*!< Invalid setting for desired UART register bit field */
mbed_official 146:f64d43ff0c18 71 kStatus_UART_OverSamplingNotSupported, /*!< UART oversampling not supported */
mbed_official 146:f64d43ff0c18 72 kStatus_UART_BothEdgeNotSupported, /*!< UART both edge sampling not supported */
mbed_official 146:f64d43ff0c18 73 kStatus_UART_Timeout, /*!< UART transfer timed out*/
mbed_official 146:f64d43ff0c18 74 } uart_status_t;
mbed_official 146:f64d43ff0c18 75
mbed_official 146:f64d43ff0c18 76 /*!
mbed_official 146:f64d43ff0c18 77 * @brief UART number of stop bits.
mbed_official 146:f64d43ff0c18 78 *
mbed_official 146:f64d43ff0c18 79 * These constants define the number of allowable stop bits to configure in a UART instance.
mbed_official 146:f64d43ff0c18 80 */
mbed_official 146:f64d43ff0c18 81 typedef enum _uart_stop_bit_count {
mbed_official 146:f64d43ff0c18 82 kUartOneStopBit = 0, /*!< one stop bit */
mbed_official 146:f64d43ff0c18 83 kUartTwoStopBit = 1, /*!< two stop bits */
mbed_official 146:f64d43ff0c18 84 } uart_stop_bit_count_t;
mbed_official 146:f64d43ff0c18 85
mbed_official 146:f64d43ff0c18 86 /*!
mbed_official 146:f64d43ff0c18 87 * @brief UART parity mode.
mbed_official 146:f64d43ff0c18 88 *
mbed_official 146:f64d43ff0c18 89 * These constants define the UART parity mode options: disabled or enabled of type even or odd.
mbed_official 146:f64d43ff0c18 90 */
mbed_official 146:f64d43ff0c18 91 typedef enum _uart_parity_mode {
mbed_official 146:f64d43ff0c18 92 kUartParityDisabled = 0x0, /*!< parity disabled */
mbed_official 146:f64d43ff0c18 93 kUartParityEven = 0x2, /*!< parity enabled, type even, bit setting: PE|PT = 10 */
mbed_official 146:f64d43ff0c18 94 kUartParityOdd = 0x3, /*!< parity enabled, type odd, bit setting: PE|PT = 11 */
mbed_official 146:f64d43ff0c18 95 } uart_parity_mode_t;
mbed_official 146:f64d43ff0c18 96
mbed_official 146:f64d43ff0c18 97 /*!
mbed_official 146:f64d43ff0c18 98 * @brief UART number of bits in a character.
mbed_official 146:f64d43ff0c18 99 *
mbed_official 146:f64d43ff0c18 100 * These constants define the number of allowable data bits per UART character. Note, check the
mbed_official 146:f64d43ff0c18 101 * UART documentation to determine if the desired UART instance supports the desired number
mbed_official 146:f64d43ff0c18 102 * of data bits per UART character.
mbed_official 146:f64d43ff0c18 103 */
mbed_official 146:f64d43ff0c18 104 typedef enum _uart_bit_count_per_char {
mbed_official 146:f64d43ff0c18 105 kUart8BitsPerChar = 0, /*!< 8-bit data characters */
mbed_official 146:f64d43ff0c18 106 kUart9BitsPerChar = 1, /*!< 9-bit data characters */
mbed_official 146:f64d43ff0c18 107 kUart10BitsPerChar = 2, /*!< 10-bit data characters */
mbed_official 146:f64d43ff0c18 108 } uart_bit_count_per_char_t;
mbed_official 146:f64d43ff0c18 109
mbed_official 146:f64d43ff0c18 110 /*!
mbed_official 146:f64d43ff0c18 111 * @brief UART operation configuration constants.
mbed_official 146:f64d43ff0c18 112 *
mbed_official 146:f64d43ff0c18 113 * This provides constants for UART operational states: "operates normally"
mbed_official 146:f64d43ff0c18 114 * or "stops/ceases operation"
mbed_official 146:f64d43ff0c18 115 */
mbed_official 146:f64d43ff0c18 116 typedef enum _uart_operation_config {
mbed_official 146:f64d43ff0c18 117 kUartOperates = 0, /*!< UART continues to operate normally */
mbed_official 146:f64d43ff0c18 118 kUartStops = 1, /*!< UART ceases operation */
mbed_official 146:f64d43ff0c18 119 } uart_operation_config_t;
mbed_official 146:f64d43ff0c18 120
mbed_official 146:f64d43ff0c18 121 /*!
mbed_official 146:f64d43ff0c18 122 * @brief UART wakeup from standby method constants.
mbed_official 146:f64d43ff0c18 123 *
mbed_official 146:f64d43ff0c18 124 * This provides constants for the two UART wakeup methods: idle-line or address-mark.
mbed_official 146:f64d43ff0c18 125 */
mbed_official 146:f64d43ff0c18 126 typedef enum _uart_wakeup_method {
mbed_official 146:f64d43ff0c18 127 kUartIdleLineWake = 0, /*!< The idle-line wakes UART receiver from standby */
mbed_official 146:f64d43ff0c18 128 kUartAddrMarkWake = 1, /*!< The address-mark wakes UART receiver from standby */
mbed_official 146:f64d43ff0c18 129 } uart_wakeup_method_t;
mbed_official 146:f64d43ff0c18 130
mbed_official 146:f64d43ff0c18 131 /*!
mbed_official 146:f64d43ff0c18 132 * @brief UART idle-line detect selection types.
mbed_official 146:f64d43ff0c18 133 *
mbed_official 146:f64d43ff0c18 134 * This provides constants for the UART idle character bit-count start: either after start or
mbed_official 146:f64d43ff0c18 135 * stop bit.
mbed_official 146:f64d43ff0c18 136 */
mbed_official 146:f64d43ff0c18 137 typedef enum _uart_idle_line_select {
mbed_official 146:f64d43ff0c18 138 kUartIdleLineAfterStartBit = 0, /*!< UART idle character bit count start after start bit */
mbed_official 146:f64d43ff0c18 139 kUartIdleLineAfterStopBit = 1, /*!< UART idle character bit count start after stop bit */
mbed_official 146:f64d43ff0c18 140 } uart_idle_line_select_t;
mbed_official 146:f64d43ff0c18 141
mbed_official 146:f64d43ff0c18 142 /*!
mbed_official 146:f64d43ff0c18 143 * @brief UART break character length settings for transmit/detect.
mbed_official 146:f64d43ff0c18 144 *
mbed_official 146:f64d43ff0c18 145 * This provides constants for the UART break character length for both transmission and detection
mbed_official 146:f64d43ff0c18 146 * purposes. Note that the actual maximum bit times may vary depending on the UART instance.
mbed_official 146:f64d43ff0c18 147 */
mbed_official 146:f64d43ff0c18 148 typedef enum _uart_break_char_length {
mbed_official 146:f64d43ff0c18 149 kUartBreakChar10BitMinimum = 0, /*!< UART break char length 10 bit times (if M = 0, SBNS = 0) or
mbed_official 146:f64d43ff0c18 150 11 (if M = 1, SBNS = 0 or M = 0, SBNS = 1) or 12 (if M = 1,
mbed_official 146:f64d43ff0c18 151 SBNS = 1 or M10 = 1, SNBS = 0) or 13 (if M10 = 1, SNBS = 1) */
mbed_official 146:f64d43ff0c18 152 kUartBreakChar13BitMinimum = 1, /*!< UART break char length 13 bit times (if M = 0, SBNS = 0) or
mbed_official 146:f64d43ff0c18 153 14 (if M = 1, SBNS = 0 or M = 0, SBNS = 1) or 15 (if M = 1,
mbed_official 146:f64d43ff0c18 154 SBNS = 1 or M10 = 1, SNBS = 0) or 16 (if M10 = 1, SNBS = 1) */
mbed_official 146:f64d43ff0c18 155 } uart_break_char_length_t;
mbed_official 146:f64d43ff0c18 156
mbed_official 146:f64d43ff0c18 157 /*!
mbed_official 146:f64d43ff0c18 158 * @brief UART single-wire mode transmit direction.
mbed_official 146:f64d43ff0c18 159 *
mbed_official 146:f64d43ff0c18 160 * This provides constants for the UART transmit direction when configured for single-wire mode.
mbed_official 146:f64d43ff0c18 161 * The transmit line TXDIR is either an input or output.
mbed_official 146:f64d43ff0c18 162 */
mbed_official 146:f64d43ff0c18 163 typedef enum _uart_singlewire_txdir {
mbed_official 146:f64d43ff0c18 164 kUartSinglewireTxdirIn = 0, /*!< UART Single-Wire mode TXDIR input */
mbed_official 146:f64d43ff0c18 165 kUartSinglewireTxdirOut = 1, /*!< UART Single-Wire mode TXDIR output */
mbed_official 146:f64d43ff0c18 166 } uart_singlewire_txdir_t;
mbed_official 146:f64d43ff0c18 167
mbed_official 146:f64d43ff0c18 168 /*!
mbed_official 146:f64d43ff0c18 169 * @brief UART status flags.
mbed_official 146:f64d43ff0c18 170 *
mbed_official 146:f64d43ff0c18 171 * This provides constants for the UART status flags for use in the UART functions.
mbed_official 146:f64d43ff0c18 172 */
mbed_official 146:f64d43ff0c18 173 typedef enum _uart_status_flag {
mbed_official 146:f64d43ff0c18 174 kUartTransmitDataRegisterEmpty, /*!< Transmit data register empty flag, sets when transmit
mbed_official 146:f64d43ff0c18 175 buffer is empty */
mbed_official 146:f64d43ff0c18 176 kUartTransmissionComplete, /*!< Transmission complete flag, sets when transmitter is idle
mbed_official 146:f64d43ff0c18 177 (transmission activity complete) */
mbed_official 146:f64d43ff0c18 178 kUartReceiveDataRegisterFull, /*!< Receive data register full flag, sets when the receive data
mbed_official 146:f64d43ff0c18 179 buffer is full */
mbed_official 146:f64d43ff0c18 180 kUartIdleLineDetect, /*!< Idle line detect flag, sets when idle line detected */
mbed_official 146:f64d43ff0c18 181 kUartReceiveOverrun, /*!< Receiver Overrun, sets when new data is received before data
mbed_official 146:f64d43ff0c18 182 is read from receive register */
mbed_official 146:f64d43ff0c18 183 kUartNoiseDetect, /*!< Receiver takes 3 samples of each received bit. If any of
mbed_official 146:f64d43ff0c18 184 these samples differ, noise flag sets */
mbed_official 146:f64d43ff0c18 185 kUartFrameError, /*!< Frame error flag, sets if logic 0 was detected where stop
mbed_official 146:f64d43ff0c18 186 bit expected */
mbed_official 146:f64d43ff0c18 187 kUartParityError, /*!< If parity enabled, sets upon parity error detection */
mbed_official 146:f64d43ff0c18 188 kUartLineBreakDetect, /*!< LIN break detect interrupt flag, sets when
mbed_official 146:f64d43ff0c18 189 LIN break char detected and LIN circuit enabled */
mbed_official 146:f64d43ff0c18 190 kUartReceiveActiveEdgeDetect, /*!< Receive pin active edge interrupt flag, sets when active
mbed_official 146:f64d43ff0c18 191 edge detected */
mbed_official 146:f64d43ff0c18 192 kUartReceiverActive, /*!< Receiver Active Flag (RAF), sets at beginning of valid start
mbed_official 146:f64d43ff0c18 193 bit */
mbed_official 146:f64d43ff0c18 194 #if FSL_FEATURE_UART_HAS_EXTENDED_DATA_REGISTER_FLAGS
mbed_official 146:f64d43ff0c18 195 kUartNoiseInCurrentWord, /*!< NOISY bit, sets if noise detected in current data word */
mbed_official 146:f64d43ff0c18 196 kUartParityErrorInCurrentWord, /*!< PARITYE bit, sets if noise detected in current data word */
mbed_official 146:f64d43ff0c18 197 #endif
mbed_official 146:f64d43ff0c18 198 #if FSL_FEATURE_UART_HAS_FIFO
mbed_official 146:f64d43ff0c18 199 kUartTxBufferEmpty, /*!< TXEMPT bit, sets if transmit buffer is empty */
mbed_official 146:f64d43ff0c18 200 kUartRxBufferEmpty, /*!< RXEMPT bit, sets if transmit buffer is empty */
mbed_official 146:f64d43ff0c18 201 kUartTxBufferOverflow, /*!< TXOF bit, sets if transmit buffer overflow occurred */
mbed_official 146:f64d43ff0c18 202 kUartRxBufferUnderflow, /*!< RXUF bit, sets if receive buffer underflow occurred */
mbed_official 146:f64d43ff0c18 203 #endif
mbed_official 146:f64d43ff0c18 204 } uart_status_flag_t;
mbed_official 146:f64d43ff0c18 205
mbed_official 146:f64d43ff0c18 206 /*!
mbed_official 146:f64d43ff0c18 207 * @brief UART infrared transmitter pulse width options.
mbed_official 146:f64d43ff0c18 208 *
mbed_official 146:f64d43ff0c18 209 * This provides constants for the UART infrared (IR) pulse widths. Options include 3/16, 1/16
mbed_official 146:f64d43ff0c18 210 * 1/32, and 1/4 pulse widths.
mbed_official 146:f64d43ff0c18 211 */
mbed_official 146:f64d43ff0c18 212 typedef enum _uart_ir_tx_pulsewidth {
mbed_official 146:f64d43ff0c18 213 kUartIrThreeSixteenthsWidth = 0, /*!< 3/16 pulse */
mbed_official 146:f64d43ff0c18 214 kUartIrOneSixteenthWidth = 1, /*!< 1/16 pulse */
mbed_official 146:f64d43ff0c18 215 kUartIrOneThirtysecondsWidth = 2, /*!< 1/32 pulse */
mbed_official 146:f64d43ff0c18 216 kUartIrOneFourthWidth = 3, /*!< 1/4 pulse */
mbed_official 146:f64d43ff0c18 217 } uart_ir_tx_pulsewidth_t;
mbed_official 146:f64d43ff0c18 218
mbed_official 146:f64d43ff0c18 219 /*!
mbed_official 146:f64d43ff0c18 220 * @brief Structure for idle line configuration settings.
mbed_official 146:f64d43ff0c18 221 *
mbed_official 146:f64d43ff0c18 222 * This structure contains settings for the UART idle line configuration such as the Idle
mbed_official 146:f64d43ff0c18 223 * Line Type (ILT) and the Receiver Wake Up Idle Detect (RWUID).
mbed_official 146:f64d43ff0c18 224 */
mbed_official 146:f64d43ff0c18 225 typedef struct UartIdleLineConfig {
mbed_official 146:f64d43ff0c18 226 unsigned idleLineType : 1; /*!< ILT, Idle bit count start: 0 - after start bit (default),
mbed_official 146:f64d43ff0c18 227 1 - after stop bit */
mbed_official 146:f64d43ff0c18 228 unsigned rxWakeIdleDetect : 1; /*!< RWUID, Receiver Wake Up Idle Detect. IDLE status bit
mbed_official 146:f64d43ff0c18 229 operation during receive standby. Controls whether idle
mbed_official 146:f64d43ff0c18 230 character that wakes up receiver will also set
mbed_official 146:f64d43ff0c18 231 IDLE status bit 0 - IDLE status bit doesn't
mbed_official 146:f64d43ff0c18 232 get set (default), 1 - IDLE status bit gets set */
mbed_official 146:f64d43ff0c18 233 } uart_idle_line_config_t;
mbed_official 146:f64d43ff0c18 234
mbed_official 146:f64d43ff0c18 235 /*! @brief Structure for all UART status flags.
mbed_official 146:f64d43ff0c18 236 *
mbed_official 146:f64d43ff0c18 237 * This structure contains the settings for all of the UART status flags.
mbed_official 146:f64d43ff0c18 238 */
mbed_official 146:f64d43ff0c18 239 typedef struct UartStatusAll {
mbed_official 146:f64d43ff0c18 240 unsigned transmitDataRegisterEmpty : 1; /*!< Transmit data register empty flag, sets when
mbed_official 146:f64d43ff0c18 241 transmit buffer is empty */
mbed_official 146:f64d43ff0c18 242 unsigned transmissionComplete : 1; /*!< Transmission complete flag, sets when transmitter
mbed_official 146:f64d43ff0c18 243 is idle (transmission activity complete)*/
mbed_official 146:f64d43ff0c18 244 unsigned receiveDataRegisterFull : 1; /*!< Receive data register full flag, sets when the
mbed_official 146:f64d43ff0c18 245 receive data buffer is full */
mbed_official 146:f64d43ff0c18 246 unsigned idleLineDetect : 1; /*!< Idle line detect flag, sets when idle line detected */
mbed_official 146:f64d43ff0c18 247 unsigned receiveOverrun : 1; /*!< Receiver Overrun, sets when new data is received
mbed_official 146:f64d43ff0c18 248 before data is read from receive register */
mbed_official 146:f64d43ff0c18 249 unsigned noiseDetect : 1; /*!< Receiver takes 3 samples of each received bit.
mbed_official 146:f64d43ff0c18 250 If any of these samples differ, noise flag sets */
mbed_official 146:f64d43ff0c18 251 unsigned frameError : 1; /*!< Frame error flag, sets if logic 0 was detected
mbed_official 146:f64d43ff0c18 252 where stop bit expected */
mbed_official 146:f64d43ff0c18 253 unsigned parityError : 1; /*!< If parity enabled, will set upon parity
mbed_official 146:f64d43ff0c18 254 error detection */
mbed_official 146:f64d43ff0c18 255 unsigned lineBreakDetect : 1; /*!< LIN break detect interrupt flag, sets when
mbed_official 146:f64d43ff0c18 256 LIN break char detected and LIN circuit enabled */
mbed_official 146:f64d43ff0c18 257 unsigned receiveActiveEdgeDetect : 1; /*!< Receive pin active edge interrupt flag, sets
mbed_official 146:f64d43ff0c18 258 when active edge detected */
mbed_official 146:f64d43ff0c18 259 unsigned receiverActive : 1; /*!< Receiver Active Flag (RAF), sets at beginning of
mbed_official 146:f64d43ff0c18 260 valid start bit */
mbed_official 146:f64d43ff0c18 261 #if FSL_FEATURE_UART_HAS_EXTENDED_DATA_REGISTER_FLAGS
mbed_official 146:f64d43ff0c18 262 unsigned noiseInCurrentWord : 1; /*!< NOISY bit, sets if noise detected in current data word */
mbed_official 146:f64d43ff0c18 263 unsigned parityErrorInCurrentWord : 1; /*!< PARITYE bit, sets if noise detected in
mbed_official 146:f64d43ff0c18 264 current data word */
mbed_official 146:f64d43ff0c18 265 #endif
mbed_official 146:f64d43ff0c18 266 #if FSL_FEATURE_UART_HAS_FIFO
mbed_official 146:f64d43ff0c18 267 unsigned txBufferEmpty : 1; /*!< TXEMPT bit, sets if transmit buffer is empty */
mbed_official 146:f64d43ff0c18 268 unsigned rxBufferEmpty : 1; /*!< RXEMPT bit, sets if transmit buffer is empty */
mbed_official 146:f64d43ff0c18 269 unsigned txBufferOverflow : 1; /*!< TXOF bit, sets if transmit buffer overflow occurred */
mbed_official 146:f64d43ff0c18 270 unsigned rxBufferUnderflow : 1; /*!< RXUF bit, sets if receive buffer underflow occurred */
mbed_official 146:f64d43ff0c18 271 #endif
mbed_official 146:f64d43ff0c18 272 } uart_status_flag_all_t;
mbed_official 146:f64d43ff0c18 273
mbed_official 146:f64d43ff0c18 274 /*!
mbed_official 146:f64d43ff0c18 275 * @brief UART interrupt configuration structure, default settings are 0 (disabled).
mbed_official 146:f64d43ff0c18 276 *
mbed_official 146:f64d43ff0c18 277 * This structure contains the settings for all of the UART interrupt configurations.
mbed_official 146:f64d43ff0c18 278 */
mbed_official 146:f64d43ff0c18 279 typedef struct UartInterruptConfig {
mbed_official 146:f64d43ff0c18 280 unsigned linBreakDetect : 1; /*!< LIN break detect: 0 - disable interrupt,
mbed_official 146:f64d43ff0c18 281 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 282 unsigned rxActiveEdge : 1; /*!< RX Active Edge: 0 - disable interrupt,
mbed_official 146:f64d43ff0c18 283 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 284 unsigned transmitDataRegisterEmpty : 1; /*!< Transmit data register empty:
mbed_official 146:f64d43ff0c18 285 0 - disable interrupt, 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 286 unsigned transmitComplete : 1; /*!< Transmission complete: 0 - disable interrupt,
mbed_official 146:f64d43ff0c18 287 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 288 unsigned receiverDataRegisterFull : 1; /*!< Receiver data register full:
mbed_official 146:f64d43ff0c18 289 0 - disable interrupt, 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 290 unsigned idleLine : 1; /*!< Idle line: 0 - disable interrupt, 1 - enable interrupt*/
mbed_official 146:f64d43ff0c18 291 unsigned receiverOverrun : 1; /*!< Receiver Overrun: 0 - disable interrupt,
mbed_official 146:f64d43ff0c18 292 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 293 unsigned noiseErrorFlag : 1; /*!< Noise error flag: 0 - disable interrupt,
mbed_official 146:f64d43ff0c18 294 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 295 unsigned frameErrorFlag : 1; /*!< Framing error flag: 0 - disable interrupt,
mbed_official 146:f64d43ff0c18 296 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 297 unsigned parityErrorFlag : 1; /*!< Parity error flag: 0 - disable interrupt,
mbed_official 146:f64d43ff0c18 298 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 299 #if FSL_FEATURE_UART_HAS_FIFO
mbed_official 146:f64d43ff0c18 300 unsigned txFifoOverflow : 1; /*!< TX FIFO Overflow: 0 - disable interrupt,
mbed_official 146:f64d43ff0c18 301 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 302 unsigned rxFifoUnderflow : 1; /*!< RX FIFO Underflow: 0 - disable interrupt,
mbed_official 146:f64d43ff0c18 303 1 - enable interrupt */
mbed_official 146:f64d43ff0c18 304 #endif
mbed_official 146:f64d43ff0c18 305 } uart_interrupt_config_t;
mbed_official 146:f64d43ff0c18 306
mbed_official 146:f64d43ff0c18 307 /*!
mbed_official 146:f64d43ff0c18 308 * @brief UART configuration structure.
mbed_official 146:f64d43ff0c18 309 *
mbed_official 146:f64d43ff0c18 310 * This structure contains the settings for the most common UART configurations including
mbed_official 146:f64d43ff0c18 311 * the UART module source clock, baud rate, parity mode, stop bit count, data bit count per
mbed_official 146:f64d43ff0c18 312 * character, and tx/rx inversion options (which is the least common of the configurations).
mbed_official 146:f64d43ff0c18 313 */
mbed_official 146:f64d43ff0c18 314 typedef struct UartConfig {
mbed_official 146:f64d43ff0c18 315 uint32_t uartSourceClockInHz; /*!< UART module source clock in Hz */
mbed_official 146:f64d43ff0c18 316 uint32_t baudRate; /*!< UART baud rate */
mbed_official 146:f64d43ff0c18 317 uart_parity_mode_t parityMode; /*!< Parity mode, disabled (default), even, or odd */
mbed_official 146:f64d43ff0c18 318 uart_stop_bit_count_t stopBitCount; /*!< Number of stop bits, 1 stop bit (default)
mbed_official 146:f64d43ff0c18 319 or 2 stop bits */
mbed_official 146:f64d43ff0c18 320 uart_bit_count_per_char_t bitCountPerChar; /*!< Number of bits, 8-bit (default) or 9-bit
mbed_official 146:f64d43ff0c18 321 in a word (up to 10-bits in
mbed_official 146:f64d43ff0c18 322 some UART instances) */
mbed_official 146:f64d43ff0c18 323 unsigned rxDataInvert : 1; /*!< Receive Data Inversion: 0 - not inverted (default),
mbed_official 146:f64d43ff0c18 324 1 - inverted */
mbed_official 146:f64d43ff0c18 325 unsigned txDataInvert : 1; /*!< Transmit Data Inversion: 0 - not inverted (default),
mbed_official 146:f64d43ff0c18 326 1 - inverted */
mbed_official 146:f64d43ff0c18 327 } uart_config_t;
mbed_official 146:f64d43ff0c18 328
mbed_official 146:f64d43ff0c18 329 /*******************************************************************************
mbed_official 146:f64d43ff0c18 330 * API
mbed_official 146:f64d43ff0c18 331 ******************************************************************************/
mbed_official 146:f64d43ff0c18 332
mbed_official 146:f64d43ff0c18 333 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 334 extern "C" {
mbed_official 146:f64d43ff0c18 335 #endif
mbed_official 146:f64d43ff0c18 336
mbed_official 146:f64d43ff0c18 337 /*!
mbed_official 146:f64d43ff0c18 338 * @name UART Common Configurations
mbed_official 146:f64d43ff0c18 339 * @{
mbed_official 146:f64d43ff0c18 340 */
mbed_official 146:f64d43ff0c18 341
mbed_official 146:f64d43ff0c18 342 /*!
mbed_official 146:f64d43ff0c18 343 * @brief Initialize the UART controller.
mbed_official 146:f64d43ff0c18 344 *
mbed_official 146:f64d43ff0c18 345 * This function initializes the module to user defined settings and default settings.
mbed_official 146:f64d43ff0c18 346 * Here is an example demonstrating how to define the uart_config_t structure and call
mbed_official 146:f64d43ff0c18 347 * the uart_hal_init function:
mbed_official 146:f64d43ff0c18 348 @code
mbed_official 146:f64d43ff0c18 349 uart_config_t uartConfig;
mbed_official 146:f64d43ff0c18 350 uartConfig.uartSourceClockInHz = uartSourceClock;
mbed_official 146:f64d43ff0c18 351 uartConfig.baudRate = baudRate;
mbed_official 146:f64d43ff0c18 352 uartConfig.bitCountPerChar = kUart8BitsPerChar;
mbed_official 146:f64d43ff0c18 353 uartConfig.parityMode = kUartParityDisabled;
mbed_official 146:f64d43ff0c18 354 uartConfig.stopBitCount = kUartOneStopBit;
mbed_official 146:f64d43ff0c18 355 uartConfig.txDataInvert = 0;
mbed_official 146:f64d43ff0c18 356 uartConfig.rxDataInvert = 0;
mbed_official 146:f64d43ff0c18 357 uart_hal_init(uartInstance, &uartConfig);
mbed_official 146:f64d43ff0c18 358 @endcode
mbed_official 146:f64d43ff0c18 359 *
mbed_official 146:f64d43ff0c18 360 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 361 * @param config UART configuration data.
mbed_official 146:f64d43ff0c18 362 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 363 */
mbed_official 146:f64d43ff0c18 364 uart_status_t uart_hal_init(uint32_t uartInstance, const uart_config_t *config);
mbed_official 146:f64d43ff0c18 365
mbed_official 146:f64d43ff0c18 366 /*!
mbed_official 146:f64d43ff0c18 367 * @brief Configure the UART baud rate.
mbed_official 146:f64d43ff0c18 368 *
mbed_official 146:f64d43ff0c18 369 * This function programs the UART baud rate to the desired value passed in by the user. The user
mbed_official 146:f64d43ff0c18 370 * must also pass in the module source clock so that the function can calculate the baud
mbed_official 146:f64d43ff0c18 371 * rate divisors to their appropriate values.
mbed_official 146:f64d43ff0c18 372 * In some UART instances it is required that the transmitter/receiver be disabled
mbed_official 146:f64d43ff0c18 373 * before calling this function.
mbed_official 146:f64d43ff0c18 374 * Generally this is applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 375 *
mbed_official 146:f64d43ff0c18 376 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 377 * @param sourceClockInHz UART source input clock in Hz.
mbed_official 146:f64d43ff0c18 378 * @param desiredBaudRate UART desired baud rate.
mbed_official 146:f64d43ff0c18 379 * @return An error code or kStatus_UART_Success
mbed_official 146:f64d43ff0c18 380 */
mbed_official 146:f64d43ff0c18 381 uart_status_t uart_hal_set_baud_rate(uint32_t uartInstance, uint32_t sourceClockInHz,
mbed_official 146:f64d43ff0c18 382 uint32_t desiredBaudRate);
mbed_official 146:f64d43ff0c18 383
mbed_official 146:f64d43ff0c18 384 /*!
mbed_official 146:f64d43ff0c18 385 * @brief Set the UART baud rate modulo divisor value.
mbed_official 146:f64d43ff0c18 386 *
mbed_official 146:f64d43ff0c18 387 * This function allows the user to program the baud rate divisor directly in situations
mbed_official 146:f64d43ff0c18 388 * where the divisor value is known. In this case, the user may not want to call the
mbed_official 146:f64d43ff0c18 389 * uart_hal_set_baud_rate() function, as the divisor is already known.
mbed_official 146:f64d43ff0c18 390 *
mbed_official 146:f64d43ff0c18 391 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 392 * @param baudRateDivisor The baud rate modulo division "SBR" value.
mbed_official 146:f64d43ff0c18 393 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 394 */
mbed_official 146:f64d43ff0c18 395 uart_status_t uart_hal_set_baud_rate_divisor(uint32_t uartInstance, uint32_t baudRateDivisor);
mbed_official 146:f64d43ff0c18 396
mbed_official 146:f64d43ff0c18 397 #if FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT
mbed_official 146:f64d43ff0c18 398 /*!
mbed_official 146:f64d43ff0c18 399 * @brief Set the UART baud rate fine adjust. (Note: Feature available on select
mbed_official 146:f64d43ff0c18 400 * UART instances used in conjunction with baud rate programming)
mbed_official 146:f64d43ff0c18 401 *
mbed_official 146:f64d43ff0c18 402 * This function, which programs the baud rate fine adjust, is used in conjunction with
mbed_official 146:f64d43ff0c18 403 * programming the baud rate modulo divisor in situations where these divisors value are known.
mbed_official 146:f64d43ff0c18 404 * In this case, the user may not want to call the uart_hal_set_baud_rate() function, as the
mbed_official 146:f64d43ff0c18 405 * divisors are already known.
mbed_official 146:f64d43ff0c18 406 *
mbed_official 146:f64d43ff0c18 407 *
mbed_official 146:f64d43ff0c18 408 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 409 * @param baudFineAdjust Value of 5-bit field used to add more timing resolution to average
mbed_official 146:f64d43ff0c18 410 * baud rate frequency is 1/32 increments.
mbed_official 146:f64d43ff0c18 411 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 412 */
mbed_official 146:f64d43ff0c18 413 uart_status_t uart_hal_set_baud_rate_fine_adjust(uint32_t uartInstance, uint8_t baudFineAdjust);
mbed_official 146:f64d43ff0c18 414 #endif
mbed_official 146:f64d43ff0c18 415
mbed_official 146:f64d43ff0c18 416 #if FSL_FEATURE_UART_HAS_BAUD_RATE_OVER_SAMPLING_SUPPORT
mbed_official 146:f64d43ff0c18 417 /*!
mbed_official 146:f64d43ff0c18 418 * @brief Set the UART baud rate oversampling ratio. (Note: Feature available on select
mbed_official 146:f64d43ff0c18 419 * UART instances used in conjunction with baud rate programming)
mbed_official 146:f64d43ff0c18 420 *
mbed_official 146:f64d43ff0c18 421 * This function allows the user to directly configure the oversampling ratio (OSR). Normally this
mbed_official 146:f64d43ff0c18 422 * ratio is automatically configured when calling the uart_hal_set_baud_rate(). However, if the user
mbed_official 146:f64d43ff0c18 423 * knows the necessary dividers and wishes to directly program them, they also have the option to
mbed_official 146:f64d43ff0c18 424 * directly program the OSR.
mbed_official 146:f64d43ff0c18 425 * The oversampling ratio should be set between 4x (00011) and 32x (11111), writing
mbed_official 146:f64d43ff0c18 426 * an invalid oversampling ratio results in an error and is set to a default
mbed_official 146:f64d43ff0c18 427 * 16x (01111) oversampling ratio.
mbed_official 146:f64d43ff0c18 428 * It is required that the transmitter/receiver be disabled before calling
mbed_official 146:f64d43ff0c18 429 * this function.
mbed_official 146:f64d43ff0c18 430 *
mbed_official 146:f64d43ff0c18 431 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 432 * @param overSamplingRatio The oversampling ratio "OSR" value.
mbed_official 146:f64d43ff0c18 433 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 434 */
mbed_official 146:f64d43ff0c18 435 uart_status_t uart_hal_set_oversampling_ratio(uint32_t uartInstance, uint32_t overSamplingRatio);
mbed_official 146:f64d43ff0c18 436 #endif
mbed_official 146:f64d43ff0c18 437
mbed_official 146:f64d43ff0c18 438 #if FSL_FEATURE_UART_HAS_BOTH_EDGE_SAMPLING_SUPPORT
mbed_official 146:f64d43ff0c18 439 /*!
mbed_official 146:f64d43ff0c18 440 * @brief Configure the UART baud rate both edge sampling option. (Note: Feature available on select
mbed_official 146:f64d43ff0c18 441 * UART instances used in conjunction with baud rate programming)
mbed_official 146:f64d43ff0c18 442 *
mbed_official 146:f64d43ff0c18 443 * This function allows the user to directly configure the both edge sampling option.
mbed_official 146:f64d43ff0c18 444 * When enabled, the received data is sampled on both edges of the baud rate clock.
mbed_official 146:f64d43ff0c18 445 * This must be set when the oversampling ratio is between 4x and 7x.
mbed_official 146:f64d43ff0c18 446 * This function should only be called when the receiver is disabled.
mbed_official 146:f64d43ff0c18 447 *
mbed_official 146:f64d43ff0c18 448 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 449 * @param enableBothEdgeSampling Enable (true) or disable (false) Both Edge Sampling option.
mbed_official 146:f64d43ff0c18 450 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 451 */
mbed_official 146:f64d43ff0c18 452 uart_status_t uart_hal_configure_both_edge_sampling(uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 453 bool enableBothEdgeSampling);
mbed_official 146:f64d43ff0c18 454 #endif
mbed_official 146:f64d43ff0c18 455
mbed_official 146:f64d43ff0c18 456 /*!
mbed_official 146:f64d43ff0c18 457 * @brief Configure number of bits per character in the UART controller.
mbed_official 146:f64d43ff0c18 458 *
mbed_official 146:f64d43ff0c18 459 * This function allows the user to configure the number of bits per character according to the
mbed_official 146:f64d43ff0c18 460 * typedef uart_bit_count_per_char_t.
mbed_official 146:f64d43ff0c18 461 * In some UART instances it is required that the transmitter/receiver be disabled
mbed_official 146:f64d43ff0c18 462 * before calling this function.
mbed_official 146:f64d43ff0c18 463 * This may be applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 464 *
mbed_official 146:f64d43ff0c18 465 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 466 * @param bitCountPerChar Number of bits per char (8, 9, or 10, depending on the UART instance).
mbed_official 146:f64d43ff0c18 467 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 468 */
mbed_official 146:f64d43ff0c18 469 uart_status_t uart_hal_configure_bit_count_per_char(uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 470 uart_bit_count_per_char_t bitCountPerChar);
mbed_official 146:f64d43ff0c18 471
mbed_official 146:f64d43ff0c18 472 /*!
mbed_official 146:f64d43ff0c18 473 * @brief Configure the parity mode in the UART controller.
mbed_official 146:f64d43ff0c18 474 *
mbed_official 146:f64d43ff0c18 475 * This function allows the user to configure the parity mode of the UART controller to disable
mbed_official 146:f64d43ff0c18 476 * it or enable it for even parity or for odd parity.
mbed_official 146:f64d43ff0c18 477 * In some UART instances it is required that the transmitter/receiver be disabled
mbed_official 146:f64d43ff0c18 478 * before calling this function.
mbed_official 146:f64d43ff0c18 479 * This may be applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 480 *
mbed_official 146:f64d43ff0c18 481 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 482 * @param parityModeType Parity mode setting (enabled, disable, odd, even - see
mbed_official 146:f64d43ff0c18 483 * parity_mode_t struct).
mbed_official 146:f64d43ff0c18 484 */
mbed_official 146:f64d43ff0c18 485 void uart_hal_configure_parity_mode(uint32_t uartInstance, uart_parity_mode_t parityModeType);
mbed_official 146:f64d43ff0c18 486
mbed_official 146:f64d43ff0c18 487 /*!
mbed_official 146:f64d43ff0c18 488 * @brief Configure the number of stop bits in the UART controller.
mbed_official 146:f64d43ff0c18 489 *
mbed_official 146:f64d43ff0c18 490 * This function allows the user to configure the number of stop bits in the UART controller
mbed_official 146:f64d43ff0c18 491 * to be one or two stop bits.
mbed_official 146:f64d43ff0c18 492 * In some UART instances it is required that the transmitter/receiver be disabled
mbed_official 146:f64d43ff0c18 493 * before calling this function.
mbed_official 146:f64d43ff0c18 494 * This may be applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 495 *
mbed_official 146:f64d43ff0c18 496 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 497 * @param stopBitCount Number of stop bits setting (1 or 2 - see uart_stop_bit_count_t struct).
mbed_official 146:f64d43ff0c18 498 * @return An error code (an unsupported setting in some UARTs) or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 499 */
mbed_official 146:f64d43ff0c18 500 uart_status_t uart_hal_configure_stop_bit_count(uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 501 uart_stop_bit_count_t stopBitCount);
mbed_official 146:f64d43ff0c18 502
mbed_official 146:f64d43ff0c18 503 /*!
mbed_official 146:f64d43ff0c18 504 * @brief Configure the transmit and receive inversion control in UART controller.
mbed_official 146:f64d43ff0c18 505 *
mbed_official 146:f64d43ff0c18 506 * This function allows the user to invert the transmit and receive signals, independently.
mbed_official 146:f64d43ff0c18 507 * This function should only be called when the UART is between transmit and receive packets.
mbed_official 146:f64d43ff0c18 508 *
mbed_official 146:f64d43ff0c18 509 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 510 * @param rxInvert Enable (1) or disable (0) receive inversion.
mbed_official 146:f64d43ff0c18 511 * @param txInvert Enable (1) or disable (0) transmit inversion.
mbed_official 146:f64d43ff0c18 512 */
mbed_official 146:f64d43ff0c18 513 void uart_hal_configure_tx_rx_inversion(uint32_t uartInstance, uint32_t rxInvert,
mbed_official 146:f64d43ff0c18 514 uint32_t txInvert);
mbed_official 146:f64d43ff0c18 515
mbed_official 146:f64d43ff0c18 516 /*!
mbed_official 146:f64d43ff0c18 517 * @brief Enable the UART transmitter.
mbed_official 146:f64d43ff0c18 518 *
mbed_official 146:f64d43ff0c18 519 * This function allows the user to enable the UART transmitter.
mbed_official 146:f64d43ff0c18 520 *
mbed_official 146:f64d43ff0c18 521 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 522 */
mbed_official 146:f64d43ff0c18 523 void uart_hal_enable_transmitter(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 524
mbed_official 146:f64d43ff0c18 525 /*!
mbed_official 146:f64d43ff0c18 526 * @brief Disable the UART transmitter.
mbed_official 146:f64d43ff0c18 527 *
mbed_official 146:f64d43ff0c18 528 * This function allows the user to disable the UART transmitter.
mbed_official 146:f64d43ff0c18 529 *
mbed_official 146:f64d43ff0c18 530 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 531 */
mbed_official 146:f64d43ff0c18 532 void uart_hal_disable_transmitter(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 533
mbed_official 146:f64d43ff0c18 534 /*!
mbed_official 146:f64d43ff0c18 535 * @brief Get the UART transmitter enabled/disabled configuration setting.
mbed_official 146:f64d43ff0c18 536 *
mbed_official 146:f64d43ff0c18 537 * This function allows the user to get the setting of the UART transmitter.
mbed_official 146:f64d43ff0c18 538 *
mbed_official 146:f64d43ff0c18 539 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 540 * @return The state of UART transmitter enable(true)/disable(false) setting.
mbed_official 146:f64d43ff0c18 541 */
mbed_official 146:f64d43ff0c18 542 bool uart_hal_is_transmitter_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 543
mbed_official 146:f64d43ff0c18 544 /*!
mbed_official 146:f64d43ff0c18 545 * @brief Enable the UART receiver.
mbed_official 146:f64d43ff0c18 546 *
mbed_official 146:f64d43ff0c18 547 * This function allows the user to enable the UART receiver.
mbed_official 146:f64d43ff0c18 548 *
mbed_official 146:f64d43ff0c18 549 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 550 */
mbed_official 146:f64d43ff0c18 551 void uart_hal_enable_receiver(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 552
mbed_official 146:f64d43ff0c18 553 /*!
mbed_official 146:f64d43ff0c18 554 * @brief Disable the UART receiver.
mbed_official 146:f64d43ff0c18 555 *
mbed_official 146:f64d43ff0c18 556 * This function allows the user to disable the UART receiver.
mbed_official 146:f64d43ff0c18 557 *
mbed_official 146:f64d43ff0c18 558 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 559 */
mbed_official 146:f64d43ff0c18 560 void uart_hal_disable_receiver(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 561
mbed_official 146:f64d43ff0c18 562 /*!
mbed_official 146:f64d43ff0c18 563 * @brief Get the UART receiver enabled/disabled configuration setting.
mbed_official 146:f64d43ff0c18 564 *
mbed_official 146:f64d43ff0c18 565 * This function allows the user to get the setting of the UART receiver.
mbed_official 146:f64d43ff0c18 566 *
mbed_official 146:f64d43ff0c18 567 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 568 * @return The state of UART receiver enable(true)/disable(false) setting.
mbed_official 146:f64d43ff0c18 569 */
mbed_official 146:f64d43ff0c18 570 bool uart_hal_is_receiver_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 571
mbed_official 146:f64d43ff0c18 572 /*@}*/
mbed_official 146:f64d43ff0c18 573
mbed_official 146:f64d43ff0c18 574 /*!
mbed_official 146:f64d43ff0c18 575 * @name UART Interrupts and DMA
mbed_official 146:f64d43ff0c18 576 * @{
mbed_official 146:f64d43ff0c18 577 */
mbed_official 146:f64d43ff0c18 578
mbed_official 146:f64d43ff0c18 579 /*!
mbed_official 146:f64d43ff0c18 580 * @brief Configure the UART module interrupts to enable/disable various interrupt sources.
mbed_official 146:f64d43ff0c18 581 *
mbed_official 146:f64d43ff0c18 582 * This function allows the user to configure all of the UART interrupts with one function call.
mbed_official 146:f64d43ff0c18 583 * The user will first need to initialize and pass in a structure of type uart_interrupt_config_t
mbed_official 146:f64d43ff0c18 584 * which sets the configuration of each interrupt.
mbed_official 146:f64d43ff0c18 585 *
mbed_official 146:f64d43ff0c18 586 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 587 * @param interruptConfig UART interrupt configuration data.
mbed_official 146:f64d43ff0c18 588 */
mbed_official 146:f64d43ff0c18 589 void uart_hal_configure_interrupts(uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 590 const uart_interrupt_config_t * interruptConfig);
mbed_official 146:f64d43ff0c18 591
mbed_official 146:f64d43ff0c18 592 /*!
mbed_official 146:f64d43ff0c18 593 * @brief Enable the break_detect_interrupt.
mbed_official 146:f64d43ff0c18 594 *
mbed_official 146:f64d43ff0c18 595 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 596 */
mbed_official 146:f64d43ff0c18 597 void uart_hal_enable_break_detect_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 598
mbed_official 146:f64d43ff0c18 599 /*!
mbed_official 146:f64d43ff0c18 600 * @brief Disable the break_detect_interrupt.
mbed_official 146:f64d43ff0c18 601 *
mbed_official 146:f64d43ff0c18 602 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 603 */
mbed_official 146:f64d43ff0c18 604 void uart_hal_disable_break_detect_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 605
mbed_official 146:f64d43ff0c18 606 /*!
mbed_official 146:f64d43ff0c18 607 * @brief Get the configuration of the break_detect_interrupt enable setting.
mbed_official 146:f64d43ff0c18 608 *
mbed_official 146:f64d43ff0c18 609 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 610 * @return The bit setting of the interrupt enable bit.
mbed_official 146:f64d43ff0c18 611 */
mbed_official 146:f64d43ff0c18 612 bool uart_hal_is_break_detect_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 613
mbed_official 146:f64d43ff0c18 614 /*!
mbed_official 146:f64d43ff0c18 615 * @brief Enable the rx_active_edge_interrupt.
mbed_official 146:f64d43ff0c18 616 *
mbed_official 146:f64d43ff0c18 617 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 618 */
mbed_official 146:f64d43ff0c18 619 void uart_hal_enable_rx_active_edge_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 620
mbed_official 146:f64d43ff0c18 621 /*!
mbed_official 146:f64d43ff0c18 622 * @brief Disable the rx_active_edge_interrupt.
mbed_official 146:f64d43ff0c18 623 *
mbed_official 146:f64d43ff0c18 624 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 625 */
mbed_official 146:f64d43ff0c18 626 void uart_hal_disable_rx_active_edge_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 627
mbed_official 146:f64d43ff0c18 628 /*!
mbed_official 146:f64d43ff0c18 629 * @brief Get the configuration of the rx_active_edge_interrupt enable setting.
mbed_official 146:f64d43ff0c18 630 *
mbed_official 146:f64d43ff0c18 631 * @param uartInstance UART instance number.
mbed_official 146:f64d43ff0c18 632 * @return Bit setting of the interrupt enable bit.
mbed_official 146:f64d43ff0c18 633 */
mbed_official 146:f64d43ff0c18 634 bool uart_hal_is_rx_active_edge_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 635
mbed_official 146:f64d43ff0c18 636 /*!
mbed_official 146:f64d43ff0c18 637 * @brief Enable the tx_data_register_empty_interrupt.
mbed_official 146:f64d43ff0c18 638 *
mbed_official 146:f64d43ff0c18 639 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 640 */
mbed_official 146:f64d43ff0c18 641 void uart_hal_enable_tx_data_register_empty_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 642
mbed_official 146:f64d43ff0c18 643 /*!
mbed_official 146:f64d43ff0c18 644 * @brief Disable the tx_data_register_empty_interrupt.
mbed_official 146:f64d43ff0c18 645 *
mbed_official 146:f64d43ff0c18 646 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 647 */
mbed_official 146:f64d43ff0c18 648 void uart_hal_disable_tx_data_register_empty_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 649
mbed_official 146:f64d43ff0c18 650 /*!
mbed_official 146:f64d43ff0c18 651 * @brief Get the configuration of the tx_data_register_empty_interrupt enable setting.
mbed_official 146:f64d43ff0c18 652 *
mbed_official 146:f64d43ff0c18 653 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 654 * @return Bit setting of the interrupt enable bit.
mbed_official 146:f64d43ff0c18 655 */
mbed_official 146:f64d43ff0c18 656 bool uart_hal_is_tx_data_register_empty_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 657
mbed_official 146:f64d43ff0c18 658 /*!
mbed_official 146:f64d43ff0c18 659 * @brief Enable the transmission_complete_interrupt.
mbed_official 146:f64d43ff0c18 660 *
mbed_official 146:f64d43ff0c18 661 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 662 */
mbed_official 146:f64d43ff0c18 663 void uart_hal_enable_transmission_complete_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 664
mbed_official 146:f64d43ff0c18 665 /*!
mbed_official 146:f64d43ff0c18 666 * @brief Disable the transmission_complete_interrupt.
mbed_official 146:f64d43ff0c18 667 *
mbed_official 146:f64d43ff0c18 668 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 669 */
mbed_official 146:f64d43ff0c18 670 void uart_hal_disable_transmission_complete_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 671
mbed_official 146:f64d43ff0c18 672 /*!
mbed_official 146:f64d43ff0c18 673 * @brief Get the configuration of the transmission_complete_interrupt enable setting.
mbed_official 146:f64d43ff0c18 674 *
mbed_official 146:f64d43ff0c18 675 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 676 * @return Bit setting of the interrupt enable bit.
mbed_official 146:f64d43ff0c18 677 */
mbed_official 146:f64d43ff0c18 678 bool uart_hal_is_transmission_complete_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 679
mbed_official 146:f64d43ff0c18 680 /*!
mbed_official 146:f64d43ff0c18 681 * @brief Enable the rx_data_register_full_interrupt.
mbed_official 146:f64d43ff0c18 682 *
mbed_official 146:f64d43ff0c18 683 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 684 */
mbed_official 146:f64d43ff0c18 685 void uart_hal_enable_rx_data_register_full_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 686
mbed_official 146:f64d43ff0c18 687 /*!
mbed_official 146:f64d43ff0c18 688 * @brief Disable the rx_data_register_full_interrupt.
mbed_official 146:f64d43ff0c18 689 *
mbed_official 146:f64d43ff0c18 690 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 691 */
mbed_official 146:f64d43ff0c18 692 void uart_hal_disable_rx_data_register_full_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 693
mbed_official 146:f64d43ff0c18 694 /*!
mbed_official 146:f64d43ff0c18 695 * @brief Get the configuration of the rx_data_register_full_interrupt enable setting.
mbed_official 146:f64d43ff0c18 696 *
mbed_official 146:f64d43ff0c18 697 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 698 * @return Bit setting of the interrupt enable bit.
mbed_official 146:f64d43ff0c18 699 */
mbed_official 146:f64d43ff0c18 700 bool uart_hal_is_receive_data_full_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 701
mbed_official 146:f64d43ff0c18 702 /*!
mbed_official 146:f64d43ff0c18 703 * @brief Enable the idle_line_interrupt.
mbed_official 146:f64d43ff0c18 704 *
mbed_official 146:f64d43ff0c18 705 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 706 */
mbed_official 146:f64d43ff0c18 707 void uart_hal_enable_idle_line_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 708
mbed_official 146:f64d43ff0c18 709 /*!
mbed_official 146:f64d43ff0c18 710 * @brief Disable the idle_line_interrupt.
mbed_official 146:f64d43ff0c18 711 *
mbed_official 146:f64d43ff0c18 712 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 713 */
mbed_official 146:f64d43ff0c18 714 void uart_hal_disable_idle_line_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 715
mbed_official 146:f64d43ff0c18 716 /*!
mbed_official 146:f64d43ff0c18 717 * @brief Get the configuration of the idle_line_interrupt enable setting.
mbed_official 146:f64d43ff0c18 718 *
mbed_official 146:f64d43ff0c18 719 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 720 * @return Bit setting of the interrupt enable bit.
mbed_official 146:f64d43ff0c18 721 */
mbed_official 146:f64d43ff0c18 722 bool uart_hal_is_idle_line_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 723
mbed_official 146:f64d43ff0c18 724 /*!
mbed_official 146:f64d43ff0c18 725 * @brief Enable the rx_overrun_interrupt.
mbed_official 146:f64d43ff0c18 726 *
mbed_official 146:f64d43ff0c18 727 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 728 */
mbed_official 146:f64d43ff0c18 729 void uart_hal_enable_rx_overrun_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 730
mbed_official 146:f64d43ff0c18 731 /*!
mbed_official 146:f64d43ff0c18 732 * @brief Disable the rx_overrun_interrupt.
mbed_official 146:f64d43ff0c18 733 *
mbed_official 146:f64d43ff0c18 734 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 735 */
mbed_official 146:f64d43ff0c18 736 void uart_hal_disable_rx_overrun_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 737
mbed_official 146:f64d43ff0c18 738 /*!
mbed_official 146:f64d43ff0c18 739 * @brief Get the configuration of the rx_overrun_interrupt enable setting.
mbed_official 146:f64d43ff0c18 740 *
mbed_official 146:f64d43ff0c18 741 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 742 * @return Bit setting of the interrupt enable bit .
mbed_official 146:f64d43ff0c18 743 */
mbed_official 146:f64d43ff0c18 744 bool uart_hal_is_rx_overrun_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 745
mbed_official 146:f64d43ff0c18 746 /*!
mbed_official 146:f64d43ff0c18 747 * @brief Enable the noise_error_interrupt.
mbed_official 146:f64d43ff0c18 748 *
mbed_official 146:f64d43ff0c18 749 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 750 */
mbed_official 146:f64d43ff0c18 751 void uart_hal_enable_noise_error_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 752
mbed_official 146:f64d43ff0c18 753 /*!
mbed_official 146:f64d43ff0c18 754 * @brief Disable the noise_error_interrupt.
mbed_official 146:f64d43ff0c18 755 *
mbed_official 146:f64d43ff0c18 756 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 757 */
mbed_official 146:f64d43ff0c18 758 void uart_hal_disable_noise_error_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 759
mbed_official 146:f64d43ff0c18 760 /*!
mbed_official 146:f64d43ff0c18 761 * @brief Get the configuration of the noise_error_interrupt enable setting.
mbed_official 146:f64d43ff0c18 762 *
mbed_official 146:f64d43ff0c18 763 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 764 * @return Bit setting of the interrupt enable bit.
mbed_official 146:f64d43ff0c18 765 */
mbed_official 146:f64d43ff0c18 766 bool uart_hal_is_noise_error_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 767
mbed_official 146:f64d43ff0c18 768 /*!
mbed_official 146:f64d43ff0c18 769 * @brief Enable the framing_error_interrupt.
mbed_official 146:f64d43ff0c18 770 *
mbed_official 146:f64d43ff0c18 771 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 772 */
mbed_official 146:f64d43ff0c18 773 void uart_hal_enable_framing_error_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 774
mbed_official 146:f64d43ff0c18 775 /*!
mbed_official 146:f64d43ff0c18 776 * @brief Disable the framing_error_interrupt.
mbed_official 146:f64d43ff0c18 777 *
mbed_official 146:f64d43ff0c18 778 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 779 */
mbed_official 146:f64d43ff0c18 780 void uart_hal_disable_framing_error_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 781
mbed_official 146:f64d43ff0c18 782 /*!
mbed_official 146:f64d43ff0c18 783 * @brief Get the configuration of the framing_error_interrupt enable setting.
mbed_official 146:f64d43ff0c18 784 *
mbed_official 146:f64d43ff0c18 785 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 786 * @return Bit setting of the interrupt enable bit.
mbed_official 146:f64d43ff0c18 787 */
mbed_official 146:f64d43ff0c18 788 bool uart_hal_is_framing_error_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 789
mbed_official 146:f64d43ff0c18 790 /*!
mbed_official 146:f64d43ff0c18 791 * @brief Enable the parity_error_interrupt.
mbed_official 146:f64d43ff0c18 792 *
mbed_official 146:f64d43ff0c18 793 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 794 */
mbed_official 146:f64d43ff0c18 795 void uart_hal_enable_parity_error_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 796
mbed_official 146:f64d43ff0c18 797 /*!
mbed_official 146:f64d43ff0c18 798 * @brief Disable the parity_error_interrupt.
mbed_official 146:f64d43ff0c18 799 *
mbed_official 146:f64d43ff0c18 800 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 801 */
mbed_official 146:f64d43ff0c18 802 void uart_hal_disable_parity_error_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 803
mbed_official 146:f64d43ff0c18 804 /*!
mbed_official 146:f64d43ff0c18 805 * @brief Get the configuration of the parity_error_interrupt enable setting.
mbed_official 146:f64d43ff0c18 806 *
mbed_official 146:f64d43ff0c18 807 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 808 * @return Bit setting of the interrupt enable bit.
mbed_official 146:f64d43ff0c18 809 */
mbed_official 146:f64d43ff0c18 810 bool uart_hal_is_parity_error_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 811
mbed_official 146:f64d43ff0c18 812 /*!
mbed_official 146:f64d43ff0c18 813 * @brief Configure the UART DMA requests for the Transmitter and Receiver.
mbed_official 146:f64d43ff0c18 814 *
mbed_official 146:f64d43ff0c18 815 * This function allows the user to configure the transmit data register empty flag to
mbed_official 146:f64d43ff0c18 816 * generate an interrupt request (default) or a DMA request. Similarly, this function
mbed_official 146:f64d43ff0c18 817 * allows the user to configure the receive data register full flag to generate an interrupt
mbed_official 146:f64d43ff0c18 818 * request (default) or a DMA request.
mbed_official 146:f64d43ff0c18 819 *
mbed_official 146:f64d43ff0c18 820 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 821 * @param txDmaConfig Transmit DMA request configuration setting (enable: true /disable: false).
mbed_official 146:f64d43ff0c18 822 * @param rxDmaConfig Receive DMA request configuration setting (enable: true/disable: false).
mbed_official 146:f64d43ff0c18 823 */
mbed_official 146:f64d43ff0c18 824 void uart_hal_configure_dma(uint32_t uartInstance, bool txDmaConfig, bool rxDmaConfig);
mbed_official 146:f64d43ff0c18 825
mbed_official 146:f64d43ff0c18 826 /*!
mbed_official 146:f64d43ff0c18 827 * @brief Get the UART Transmit DMA request configuration setting.
mbed_official 146:f64d43ff0c18 828 *
mbed_official 146:f64d43ff0c18 829 * This function returns the configuration setting of the Transmit DMA request.
mbed_official 146:f64d43ff0c18 830 *
mbed_official 146:f64d43ff0c18 831 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 832 * @return Transmit DMA request configuration setting (enable: true /disable: false).
mbed_official 146:f64d43ff0c18 833 */
mbed_official 146:f64d43ff0c18 834 bool uart_hal_is_txdma_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 835
mbed_official 146:f64d43ff0c18 836 /*!
mbed_official 146:f64d43ff0c18 837 * @brief Get the UART Receive DMA request configuration setting.
mbed_official 146:f64d43ff0c18 838 *
mbed_official 146:f64d43ff0c18 839 * This function returns the configuration setting of the Receive DMA request.
mbed_official 146:f64d43ff0c18 840 *
mbed_official 146:f64d43ff0c18 841 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 842 * @return Receive DMA request configuration setting (enable: true /disable: false).
mbed_official 146:f64d43ff0c18 843 */
mbed_official 146:f64d43ff0c18 844 bool uart_hal_is_rxdma_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 845
mbed_official 146:f64d43ff0c18 846 /*@}*/
mbed_official 146:f64d43ff0c18 847
mbed_official 146:f64d43ff0c18 848 /*!
mbed_official 146:f64d43ff0c18 849 * @name UART Transfer Functions
mbed_official 146:f64d43ff0c18 850 * @{
mbed_official 146:f64d43ff0c18 851 */
mbed_official 146:f64d43ff0c18 852
mbed_official 146:f64d43ff0c18 853 /*!
mbed_official 146:f64d43ff0c18 854 * @brief This function allows the user to send an 8-bit character from the UART data register.
mbed_official 146:f64d43ff0c18 855 *
mbed_official 146:f64d43ff0c18 856 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 857 * @param data The data to send of size 8-bit.
mbed_official 146:f64d43ff0c18 858 */
mbed_official 146:f64d43ff0c18 859 void uart_hal_putchar(uint32_t uartInstance, uint8_t data);
mbed_official 146:f64d43ff0c18 860
mbed_official 146:f64d43ff0c18 861 /*!
mbed_official 146:f64d43ff0c18 862 * @brief This function allows the user to send a 9-bit character from the UART data register.
mbed_official 146:f64d43ff0c18 863 *
mbed_official 146:f64d43ff0c18 864 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 865 * @param data The data to send of size 9-bit.
mbed_official 146:f64d43ff0c18 866 */
mbed_official 146:f64d43ff0c18 867 void uart_hal_putchar9(uint32_t uartInstance, uint16_t data);
mbed_official 146:f64d43ff0c18 868
mbed_official 146:f64d43ff0c18 869 /*!
mbed_official 146:f64d43ff0c18 870 * @brief This function allows the user to send a 10-bit character from the UART data register.
mbed_official 146:f64d43ff0c18 871 * (Note: Feature available on select UART instances)
mbed_official 146:f64d43ff0c18 872 *
mbed_official 146:f64d43ff0c18 873 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 874 * @param data The data to send of size 10-bit.
mbed_official 146:f64d43ff0c18 875 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 876 */
mbed_official 146:f64d43ff0c18 877 uart_status_t uart_hal_putchar10(uint32_t uartInstance, uint16_t data);
mbed_official 146:f64d43ff0c18 878
mbed_official 146:f64d43ff0c18 879 /*!
mbed_official 146:f64d43ff0c18 880 * @brief This function gets a received 8-bit character from the UART data register.
mbed_official 146:f64d43ff0c18 881 *
mbed_official 146:f64d43ff0c18 882 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 883 * @param readData The received data read from data register of size 8-bit.
mbed_official 146:f64d43ff0c18 884 */
mbed_official 146:f64d43ff0c18 885 void uart_hal_getchar(uint32_t uartInstance, uint8_t *readData);
mbed_official 146:f64d43ff0c18 886
mbed_official 146:f64d43ff0c18 887 /*!
mbed_official 146:f64d43ff0c18 888 * @brief This function gets a received 9-bit character from the UART data register.
mbed_official 146:f64d43ff0c18 889 *
mbed_official 146:f64d43ff0c18 890 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 891 * @param readData The received data read from data register of size 9-bit.
mbed_official 146:f64d43ff0c18 892 */
mbed_official 146:f64d43ff0c18 893 void uart_hal_getchar9(uint32_t uartInstance, uint16_t *readData);
mbed_official 146:f64d43ff0c18 894
mbed_official 146:f64d43ff0c18 895 /*!
mbed_official 146:f64d43ff0c18 896 * @brief This function gets a received 10-bit character from the UART data register.
mbed_official 146:f64d43ff0c18 897 * (Note: Feature available on select UART instances)
mbed_official 146:f64d43ff0c18 898 *
mbed_official 146:f64d43ff0c18 899 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 900 * @param readData The received data read from data register of size 10-bit.
mbed_official 146:f64d43ff0c18 901 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 902 */
mbed_official 146:f64d43ff0c18 903 uart_status_t uart_hal_getchar10(uint32_t uartInstance, uint16_t *readData);
mbed_official 146:f64d43ff0c18 904
mbed_official 146:f64d43ff0c18 905 #if FSL_FEATURE_UART_HAS_EXTENDED_DATA_REGISTER_FLAGS
mbed_official 146:f64d43ff0c18 906 /*!
mbed_official 146:f64d43ff0c18 907 * @brief Configure the UART bit 10 (if enabled) or bit 9 (if disabled) as the parity bit in the
mbed_official 146:f64d43ff0c18 908 * serial transmission.
mbed_official 146:f64d43ff0c18 909 *
mbed_official 146:f64d43ff0c18 910 * This function configures bit 10 or bit 9 to be the parity bit. To configure bit 10 as the parity
mbed_official 146:f64d43ff0c18 911 * bit, the function sets UARTx_C4[M10]; it also sets UARTx_C1[M] and UARTx_C1[PE] as required.
mbed_official 146:f64d43ff0c18 912 *
mbed_official 146:f64d43ff0c18 913 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 914 * @param enable The setting to enable (true), which configures bit 10 as the parity bit or to
mbed_official 146:f64d43ff0c18 915 * disable (false), which configures bit 9 as the parity bit in the serial
mbed_official 146:f64d43ff0c18 916 * transmission.
mbed_official 146:f64d43ff0c18 917 */
mbed_official 146:f64d43ff0c18 918 void uart_hal_configure_bit10_as_paritybit_operation(uint32_t uartInstance, bool enable);
mbed_official 146:f64d43ff0c18 919
mbed_official 146:f64d43ff0c18 920 /*!
mbed_official 146:f64d43ff0c18 921 * @brief Get the configuration of the UART bit 10 (if enabled) or bit 9 (if disabled) as the
mbed_official 146:f64d43ff0c18 922 * parity bit in the serial transmission.
mbed_official 146:f64d43ff0c18 923 *
mbed_official 146:f64d43ff0c18 924 * This function returns true if bit 10 is configured as the parity bit, otherwise it returns
mbed_official 146:f64d43ff0c18 925 * false if bit 9 is configured as the parity bit.
mbed_official 146:f64d43ff0c18 926 *
mbed_official 146:f64d43ff0c18 927 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 928 * @return The configuration setting of bit 10 (true), or bit 9 (false) as the
mbed_official 146:f64d43ff0c18 929 * parity bit in the serial transmission.
mbed_official 146:f64d43ff0c18 930 */
mbed_official 146:f64d43ff0c18 931 bool uart_hal_is_bit10_set_as_paritybit(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 932
mbed_official 146:f64d43ff0c18 933 /*!
mbed_official 146:f64d43ff0c18 934 * @brief Determine if the UART received data word was received with noise.
mbed_official 146:f64d43ff0c18 935 *
mbed_official 146:f64d43ff0c18 936 * This function returns true if the received data word was received with noise. Otherwise,
mbed_official 146:f64d43ff0c18 937 * it returns false indicating no noise was detected.
mbed_official 146:f64d43ff0c18 938 *
mbed_official 146:f64d43ff0c18 939 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 940 * @return The status of the NOISY bit in the UART extended data register.
mbed_official 146:f64d43ff0c18 941 */
mbed_official 146:f64d43ff0c18 942 bool uart_hal_is_current_dataword_received_with_noise(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 943
mbed_official 146:f64d43ff0c18 944 /*!
mbed_official 146:f64d43ff0c18 945 * @brief Determine if the UART received data word was received with a parity error.
mbed_official 146:f64d43ff0c18 946 *
mbed_official 146:f64d43ff0c18 947 * This function returns true if the received data word was received with a parity error.
mbed_official 146:f64d43ff0c18 948 * Otherwise, it returns false indicating no parity error was detected.
mbed_official 146:f64d43ff0c18 949 *
mbed_official 146:f64d43ff0c18 950 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 951 * @return The status of the PARITYE (parity error) bit in the UART extended data register.
mbed_official 146:f64d43ff0c18 952 */
mbed_official 146:f64d43ff0c18 953 bool uart_hal_is_current_dataword_received_with_parityerror(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 954 #endif /* FSL_FEATURE_UART_HAS_EXTENDED_DATA_REGISTER_FLAGS*/
mbed_official 146:f64d43ff0c18 955
mbed_official 146:f64d43ff0c18 956 /*@}*/
mbed_official 146:f64d43ff0c18 957
mbed_official 146:f64d43ff0c18 958 /*!
mbed_official 146:f64d43ff0c18 959 * @name UART Special Feature Configurations
mbed_official 146:f64d43ff0c18 960 * @{
mbed_official 146:f64d43ff0c18 961 */
mbed_official 146:f64d43ff0c18 962
mbed_official 146:f64d43ff0c18 963 /*!
mbed_official 146:f64d43ff0c18 964 * @brief Configure the UART to either operate or cease to operate in WAIT mode.
mbed_official 146:f64d43ff0c18 965 *
mbed_official 146:f64d43ff0c18 966 * The function configures the UART to either operate or cease to operate when WAIT mode is
mbed_official 146:f64d43ff0c18 967 * entered.
mbed_official 146:f64d43ff0c18 968 * In some UART instances it is required that the transmitter/receiver be disabled
mbed_official 146:f64d43ff0c18 969 * before calling this function.
mbed_official 146:f64d43ff0c18 970 * This may be applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 971 *
mbed_official 146:f64d43ff0c18 972 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 973 * @param mode The UART WAIT mode operation - operates or ceases to operate in WAIT mode.
mbed_official 146:f64d43ff0c18 974 */
mbed_official 146:f64d43ff0c18 975 void uart_hal_configure_wait_mode_operation(uint32_t uartInstance, uart_operation_config_t mode);
mbed_official 146:f64d43ff0c18 976
mbed_official 146:f64d43ff0c18 977 /*!
mbed_official 146:f64d43ff0c18 978 * @brief Determine if the UART operates or ceases to operate in WAIT mode.
mbed_official 146:f64d43ff0c18 979 *
mbed_official 146:f64d43ff0c18 980 * This function returns kUartOperates if the UART has been configured to operate in WAIT mode.
mbed_official 146:f64d43ff0c18 981 * Else it returns KUartStops if the UART has been configured to cease-to-operate in WAIT mode.
mbed_official 146:f64d43ff0c18 982 *
mbed_official 146:f64d43ff0c18 983 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 984 * @return The UART WAIT mode operation configuration, returns either kUartOperates or KUartStops.
mbed_official 146:f64d43ff0c18 985 */
mbed_official 146:f64d43ff0c18 986 uart_operation_config_t uart_hal_get_wait_mode_operation_config(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 987
mbed_official 146:f64d43ff0c18 988 /*!
mbed_official 146:f64d43ff0c18 989 * @brief Configure the UART loopback operation.
mbed_official 146:f64d43ff0c18 990 *
mbed_official 146:f64d43ff0c18 991 * This function enables or disables the UART loopback operation.
mbed_official 146:f64d43ff0c18 992 * In some UART instances it is required that the transmitter/receiver be disabled
mbed_official 146:f64d43ff0c18 993 * before calling this function.
mbed_official 146:f64d43ff0c18 994 * This may be applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 995 *
mbed_official 146:f64d43ff0c18 996 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 997 * @param enable The UART loopback mode configuration, either disabled (false) or enabled (true).
mbed_official 146:f64d43ff0c18 998 */
mbed_official 146:f64d43ff0c18 999 void uart_hal_configure_loopback_mode(uint32_t uartInstance, bool enable);
mbed_official 146:f64d43ff0c18 1000
mbed_official 146:f64d43ff0c18 1001 /*!
mbed_official 146:f64d43ff0c18 1002 * @brief Configure the UART single-wire operation.
mbed_official 146:f64d43ff0c18 1003 *
mbed_official 146:f64d43ff0c18 1004 * This function enables or disables the UART single-wire operation.
mbed_official 146:f64d43ff0c18 1005 * In some UART instances it is required that the transmitter/receiver be disabled
mbed_official 146:f64d43ff0c18 1006 * before calling this function.
mbed_official 146:f64d43ff0c18 1007 * This may be applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 1008 *
mbed_official 146:f64d43ff0c18 1009 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1010 * @param enable The UART single-wire mode configuration, either disabled (false) or enabled (true).
mbed_official 146:f64d43ff0c18 1011 */
mbed_official 146:f64d43ff0c18 1012 void uart_hal_configure_singlewire_mode(uint32_t uartInstance, bool enable);
mbed_official 146:f64d43ff0c18 1013
mbed_official 146:f64d43ff0c18 1014 /*!
mbed_official 146:f64d43ff0c18 1015 * @brief Configure the UART transmit direction while in single-wire mode.
mbed_official 146:f64d43ff0c18 1016 *
mbed_official 146:f64d43ff0c18 1017 * This function configures the transmitter direction when the UART is configured for single-wire
mbed_official 146:f64d43ff0c18 1018 * operation.
mbed_official 146:f64d43ff0c18 1019 *
mbed_official 146:f64d43ff0c18 1020 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1021 * @param direction The UART single-wire mode transmit direction configuration of type
mbed_official 146:f64d43ff0c18 1022 * uart_singlewire_txdir_t (either kUartSinglewireTxdirIn or
mbed_official 146:f64d43ff0c18 1023 * kUartSinglewireTxdirOut.
mbed_official 146:f64d43ff0c18 1024 */
mbed_official 146:f64d43ff0c18 1025 void uart_hal_configure_txdir_in_singlewire_mode(uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 1026 uart_singlewire_txdir_t direction);
mbed_official 146:f64d43ff0c18 1027
mbed_official 146:f64d43ff0c18 1028 /*!
mbed_official 146:f64d43ff0c18 1029 * @brief Place the UART receiver in standby mode.
mbed_official 146:f64d43ff0c18 1030 *
mbed_official 146:f64d43ff0c18 1031 * This function, when called, places the UART receiver into standby mode.
mbed_official 146:f64d43ff0c18 1032 * In some UART instances, there are conditions that must be met before placing rx in standby mode.
mbed_official 146:f64d43ff0c18 1033 * Before placing UART in standby, determine if receiver is set to
mbed_official 146:f64d43ff0c18 1034 * wake on idle, and if receiver is already in idle state.
mbed_official 146:f64d43ff0c18 1035 * NOTE: RWU should only be set with C1[WAKE] = 0 (wakeup on idle) if the channel is currently
mbed_official 146:f64d43ff0c18 1036 * not idle.
mbed_official 146:f64d43ff0c18 1037 * This can be determined by the S2[RAF] flag. If set to wake up FROM an IDLE event and the channel
mbed_official 146:f64d43ff0c18 1038 * is already idle, it is possible that the UART will discard data because data must be received
mbed_official 146:f64d43ff0c18 1039 * (or a LIN break detect) after an IDLE is detected before IDLE is allowed to be reasserted.
mbed_official 146:f64d43ff0c18 1040 *
mbed_official 146:f64d43ff0c18 1041 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1042 * @return Error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1043 */
mbed_official 146:f64d43ff0c18 1044 uart_status_t uart_hal_put_receiver_in_standby_mode(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1045
mbed_official 146:f64d43ff0c18 1046 /*!
mbed_official 146:f64d43ff0c18 1047 * @brief Place the UART receiver in normal mode (disable standby mode operation).
mbed_official 146:f64d43ff0c18 1048 *
mbed_official 146:f64d43ff0c18 1049 * This function, when called, places the UART receiver into normal mode and out of
mbed_official 146:f64d43ff0c18 1050 * standby mode.
mbed_official 146:f64d43ff0c18 1051 *
mbed_official 146:f64d43ff0c18 1052 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1053 */
mbed_official 146:f64d43ff0c18 1054 void uart_hal_put_receiver_in_normal_mode(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1055
mbed_official 146:f64d43ff0c18 1056 /*!
mbed_official 146:f64d43ff0c18 1057 * @brief Determine if the UART receiver is currently in standby mode.
mbed_official 146:f64d43ff0c18 1058 *
mbed_official 146:f64d43ff0c18 1059 * This function determines the state of the UART receiver. If it returns true, this means
mbed_official 146:f64d43ff0c18 1060 * that the UART receiver is in standby mode; if it returns false, the UART receiver
mbed_official 146:f64d43ff0c18 1061 * is in normal mode.
mbed_official 146:f64d43ff0c18 1062 *
mbed_official 146:f64d43ff0c18 1063 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1064 * @return The UART receiver is in normal mode (false) or standby mode (true).
mbed_official 146:f64d43ff0c18 1065 */
mbed_official 146:f64d43ff0c18 1066 bool uart_hal_is_receiver_in_standby(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1067
mbed_official 146:f64d43ff0c18 1068 /*!
mbed_official 146:f64d43ff0c18 1069 * @brief Select the UART receiver wakeup method (idle-line or address-mark) from standby mode.
mbed_official 146:f64d43ff0c18 1070 *
mbed_official 146:f64d43ff0c18 1071 * This function configures the wakeup method of the UART receiver from standby mode. The options
mbed_official 146:f64d43ff0c18 1072 * are idle-line wake or address-mark wake.
mbed_official 146:f64d43ff0c18 1073 *
mbed_official 146:f64d43ff0c18 1074 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1075 * @param method The UART receiver wakeup method options: kUartIdleLineWake - Idle-line wake or
mbed_official 146:f64d43ff0c18 1076 * kUartAddrMarkWake - address-mark wake.
mbed_official 146:f64d43ff0c18 1077 */
mbed_official 146:f64d43ff0c18 1078 void uart_hal_select_receiver_wakeup_method(uint32_t uartInstance, uart_wakeup_method_t method);
mbed_official 146:f64d43ff0c18 1079
mbed_official 146:f64d43ff0c18 1080 /*!
mbed_official 146:f64d43ff0c18 1081 * @brief Get the UART receiver wakeup method (idle-line or address-mark) from standby mode.
mbed_official 146:f64d43ff0c18 1082 *
mbed_official 146:f64d43ff0c18 1083 * This function returns how the UART receiver is configured to wake from standby mode. The
mbed_official 146:f64d43ff0c18 1084 * wake method options that can be returned are kUartIdleLineWake or kUartAddrMarkWake.
mbed_official 146:f64d43ff0c18 1085 *
mbed_official 146:f64d43ff0c18 1086 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1087 * @return The UART receiver wakeup from standby method, false: kUartIdleLineWake (idle-line wake)
mbed_official 146:f64d43ff0c18 1088 * or true: kUartAddrMarkWake (address-mark wake).
mbed_official 146:f64d43ff0c18 1089 */
mbed_official 146:f64d43ff0c18 1090 uart_wakeup_method_t uart_hal_get_receiver_wakeup_method(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1091
mbed_official 146:f64d43ff0c18 1092 /*!
mbed_official 146:f64d43ff0c18 1093 * @brief Configure the operation options of the UART idle line detect.
mbed_official 146:f64d43ff0c18 1094 *
mbed_official 146:f64d43ff0c18 1095 * This function allows the user to configure the UART idle-line detect operation. There are two
mbed_official 146:f64d43ff0c18 1096 * separate operations for the user to configure, the idle line bit-count start and the receive
mbed_official 146:f64d43ff0c18 1097 * wake up affect on IDLE status bit. The user will pass in a structure of type
mbed_official 146:f64d43ff0c18 1098 * uart_idle_line_config_t.
mbed_official 146:f64d43ff0c18 1099 * In some UART instances it is required that the transmitter/receiver be disabled
mbed_official 146:f64d43ff0c18 1100 * before calling this function.
mbed_official 146:f64d43ff0c18 1101 * This may be applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 1102 *
mbed_official 146:f64d43ff0c18 1103 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1104 * @param config The UART configuration pointer to the structure for idle-line detect operation
mbed_official 146:f64d43ff0c18 1105 * of type uart_idle_line_config_t.
mbed_official 146:f64d43ff0c18 1106 */
mbed_official 146:f64d43ff0c18 1107 void uart_hal_configure_idle_line_detect(uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 1108 const uart_idle_line_config_t *config);
mbed_official 146:f64d43ff0c18 1109
mbed_official 146:f64d43ff0c18 1110 /*!
mbed_official 146:f64d43ff0c18 1111 * @brief Configure the UART break character transmit length.
mbed_official 146:f64d43ff0c18 1112 *
mbed_official 146:f64d43ff0c18 1113 * This function allows the user to configure the UART break character transmit length. Refer to
mbed_official 146:f64d43ff0c18 1114 * the typedef uart_break_char_length_t for setting options.
mbed_official 146:f64d43ff0c18 1115 * In some UART instances it is required that the transmitter be disabled before calling
mbed_official 146:f64d43ff0c18 1116 * this function. This may be applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 1117 *
mbed_official 146:f64d43ff0c18 1118 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1119 * @param length The UART break character length setting of type uart_break_char_length_t, either a
mbed_official 146:f64d43ff0c18 1120 * minimum 10-bit times or a minimum 13-bit times.
mbed_official 146:f64d43ff0c18 1121 */
mbed_official 146:f64d43ff0c18 1122 void uart_hal_set_break_char_transmit_length(uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 1123 uart_break_char_length_t length);
mbed_official 146:f64d43ff0c18 1124
mbed_official 146:f64d43ff0c18 1125 /*!
mbed_official 146:f64d43ff0c18 1126 * @brief Configure the UART break character detect length.
mbed_official 146:f64d43ff0c18 1127 *
mbed_official 146:f64d43ff0c18 1128 * This function allows the user to configure the UART break character detect length. Refer to
mbed_official 146:f64d43ff0c18 1129 * the typedef uart_break_char_length_t for setting options.
mbed_official 146:f64d43ff0c18 1130 *
mbed_official 146:f64d43ff0c18 1131 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1132 * @param length The UART break character length setting of type uart_break_char_length_t, either a
mbed_official 146:f64d43ff0c18 1133 * minimum 10-bit times or a minimum 13-bit times.
mbed_official 146:f64d43ff0c18 1134 */
mbed_official 146:f64d43ff0c18 1135 void uart_hal_set_break_char_detect_length(uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 1136 uart_break_char_length_t length);
mbed_official 146:f64d43ff0c18 1137
mbed_official 146:f64d43ff0c18 1138 /*!
mbed_official 146:f64d43ff0c18 1139 * @brief Configure the UART transmit send break character operation.
mbed_official 146:f64d43ff0c18 1140 *
mbed_official 146:f64d43ff0c18 1141 * This function allows the user to queue a UART break character to send. If true is passed into
mbed_official 146:f64d43ff0c18 1142 * the function, then a break character is queued for transmission. A break character will
mbed_official 146:f64d43ff0c18 1143 * continuously be queued until this function is called again when a false is passed into this
mbed_official 146:f64d43ff0c18 1144 * function.
mbed_official 146:f64d43ff0c18 1145 *
mbed_official 146:f64d43ff0c18 1146 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1147 * @param enable If false, the UART normal/queue break character setting is disabled, which
mbed_official 146:f64d43ff0c18 1148 * configures the UART for normal transmitter operation. If true, a break
mbed_official 146:f64d43ff0c18 1149 * character is queued for transmission.
mbed_official 146:f64d43ff0c18 1150 */
mbed_official 146:f64d43ff0c18 1151 void uart_hal_queue_break_char_to_send(uint32_t uartInstance, bool enable);
mbed_official 146:f64d43ff0c18 1152
mbed_official 146:f64d43ff0c18 1153 /*!
mbed_official 146:f64d43ff0c18 1154 * @brief Configure the UART match address mode control operation. (Note: Feature available on
mbed_official 146:f64d43ff0c18 1155 * select UART instances)
mbed_official 146:f64d43ff0c18 1156 *
mbed_official 146:f64d43ff0c18 1157 * The function allows the user to configure the UART match address control operation. The user
mbed_official 146:f64d43ff0c18 1158 * has the option to enable the match address mode and to program the match address value. There
mbed_official 146:f64d43ff0c18 1159 * are two match address modes, each with its own enable and programmable match address value.
mbed_official 146:f64d43ff0c18 1160 *
mbed_official 146:f64d43ff0c18 1161 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1162 * @param matchAddrMode1 If true, this enables match address mode 1 (MAEN1), where false disables.
mbed_official 146:f64d43ff0c18 1163 * @param matchAddrMode2 If true, this enables match address mode 2 (MAEN2), where false disables.
mbed_official 146:f64d43ff0c18 1164 * @param matchAddrValue1 The match address value to program for match address mode 1.
mbed_official 146:f64d43ff0c18 1165 * @param matchAddrValue2 The match address value to program for match address mode 2.
mbed_official 146:f64d43ff0c18 1166 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1167 */
mbed_official 146:f64d43ff0c18 1168 uart_status_t uart_hal_configure_match_address_operation(
mbed_official 146:f64d43ff0c18 1169 uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 1170 bool matchAddrMode1,
mbed_official 146:f64d43ff0c18 1171 bool matchAddrMode2,
mbed_official 146:f64d43ff0c18 1172 uint8_t matchAddrValue1,
mbed_official 146:f64d43ff0c18 1173 uint8_t matchAddrValue2);
mbed_official 146:f64d43ff0c18 1174
mbed_official 146:f64d43ff0c18 1175 /*!
mbed_official 146:f64d43ff0c18 1176 * @brief Configure the UART to send data MSB first
mbed_official 146:f64d43ff0c18 1177 * (Note: Feature available on select UART instances)
mbed_official 146:f64d43ff0c18 1178 *
mbed_official 146:f64d43ff0c18 1179 * The function allows the user to configure the UART to send data MSB first or LSB first.
mbed_official 146:f64d43ff0c18 1180 * In some UART instances it is required that the transmitter/receiver be disabled
mbed_official 146:f64d43ff0c18 1181 * before calling this function.
mbed_official 146:f64d43ff0c18 1182 * This may be applied to all UARTs to ensure safe operation.
mbed_official 146:f64d43ff0c18 1183 *
mbed_official 146:f64d43ff0c18 1184 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1185 * @param enable This configures send MSB first mode configuration. If true, the data is sent MSB
mbed_official 146:f64d43ff0c18 1186 * first; if false, it is sent LSB first.
mbed_official 146:f64d43ff0c18 1187 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1188 */
mbed_official 146:f64d43ff0c18 1189 uart_status_t uart_hal_configure_send_msb_first_operation(uint32_t uartInstance, bool enable);
mbed_official 146:f64d43ff0c18 1190
mbed_official 146:f64d43ff0c18 1191 /*!
mbed_official 146:f64d43ff0c18 1192 * @brief Configuration option to disable the UART resynchronization during received data.
mbed_official 146:f64d43ff0c18 1193 * (Note: Feature available on select UART instances)
mbed_official 146:f64d43ff0c18 1194 *
mbed_official 146:f64d43ff0c18 1195 * This function allows the user to disable the UART resync of received data. The default setting
mbed_official 146:f64d43ff0c18 1196 * is false, meaning that resynchronization during the received data word is supported.
mbed_official 146:f64d43ff0c18 1197 * If the user passes in true, this disables resynchronization during the received data word.
mbed_official 146:f64d43ff0c18 1198 *
mbed_official 146:f64d43ff0c18 1199 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1200 * @param enable If false, then resynchronization during the received data word is supported.
mbed_official 146:f64d43ff0c18 1201 * If true, resynchronization during the received data word is disabled.
mbed_official 146:f64d43ff0c18 1202 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1203 */
mbed_official 146:f64d43ff0c18 1204 uart_status_t uart_hal_configure_receive_resync_disable_operation(uint32_t uartInstance,
mbed_official 146:f64d43ff0c18 1205 bool enable);
mbed_official 146:f64d43ff0c18 1206
mbed_official 146:f64d43ff0c18 1207 #if FSL_FEATURE_UART_HAS_MODEM_SUPPORT
mbed_official 146:f64d43ff0c18 1208 /*!
mbed_official 146:f64d43ff0c18 1209 * @brief Enable the UART receiver request-to-send functionality.
mbed_official 146:f64d43ff0c18 1210 *
mbed_official 146:f64d43ff0c18 1211 * This function allows the user to enable the UART receiver request-to-send (RTS) functionality.
mbed_official 146:f64d43ff0c18 1212 * By enabling, it allows the RTS output to control the CTS input of the transmitting device to
mbed_official 146:f64d43ff0c18 1213 * prevent receiver overrun. RTS is deasserted if the number of characters in the receiver data
mbed_official 146:f64d43ff0c18 1214 * register (FIFO) is equal to or greater than RWFIFO[RXWATER]. RTS is asserted when the
mbed_official 146:f64d43ff0c18 1215 * number of characters in the receiver data register (FIFO) is less than RWFIFO[RXWATER].
mbed_official 146:f64d43ff0c18 1216 * Do not set both RXRTSE and TXRTSE.
mbed_official 146:f64d43ff0c18 1217 *
mbed_official 146:f64d43ff0c18 1218 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1219 */
mbed_official 146:f64d43ff0c18 1220 void uart_hal_enable_receiver_rts(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1221
mbed_official 146:f64d43ff0c18 1222 /*!
mbed_official 146:f64d43ff0c18 1223 * @brief Disable the UART receiver request-to-send functionality.
mbed_official 146:f64d43ff0c18 1224 *
mbed_official 146:f64d43ff0c18 1225 * This function allows the user to disable the UART receiver request-to-send (RTS) functionality.
mbed_official 146:f64d43ff0c18 1226 *
mbed_official 146:f64d43ff0c18 1227 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1228 */
mbed_official 146:f64d43ff0c18 1229 void uart_hal_disable_receiver_rts(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1230
mbed_official 146:f64d43ff0c18 1231 /*!
mbed_official 146:f64d43ff0c18 1232 * @brief Enable the UART transmitter request-to-send functionality.
mbed_official 146:f64d43ff0c18 1233 *
mbed_official 146:f64d43ff0c18 1234 * This function allows the user to enable the UART transmitter request-to-send (RTS) functionality.
mbed_official 146:f64d43ff0c18 1235 * When enabled, it allows the UART to control the RTS assertion before and after a transmission
mbed_official 146:f64d43ff0c18 1236 * such that when a character is placed into an empty transmitter data buffer, RTS
mbed_official 146:f64d43ff0c18 1237 * asserts one bit time before the start bit is transmitted. RTS deasserts one bit time after all
mbed_official 146:f64d43ff0c18 1238 * characters in the transmitter data buffer and shift register are completely sent, including
mbed_official 146:f64d43ff0c18 1239 * the last stop bit.
mbed_official 146:f64d43ff0c18 1240 *
mbed_official 146:f64d43ff0c18 1241 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1242 */
mbed_official 146:f64d43ff0c18 1243 void uart_hal_enable_transmitter_rts(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1244
mbed_official 146:f64d43ff0c18 1245 /*!
mbed_official 146:f64d43ff0c18 1246 * @brief Disable the UART transmitter request-to-send functionality.
mbed_official 146:f64d43ff0c18 1247 *
mbed_official 146:f64d43ff0c18 1248 * This function allows the user to disable the UART transmitter request-to-send (RTS)
mbed_official 146:f64d43ff0c18 1249 * functionality.
mbed_official 146:f64d43ff0c18 1250 *
mbed_official 146:f64d43ff0c18 1251 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1252 */
mbed_official 146:f64d43ff0c18 1253 void uart_hal_disable_transmitter_rts(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1254
mbed_official 146:f64d43ff0c18 1255 /*!
mbed_official 146:f64d43ff0c18 1256 * @brief Configure the UART transmitter RTS polarity.
mbed_official 146:f64d43ff0c18 1257 *
mbed_official 146:f64d43ff0c18 1258 * This function allows the user configure the transmitter RTS polarity to be either active low
mbed_official 146:f64d43ff0c18 1259 * or active high.
mbed_official 146:f64d43ff0c18 1260 *
mbed_official 146:f64d43ff0c18 1261 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1262 * @param polarity The UART transmitter RTS polarity setting (false - active low,
mbed_official 146:f64d43ff0c18 1263 * true - active high).
mbed_official 146:f64d43ff0c18 1264 */
mbed_official 146:f64d43ff0c18 1265 void uart_hal_configure_transmitter_rts_polarity(uint32_t uartInstance, bool polarity);
mbed_official 146:f64d43ff0c18 1266
mbed_official 146:f64d43ff0c18 1267 /*!
mbed_official 146:f64d43ff0c18 1268 * @brief Enable the UART transmitter clear-to-send functionality.
mbed_official 146:f64d43ff0c18 1269 *
mbed_official 146:f64d43ff0c18 1270 * This function allows the user to enable the UART transmitter clear-to-send (CTS) functionality.
mbed_official 146:f64d43ff0c18 1271 * When enabled, the transmitter checks the state of CTS each time it is ready to send a character.
mbed_official 146:f64d43ff0c18 1272 * If CTS is asserted, the character is sent. If CTS is deasserted, the signal TXD remains in
mbed_official 146:f64d43ff0c18 1273 * the mark state and transmission is delayed until CTS is asserted. Changes in CTS as a
mbed_official 146:f64d43ff0c18 1274 * character is being sent do not affect its transmission.
mbed_official 146:f64d43ff0c18 1275 *
mbed_official 146:f64d43ff0c18 1276 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1277 */
mbed_official 146:f64d43ff0c18 1278 void uart_hal_enable_transmitter_cts(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1279
mbed_official 146:f64d43ff0c18 1280 /*!
mbed_official 146:f64d43ff0c18 1281 * @brief Disable the UART transmitter clear-to-send functionality.
mbed_official 146:f64d43ff0c18 1282 *
mbed_official 146:f64d43ff0c18 1283 * This function allows the user to disable the UART transmitter clear-to-send (CTS)
mbed_official 146:f64d43ff0c18 1284 * functionality.
mbed_official 146:f64d43ff0c18 1285 *
mbed_official 146:f64d43ff0c18 1286 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1287 */
mbed_official 146:f64d43ff0c18 1288 void uart_hal_disable_transmitter_cts(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1289 #endif /* FSL_FEATURE_UART_HAS_MODEM_SUPPORT*/
mbed_official 146:f64d43ff0c18 1290
mbed_official 146:f64d43ff0c18 1291 #if FSL_FEATURE_UART_HAS_IR_SUPPORT
mbed_official 146:f64d43ff0c18 1292 /*!
mbed_official 146:f64d43ff0c18 1293 * @brief Configure the UART infrared operation.
mbed_official 146:f64d43ff0c18 1294 *
mbed_official 146:f64d43ff0c18 1295 * The function allows the user to enable or disable the UART infrared (IR) operation
mbed_official 146:f64d43ff0c18 1296 * and to configure the IR pulse width.
mbed_official 146:f64d43ff0c18 1297 *
mbed_official 146:f64d43ff0c18 1298 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1299 * @param enable Enable (true) or disable (false) the infrared operation.
mbed_official 146:f64d43ff0c18 1300 * @param pulseWidth The UART transmit narrow pulse width setting of type uart_ir_tx_pulsewidth_t.
mbed_official 146:f64d43ff0c18 1301 */
mbed_official 146:f64d43ff0c18 1302 void uart_hal_configure_infrared_operation(uint32_t uartInstance, bool enable,
mbed_official 146:f64d43ff0c18 1303 uart_ir_tx_pulsewidth_t pulseWidth);
mbed_official 146:f64d43ff0c18 1304 #endif /* FSL_FEATURE_UART_HAS_IR_SUPPORT*/
mbed_official 146:f64d43ff0c18 1305
mbed_official 146:f64d43ff0c18 1306 /*@}*/
mbed_official 146:f64d43ff0c18 1307
mbed_official 146:f64d43ff0c18 1308 /*!
mbed_official 146:f64d43ff0c18 1309 * @name UART Status Flags
mbed_official 146:f64d43ff0c18 1310 * @{
mbed_official 146:f64d43ff0c18 1311 */
mbed_official 146:f64d43ff0c18 1312
mbed_official 146:f64d43ff0c18 1313 /*!
mbed_official 146:f64d43ff0c18 1314 * @brief Get all of the UART status flag states.
mbed_official 146:f64d43ff0c18 1315 *
mbed_official 146:f64d43ff0c18 1316 * This function gets all of the UART status flag states and places into a structure of
mbed_official 146:f64d43ff0c18 1317 * type uart_status_flag_all_t. The user must pass in a pointer to this structure.
mbed_official 146:f64d43ff0c18 1318 *
mbed_official 146:f64d43ff0c18 1319 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1320 * @param allStatusFlag Pointer to the structure of all the UART status flags states.
mbed_official 146:f64d43ff0c18 1321 */
mbed_official 146:f64d43ff0c18 1322 void uart_hal_get_all_status_flag(uint32_t uartInstance, uart_status_flag_all_t *allStatusFlag);
mbed_official 146:f64d43ff0c18 1323
mbed_official 146:f64d43ff0c18 1324 /*!
mbed_official 146:f64d43ff0c18 1325 * @brief Get the UART Transmit data register empty flag.
mbed_official 146:f64d43ff0c18 1326 *
mbed_official 146:f64d43ff0c18 1327 * This function returns the state of the UART Transmit data register empty flag.
mbed_official 146:f64d43ff0c18 1328 *
mbed_official 146:f64d43ff0c18 1329 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1330 * @return The status of Transmit data register empty flag, which is set when transmit buffer
mbed_official 146:f64d43ff0c18 1331 * is empty.
mbed_official 146:f64d43ff0c18 1332 */
mbed_official 146:f64d43ff0c18 1333 bool uart_hal_is_transmit_data_register_empty(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1334
mbed_official 146:f64d43ff0c18 1335 /*!
mbed_official 146:f64d43ff0c18 1336 * @brief Get the UART Transmission complete flag.
mbed_official 146:f64d43ff0c18 1337 *
mbed_official 146:f64d43ff0c18 1338 * This function returns the state of the UART Transmission complete flag.
mbed_official 146:f64d43ff0c18 1339 *
mbed_official 146:f64d43ff0c18 1340 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1341 * @return The status of Transmission complete flag, which is set when the transmitter is idle
mbed_official 146:f64d43ff0c18 1342 * (transmission activity complete).
mbed_official 146:f64d43ff0c18 1343 */
mbed_official 146:f64d43ff0c18 1344 bool uart_hal_is_transmission_complete(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1345
mbed_official 146:f64d43ff0c18 1346 /*!
mbed_official 146:f64d43ff0c18 1347 * @brief Get the UART Receive data register full flag.
mbed_official 146:f64d43ff0c18 1348 *
mbed_official 146:f64d43ff0c18 1349 * This function returns the state of the UART Receive data register full flag.
mbed_official 146:f64d43ff0c18 1350 *
mbed_official 146:f64d43ff0c18 1351 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1352 * @return The status of Receive data register full flag, which is set when the receive data buffer
mbed_official 146:f64d43ff0c18 1353 * is full.
mbed_official 146:f64d43ff0c18 1354 */
mbed_official 146:f64d43ff0c18 1355 bool uart_hal_is_receive_data_register_full(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1356
mbed_official 146:f64d43ff0c18 1357 /*!
mbed_official 146:f64d43ff0c18 1358 * @brief Get the UART Idle-line detect flag.
mbed_official 146:f64d43ff0c18 1359 *
mbed_official 146:f64d43ff0c18 1360 * This function returns the state of the UART Idle-line detect flag.
mbed_official 146:f64d43ff0c18 1361 *
mbed_official 146:f64d43ff0c18 1362 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1363 * @return The status of Idle-line detect flag which is set when an idle-line detected.
mbed_official 146:f64d43ff0c18 1364 */
mbed_official 146:f64d43ff0c18 1365 bool uart_hal_is_idle_line_detected(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1366
mbed_official 146:f64d43ff0c18 1367 /*!
mbed_official 146:f64d43ff0c18 1368 * @brief Get the UART Receiver Overrun status flag.
mbed_official 146:f64d43ff0c18 1369 *
mbed_official 146:f64d43ff0c18 1370 * This function returns the state of the the UART Receiver Overrun status flag.
mbed_official 146:f64d43ff0c18 1371 *
mbed_official 146:f64d43ff0c18 1372 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1373 * @return The status of Receiver Overrun, which is set when new data is received before data is
mbed_official 146:f64d43ff0c18 1374 * read from receive register.
mbed_official 146:f64d43ff0c18 1375 */
mbed_official 146:f64d43ff0c18 1376 bool uart_hal_is_receive_overrun_detected(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1377
mbed_official 146:f64d43ff0c18 1378 /*!
mbed_official 146:f64d43ff0c18 1379 * @brief Get the UART noise status flag.
mbed_official 146:f64d43ff0c18 1380 *
mbed_official 146:f64d43ff0c18 1381 * This function returns the state of the UART noise status flag.
mbed_official 146:f64d43ff0c18 1382 *
mbed_official 146:f64d43ff0c18 1383 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1384 * @return The status of the noise flag, which is set if any of the 3 samples taken on
mbed_official 146:f64d43ff0c18 1385 * receive differ.
mbed_official 146:f64d43ff0c18 1386 */
mbed_official 146:f64d43ff0c18 1387 bool uart_hal_is_noise_detected(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1388
mbed_official 146:f64d43ff0c18 1389 /*!
mbed_official 146:f64d43ff0c18 1390 * @brief Get the UART Frame error status flag.
mbed_official 146:f64d43ff0c18 1391 *
mbed_official 146:f64d43ff0c18 1392 * This function returns the state of the UART Frame error status flag.
mbed_official 146:f64d43ff0c18 1393 *
mbed_official 146:f64d43ff0c18 1394 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1395 * @return The status of Frame error flag, which is set if a logic 0 was detected where a stop bit
mbed_official 146:f64d43ff0c18 1396 * was expected.
mbed_official 146:f64d43ff0c18 1397 */
mbed_official 146:f64d43ff0c18 1398 bool uart_hal_is_frame_error_detected(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1399
mbed_official 146:f64d43ff0c18 1400 /*!
mbed_official 146:f64d43ff0c18 1401 * @brief Get the UART parity error status flag.
mbed_official 146:f64d43ff0c18 1402 *
mbed_official 146:f64d43ff0c18 1403 * This function returns the state of the UART parity error status flag.
mbed_official 146:f64d43ff0c18 1404 *
mbed_official 146:f64d43ff0c18 1405 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1406 * @return The status of parity error detection flag, which is set if parity mode enabled and the
mbed_official 146:f64d43ff0c18 1407 * parity bit received does not match what was expected.
mbed_official 146:f64d43ff0c18 1408 */
mbed_official 146:f64d43ff0c18 1409 bool uart_hal_is_parity_error_detected(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1410
mbed_official 146:f64d43ff0c18 1411 /*!
mbed_official 146:f64d43ff0c18 1412 * @brief Get the UART LIN break detect interrupt status flag.
mbed_official 146:f64d43ff0c18 1413 *
mbed_official 146:f64d43ff0c18 1414 * This function returns the state of the UART LIN break detect interrupt status flag.
mbed_official 146:f64d43ff0c18 1415 *
mbed_official 146:f64d43ff0c18 1416 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1417 * @return The status of LIN break detect interrupt flag, which is set when the LIN break char
mbed_official 146:f64d43ff0c18 1418 * is detected assuming the LIN circuit is enabled.
mbed_official 146:f64d43ff0c18 1419 */
mbed_official 146:f64d43ff0c18 1420 bool uart_hal_is_line_break_detected(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1421
mbed_official 146:f64d43ff0c18 1422 /*!
mbed_official 146:f64d43ff0c18 1423 * @brief Get the UART Receive pin active edge interrupt status flag.
mbed_official 146:f64d43ff0c18 1424 *
mbed_official 146:f64d43ff0c18 1425 * This function returns the state of the UART Receive pin active edge interrupt status flag.
mbed_official 146:f64d43ff0c18 1426 *
mbed_official 146:f64d43ff0c18 1427 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1428 * @return The status of Receive pin active edge interrupt flag, which is set when active edge
mbed_official 146:f64d43ff0c18 1429 * detected on the receive pin.
mbed_official 146:f64d43ff0c18 1430 */
mbed_official 146:f64d43ff0c18 1431 bool uart_hal_is_receive_active_edge_detected(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1432
mbed_official 146:f64d43ff0c18 1433 /*!
mbed_official 146:f64d43ff0c18 1434 * @brief Get the UART Receiver Active Flag (RAF) state.
mbed_official 146:f64d43ff0c18 1435 *
mbed_official 146:f64d43ff0c18 1436 * This function returns the state of the UART Receiver Active Flag (RAF).
mbed_official 146:f64d43ff0c18 1437 *
mbed_official 146:f64d43ff0c18 1438 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1439 * @return The status of the Receiver Active Flag (RAF), which is set at the beginning of a
mbed_official 146:f64d43ff0c18 1440 * received valid start bit.
mbed_official 146:f64d43ff0c18 1441 */
mbed_official 146:f64d43ff0c18 1442 bool uart_hal_is_receiver_active(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1443
mbed_official 146:f64d43ff0c18 1444 /*!
mbed_official 146:f64d43ff0c18 1445 * @brief Clear an individual and specific UART status flag.
mbed_official 146:f64d43ff0c18 1446 *
mbed_official 146:f64d43ff0c18 1447 * This function allows the user to clear an individual and specific UART status flag. Refer to
mbed_official 146:f64d43ff0c18 1448 * structure definition uart_status_flag_t for list of status bits.
mbed_official 146:f64d43ff0c18 1449 *
mbed_official 146:f64d43ff0c18 1450 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1451 * @param statusFlag The desired UART status flag to clear.
mbed_official 146:f64d43ff0c18 1452 * @return An error code or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1453 */
mbed_official 146:f64d43ff0c18 1454 uart_status_t uart_hal_clear_status_flag(uint32_t uartInstance, uart_status_flag_t statusFlag);
mbed_official 146:f64d43ff0c18 1455
mbed_official 146:f64d43ff0c18 1456 /*!
mbed_official 146:f64d43ff0c18 1457 * @brief Clear ALL of the UART status flags.
mbed_official 146:f64d43ff0c18 1458 *
mbed_official 146:f64d43ff0c18 1459 * This function tries to clear all of the UART status flags. In some cases, some of the status
mbed_official 146:f64d43ff0c18 1460 * flags may not get cleared because the condition that set the flag may still exist.
mbed_official 146:f64d43ff0c18 1461 *
mbed_official 146:f64d43ff0c18 1462 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1463 */
mbed_official 146:f64d43ff0c18 1464 void uart_hal_clear_all_non_autoclear_status_flags(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1465
mbed_official 146:f64d43ff0c18 1466 /*@}*/
mbed_official 146:f64d43ff0c18 1467
mbed_official 146:f64d43ff0c18 1468 /*!
mbed_official 146:f64d43ff0c18 1469 * @name UART FIFO Configurations
mbed_official 146:f64d43ff0c18 1470 * @{
mbed_official 146:f64d43ff0c18 1471 */
mbed_official 146:f64d43ff0c18 1472
mbed_official 146:f64d43ff0c18 1473 #if FSL_FEATURE_UART_HAS_FIFO
mbed_official 146:f64d43ff0c18 1474 /*!
mbed_official 146:f64d43ff0c18 1475 * @brief Enable the UART transmit FIFO.
mbed_official 146:f64d43ff0c18 1476 *
mbed_official 146:f64d43ff0c18 1477 * This function allows the user to enable the UART transmit FIFO.
mbed_official 146:f64d43ff0c18 1478 * It is required that the transmitter/receiver be disabled before calling this function
mbed_official 146:f64d43ff0c18 1479 * when the FIFO is empty.
mbed_official 146:f64d43ff0c18 1480 * Additionally, TXFLUSH and RXFLUSH commands should be issued after calling this function.
mbed_official 146:f64d43ff0c18 1481 *
mbed_official 146:f64d43ff0c18 1482 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1483 * @return Error code if it is detected that the transmitter or receiver is enabled or
mbed_official 146:f64d43ff0c18 1484 * kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1485 */
mbed_official 146:f64d43ff0c18 1486 uart_status_t uart_hal_enable_tx_fifo(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1487
mbed_official 146:f64d43ff0c18 1488 /*!
mbed_official 146:f64d43ff0c18 1489 * @brief Disable the UART transmit FIFO.
mbed_official 146:f64d43ff0c18 1490 *
mbed_official 146:f64d43ff0c18 1491 * This function allows the user to disable the UART transmit FIFO.
mbed_official 146:f64d43ff0c18 1492 * It is required that the transmitter/receiver be disabled before calling this function
mbed_official 146:f64d43ff0c18 1493 * when the FIFO is empty.
mbed_official 146:f64d43ff0c18 1494 * Additionally, TXFLUSH and RXFLUSH commands should be issued after calling this function.
mbed_official 146:f64d43ff0c18 1495 *
mbed_official 146:f64d43ff0c18 1496 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1497 * @return Error code if it is detected that the transmitter or receiver is enabled or
mbed_official 146:f64d43ff0c18 1498 * kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1499 */
mbed_official 146:f64d43ff0c18 1500 uart_status_t uart_hal_disable_tx_fifo(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1501
mbed_official 146:f64d43ff0c18 1502 /*!
mbed_official 146:f64d43ff0c18 1503 * @brief Enable the UART receive FIFO.
mbed_official 146:f64d43ff0c18 1504 *
mbed_official 146:f64d43ff0c18 1505 * This function allows the user to enable the UART receive FIFO.
mbed_official 146:f64d43ff0c18 1506 * It is required that the transmitter/receiver be disabled before calling this function
mbed_official 146:f64d43ff0c18 1507 * when the FIFO is empty.
mbed_official 146:f64d43ff0c18 1508 * Additionally, TXFLUSH and RXFLUSH commands should be issued after calling this function.
mbed_official 146:f64d43ff0c18 1509 *
mbed_official 146:f64d43ff0c18 1510 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1511 * @return Error code if it is detected that the transmitter or receiver is enabled or
mbed_official 146:f64d43ff0c18 1512 * kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1513 */
mbed_official 146:f64d43ff0c18 1514 uart_status_t uart_hal_enable_rx_fifo(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1515
mbed_official 146:f64d43ff0c18 1516 /*!
mbed_official 146:f64d43ff0c18 1517 * @brief Disable the UART receive FIFO.
mbed_official 146:f64d43ff0c18 1518 *
mbed_official 146:f64d43ff0c18 1519 * This function allows the user to disable the UART receive FIFO.
mbed_official 146:f64d43ff0c18 1520 * It is required that the transmitter/receiver be disabled before calling this function
mbed_official 146:f64d43ff0c18 1521 * when the FIFO is empty.
mbed_official 146:f64d43ff0c18 1522 * Additionally, TXFLUSH and RXFLUSH commands should be issued after calling this function.
mbed_official 146:f64d43ff0c18 1523 *
mbed_official 146:f64d43ff0c18 1524 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1525 * @return Error code if it is detected that the transmitter or receiver is enabled or
mbed_official 146:f64d43ff0c18 1526 * kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1527 */
mbed_official 146:f64d43ff0c18 1528 uart_status_t uart_hal_disable_rx_fifo(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1529
mbed_official 146:f64d43ff0c18 1530 /*!
mbed_official 146:f64d43ff0c18 1531 * @brief Get the size of the UART transmit FIFO.
mbed_official 146:f64d43ff0c18 1532 *
mbed_official 146:f64d43ff0c18 1533 * This function returns the size (number of entries) supported in the UART transmit FIFO for
mbed_official 146:f64d43ff0c18 1534 * a particular module instance.
mbed_official 146:f64d43ff0c18 1535 *
mbed_official 146:f64d43ff0c18 1536 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1537 * @return The UART transmit FIFO size as follows:
mbed_official 146:f64d43ff0c18 1538 * 0x0: 1 data word; 0x1: 4 data words; 0x2: 8 data words; 0x3: 16 data words
mbed_official 146:f64d43ff0c18 1539 * 0x4: 32 data words; 0x5: 64 data words; 0x6: 128 data words; 0x7: reserved
mbed_official 146:f64d43ff0c18 1540 */
mbed_official 146:f64d43ff0c18 1541 uint8_t uart_hal_get_tx_fifo_size(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1542
mbed_official 146:f64d43ff0c18 1543 /*!
mbed_official 146:f64d43ff0c18 1544 * @brief Get the size of the UART receive FIFO.
mbed_official 146:f64d43ff0c18 1545 *
mbed_official 146:f64d43ff0c18 1546 * This function returns the size (number of entries) supported in the UART receive FIFO for
mbed_official 146:f64d43ff0c18 1547 * a particular module instance.
mbed_official 146:f64d43ff0c18 1548 *
mbed_official 146:f64d43ff0c18 1549 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1550 * @return The receive FIFO size as follows:
mbed_official 146:f64d43ff0c18 1551 * 0x0: 1 data word; 0x1: 4 data words; 0x2: 8 data words; 0x3: 16 data words
mbed_official 146:f64d43ff0c18 1552 * 0x4: 32 data words; 0x5: 64 data words; 0x6: 128 data words; 0x7: reserved
mbed_official 146:f64d43ff0c18 1553 */
mbed_official 146:f64d43ff0c18 1554 uint8_t uart_hal_get_rx_fifo_size(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1555
mbed_official 146:f64d43ff0c18 1556 /*!
mbed_official 146:f64d43ff0c18 1557 * @brief Flush the UART transmit FIFO.
mbed_official 146:f64d43ff0c18 1558 *
mbed_official 146:f64d43ff0c18 1559 * This function allows the user to flush the UART transmit FIFO for a particular module instance.
mbed_official 146:f64d43ff0c18 1560 * Flushing the FIFO may result in data loss.
mbed_official 146:f64d43ff0c18 1561 * It is recommended that the transmitter be disabled before calling this function.
mbed_official 146:f64d43ff0c18 1562 *
mbed_official 146:f64d43ff0c18 1563 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1564 * @return Error code if it is detected that the transmitter or receiver is enabled or
mbed_official 146:f64d43ff0c18 1565 * kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1566 */
mbed_official 146:f64d43ff0c18 1567 uart_status_t uart_hal_flush_tx_fifo(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1568
mbed_official 146:f64d43ff0c18 1569 /*!
mbed_official 146:f64d43ff0c18 1570 * @brief Flush the UART receive FIFO.
mbed_official 146:f64d43ff0c18 1571 *
mbed_official 146:f64d43ff0c18 1572 * This function allows the user to flush the UART receive FIFO for a particular module instance.
mbed_official 146:f64d43ff0c18 1573 * Flushing the FIFO may result in data loss.
mbed_official 146:f64d43ff0c18 1574 * It is recommended that the receiver be disabled before calling this function.
mbed_official 146:f64d43ff0c18 1575 *
mbed_official 146:f64d43ff0c18 1576 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1577 * @return Error code if it is detected that the transmitter or receiver is enabled or
mbed_official 146:f64d43ff0c18 1578 * kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1579 */
mbed_official 146:f64d43ff0c18 1580 uart_status_t uart_hal_flush_rx_fifo(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1581
mbed_official 146:f64d43ff0c18 1582 /*!
mbed_official 146:f64d43ff0c18 1583 * @brief Enable the UART transmit FIFO overflow interrupt.
mbed_official 146:f64d43ff0c18 1584 *
mbed_official 146:f64d43ff0c18 1585 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1586 */
mbed_official 146:f64d43ff0c18 1587 void uart_hal_enable_tx_fifo_overflow_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1588
mbed_official 146:f64d43ff0c18 1589
mbed_official 146:f64d43ff0c18 1590 /*!
mbed_official 146:f64d43ff0c18 1591 * @brief Disable the UART transmit FIFO overflow interrupt.
mbed_official 146:f64d43ff0c18 1592 *
mbed_official 146:f64d43ff0c18 1593 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1594 */
mbed_official 146:f64d43ff0c18 1595 void uart_hal_disable_tx_fifo_overflow_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1596
mbed_official 146:f64d43ff0c18 1597
mbed_official 146:f64d43ff0c18 1598 /*!
mbed_official 146:f64d43ff0c18 1599 * @brief Get the configuration of the UART transmit FIFO overflow interrupt enable.
mbed_official 146:f64d43ff0c18 1600 *
mbed_official 146:f64d43ff0c18 1601 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1602 * @return The UART transmit FIFO overflow interrupt enable state: true=enable; false=disable.
mbed_official 146:f64d43ff0c18 1603 */
mbed_official 146:f64d43ff0c18 1604 bool uart_hal_is_tx_fifo_overflow_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1605
mbed_official 146:f64d43ff0c18 1606
mbed_official 146:f64d43ff0c18 1607 /*!
mbed_official 146:f64d43ff0c18 1608 * @brief Enable the UART receive FIFO underflow interrupt.
mbed_official 146:f64d43ff0c18 1609 *
mbed_official 146:f64d43ff0c18 1610 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1611 */
mbed_official 146:f64d43ff0c18 1612 void uart_hal_enable_rx_fifo_underflow_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1613
mbed_official 146:f64d43ff0c18 1614
mbed_official 146:f64d43ff0c18 1615 /*!
mbed_official 146:f64d43ff0c18 1616 * @brief Disable the UART receive FIFO underflow interrupt.
mbed_official 146:f64d43ff0c18 1617 *
mbed_official 146:f64d43ff0c18 1618 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1619 */
mbed_official 146:f64d43ff0c18 1620 void uart_hal_disable_rx_fifo_underflow_interrupt(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1621
mbed_official 146:f64d43ff0c18 1622
mbed_official 146:f64d43ff0c18 1623 /*!
mbed_official 146:f64d43ff0c18 1624 * @brief Get the configuration of the UART receive FIFO underflow interrupt enable.
mbed_official 146:f64d43ff0c18 1625 *
mbed_official 146:f64d43ff0c18 1626 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1627 * @return The UART receive FIFO underflow interrupt enable state: true=enable; false=disable.
mbed_official 146:f64d43ff0c18 1628 */
mbed_official 146:f64d43ff0c18 1629 bool uart_hal_is_rx_fifo_underflow_interrupt_enabled(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1630
mbed_official 146:f64d43ff0c18 1631 /*!
mbed_official 146:f64d43ff0c18 1632 * @brief Get the UART transmit FIFO empty status state.
mbed_official 146:f64d43ff0c18 1633 *
mbed_official 146:f64d43ff0c18 1634 * The function returns the state of the transmit FIFO empty status state, but does not take into
mbed_official 146:f64d43ff0c18 1635 * account data in the shift register.
mbed_official 146:f64d43ff0c18 1636 *
mbed_official 146:f64d43ff0c18 1637 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1638 * @return The UART transmit FIFO empty status: true=empty; false=not-empty.
mbed_official 146:f64d43ff0c18 1639 */
mbed_official 146:f64d43ff0c18 1640 bool uart_hal_is_tx_fifo_empty(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1641
mbed_official 146:f64d43ff0c18 1642 /*!
mbed_official 146:f64d43ff0c18 1643 * @brief Get the UART receive FIFO empty status state.
mbed_official 146:f64d43ff0c18 1644 *
mbed_official 146:f64d43ff0c18 1645 * The function returns the state of the receive FIFO empty status state, but does not take into
mbed_official 146:f64d43ff0c18 1646 * account data in the shift register.
mbed_official 146:f64d43ff0c18 1647 *
mbed_official 146:f64d43ff0c18 1648 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1649 * @return The UART receive FIFO empty status: true=empty; false=not-empty.
mbed_official 146:f64d43ff0c18 1650 */
mbed_official 146:f64d43ff0c18 1651 bool uart_hal_is_rx_fifo_empty(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1652
mbed_official 146:f64d43ff0c18 1653 /*!
mbed_official 146:f64d43ff0c18 1654 * @brief Get the UART transmit FIFO overflow status state.
mbed_official 146:f64d43ff0c18 1655 *
mbed_official 146:f64d43ff0c18 1656 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1657 * @return The UART transmit FIFO overflow status state: true=overflow; false=no overflow.
mbed_official 146:f64d43ff0c18 1658 */
mbed_official 146:f64d43ff0c18 1659 bool uart_hal_is_tx_fifo_overflow(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1660
mbed_official 146:f64d43ff0c18 1661 /*!
mbed_official 146:f64d43ff0c18 1662 * @brief Clear the UART transmit FIFO overflow status.
mbed_official 146:f64d43ff0c18 1663 *
mbed_official 146:f64d43ff0c18 1664 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1665 */
mbed_official 146:f64d43ff0c18 1666 void uart_hal_clear_tx_fifo_overflow(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1667
mbed_official 146:f64d43ff0c18 1668 /*!
mbed_official 146:f64d43ff0c18 1669 * @brief Get the UART receive FIFO underflow status state.
mbed_official 146:f64d43ff0c18 1670 *
mbed_official 146:f64d43ff0c18 1671 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1672 * @return The receive FIFO underflow status state: true=overflow; false=no overflow.
mbed_official 146:f64d43ff0c18 1673 */
mbed_official 146:f64d43ff0c18 1674 bool uart_hal_is_rx_fifo_underflow(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1675
mbed_official 146:f64d43ff0c18 1676 /*!
mbed_official 146:f64d43ff0c18 1677 * @brief Clear the UART receive FIFO underflow status.
mbed_official 146:f64d43ff0c18 1678 *
mbed_official 146:f64d43ff0c18 1679 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1680 */
mbed_official 146:f64d43ff0c18 1681 void uart_hal_clear_rx_fifo_underflow(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1682
mbed_official 146:f64d43ff0c18 1683 /*!
mbed_official 146:f64d43ff0c18 1684 * @brief Set the UART transmit FIFO watermark value.
mbed_official 146:f64d43ff0c18 1685 *
mbed_official 146:f64d43ff0c18 1686 * Programming the transmit watermark should be done when UART the transmitter is disabled
mbed_official 146:f64d43ff0c18 1687 * and the value must be set less than the size obtained from uart_hal_get_tx_fifo_size.
mbed_official 146:f64d43ff0c18 1688 *
mbed_official 146:f64d43ff0c18 1689 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1690 * @param watermark The UART transmit watermark value to be programmed.
mbed_official 146:f64d43ff0c18 1691 * @return Error code if transmitter is enabled or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1692 */
mbed_official 146:f64d43ff0c18 1693 uart_status_t uart_hal_set_tx_fifo_watermark(uint32_t uartInstance, uint8_t watermark);
mbed_official 146:f64d43ff0c18 1694
mbed_official 146:f64d43ff0c18 1695 /*!
mbed_official 146:f64d43ff0c18 1696 * @brief Get the UART transmit FIFO watermark value.
mbed_official 146:f64d43ff0c18 1697 *
mbed_official 146:f64d43ff0c18 1698 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1699 * @return The value currently programmed for the UART transmit watermark.
mbed_official 146:f64d43ff0c18 1700 */
mbed_official 146:f64d43ff0c18 1701 uint8_t uart_hal_get_tx_fifo_watermark(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1702
mbed_official 146:f64d43ff0c18 1703 /*!
mbed_official 146:f64d43ff0c18 1704 * @brief Get the UART transmit FIFO data word count (number of words in the transmit FIFO).
mbed_official 146:f64d43ff0c18 1705 *
mbed_official 146:f64d43ff0c18 1706 * The function uart_hal_get_tx_dataword_count_in_fifo excludes any data that may
mbed_official 146:f64d43ff0c18 1707 * be in the UART transmit shift register
mbed_official 146:f64d43ff0c18 1708 *
mbed_official 146:f64d43ff0c18 1709 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1710 * @return The number of data words currently in the UART transmit FIFO.
mbed_official 146:f64d43ff0c18 1711 */
mbed_official 146:f64d43ff0c18 1712 uint8_t uart_hal_get_tx_dataword_count_in_fifo(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1713
mbed_official 146:f64d43ff0c18 1714 /*!
mbed_official 146:f64d43ff0c18 1715 * @brief Set the UART receive FIFO watermark value.
mbed_official 146:f64d43ff0c18 1716 *
mbed_official 146:f64d43ff0c18 1717 * Programming the receive watermark should be done when the receiver is disabled
mbed_official 146:f64d43ff0c18 1718 * and the value must be set less than the size obtained from uart_hal_get_rx_fifo_size and
mbed_official 146:f64d43ff0c18 1719 * greater than zero.
mbed_official 146:f64d43ff0c18 1720 *
mbed_official 146:f64d43ff0c18 1721 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1722 * @param watermark The UART receive watermark value to be programmed.
mbed_official 146:f64d43ff0c18 1723 * @return Error code if receiver is enabled or kStatus_UART_Success.
mbed_official 146:f64d43ff0c18 1724 */
mbed_official 146:f64d43ff0c18 1725 uart_status_t uart_hal_set_rx_fifo_watermark(uint32_t uartInstance, uint8_t watermark);
mbed_official 146:f64d43ff0c18 1726
mbed_official 146:f64d43ff0c18 1727 /*!
mbed_official 146:f64d43ff0c18 1728 * @brief Get the UART receive FIFO data word count (number of words in the receive FIFO).
mbed_official 146:f64d43ff0c18 1729 *
mbed_official 146:f64d43ff0c18 1730 * The function uart_hal_get_rx_dataword_count_in_fifo excludes any data that may be
mbed_official 146:f64d43ff0c18 1731 * in the receive shift register.
mbed_official 146:f64d43ff0c18 1732 *
mbed_official 146:f64d43ff0c18 1733 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1734 * @return The number of data words currently in the UART receive FIFO.
mbed_official 146:f64d43ff0c18 1735 */
mbed_official 146:f64d43ff0c18 1736 uint8_t uart_hal_get_rx_dataword_count_in_fifo(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1737
mbed_official 146:f64d43ff0c18 1738 /*!
mbed_official 146:f64d43ff0c18 1739 * @brief Get the UART receive FIFO watermark value.
mbed_official 146:f64d43ff0c18 1740 *
mbed_official 146:f64d43ff0c18 1741 * @param uartInstance UART module instance number.
mbed_official 146:f64d43ff0c18 1742 * @return The value currently programmed for the UART receive watermark.
mbed_official 146:f64d43ff0c18 1743 */
mbed_official 146:f64d43ff0c18 1744 uint8_t uart_hal_get_rx_fifo_watermark(uint32_t uartInstance);
mbed_official 146:f64d43ff0c18 1745
mbed_official 146:f64d43ff0c18 1746 #endif /* FSL_FEATURE_UART_HAS_FIFO*/
mbed_official 146:f64d43ff0c18 1747
mbed_official 146:f64d43ff0c18 1748 /*@}*/
mbed_official 146:f64d43ff0c18 1749
mbed_official 146:f64d43ff0c18 1750 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 1751 }
mbed_official 146:f64d43ff0c18 1752 #endif
mbed_official 146:f64d43ff0c18 1753
mbed_official 146:f64d43ff0c18 1754 /*! @}*/
mbed_official 146:f64d43ff0c18 1755
mbed_official 146:f64d43ff0c18 1756 #endif /* __FSL_UART_HAL_H__*/
mbed_official 146:f64d43ff0c18 1757 /*******************************************************************************
mbed_official 146:f64d43ff0c18 1758 * EOF
mbed_official 146:f64d43ff0c18 1759 ******************************************************************************/
mbed_official 146:f64d43ff0c18 1760