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 Sep 18 14:00:17 2014 +0100
Revision:
324:406fd2029f23
Synchronized with git revision a73f28e6fbca9559fbed2726410eeb4c0534a4a5

Full URL: https://github.com/mbedmicro/mbed/commit/a73f28e6fbca9559fbed2726410eeb4c0534a4a5/

Extended #476, which does not break ethernet for K64F

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 324:406fd2029f23 1 /*
mbed_official 324:406fd2029f23 2 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
mbed_official 324:406fd2029f23 3 * All rights reserved.
mbed_official 324:406fd2029f23 4 *
mbed_official 324:406fd2029f23 5 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 324:406fd2029f23 6 * are permitted provided that the following conditions are met:
mbed_official 324:406fd2029f23 7 *
mbed_official 324:406fd2029f23 8 * o Redistributions of source code must retain the above copyright notice, this list
mbed_official 324:406fd2029f23 9 * of conditions and the following disclaimer.
mbed_official 324:406fd2029f23 10 *
mbed_official 324:406fd2029f23 11 * o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 324:406fd2029f23 12 * list of conditions and the following disclaimer in the documentation and/or
mbed_official 324:406fd2029f23 13 * other materials provided with the distribution.
mbed_official 324:406fd2029f23 14 *
mbed_official 324:406fd2029f23 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 324:406fd2029f23 16 * contributors may be used to endorse or promote products derived from this
mbed_official 324:406fd2029f23 17 * software without specific prior written permission.
mbed_official 324:406fd2029f23 18 *
mbed_official 324:406fd2029f23 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 324:406fd2029f23 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 324:406fd2029f23 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 324:406fd2029f23 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 324:406fd2029f23 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 324:406fd2029f23 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 324:406fd2029f23 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 324:406fd2029f23 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 324:406fd2029f23 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 324:406fd2029f23 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 324:406fd2029f23 29 */
mbed_official 324:406fd2029f23 30
mbed_official 324:406fd2029f23 31 #ifndef __FSL_LPUART_HAL_H__
mbed_official 324:406fd2029f23 32 #define __FSL_LPUART_HAL_H__
mbed_official 324:406fd2029f23 33
mbed_official 324:406fd2029f23 34 #include <stdint.h>
mbed_official 324:406fd2029f23 35 #include <stdbool.h>
mbed_official 324:406fd2029f23 36 #include <assert.h>
mbed_official 324:406fd2029f23 37 #include "fsl_lpuart_features.h"
mbed_official 324:406fd2029f23 38 #include "fsl_device_registers.h"
mbed_official 324:406fd2029f23 39
mbed_official 324:406fd2029f23 40 #ifndef MBED_NO_LPUART
mbed_official 324:406fd2029f23 41
mbed_official 324:406fd2029f23 42 /*!
mbed_official 324:406fd2029f23 43 * @addtogroup lpuart_hal
mbed_official 324:406fd2029f23 44 * @{
mbed_official 324:406fd2029f23 45 */
mbed_official 324:406fd2029f23 46
mbed_official 324:406fd2029f23 47 /*******************************************************************************
mbed_official 324:406fd2029f23 48 * Definitions
mbed_official 324:406fd2029f23 49 ******************************************************************************/
mbed_official 324:406fd2029f23 50 #define LPUART_SHIFT (16U)
mbed_official 324:406fd2029f23 51 #define LPUART_BAUD_REG_ID (0U)
mbed_official 324:406fd2029f23 52 #define LPUART_STAT_REG_ID (1U)
mbed_official 324:406fd2029f23 53 #define LPUART_CTRL_REG_ID (2U)
mbed_official 324:406fd2029f23 54 #define LPUART_DATA_REG_ID (3U)
mbed_official 324:406fd2029f23 55 #define LPUART_MATCH_REG_ID (4U)
mbed_official 324:406fd2029f23 56 #define LPUART_MODIR_REG_ID (5U)
mbed_official 324:406fd2029f23 57
mbed_official 324:406fd2029f23 58 /*! @brief Error codes for the LPUART driver.*/
mbed_official 324:406fd2029f23 59 typedef enum _lpuart_status
mbed_official 324:406fd2029f23 60 {
mbed_official 324:406fd2029f23 61 kStatus_LPUART_Success,
mbed_official 324:406fd2029f23 62 kStatus_LPUART_BaudRateCalculationError , /*!< LPUART Baud Rate calculation error out of range. */
mbed_official 324:406fd2029f23 63 kStatus_LPUART_BaudRatePercentDiffExceeded, /*!< LPUART Baud Rate exceeds percentage difference*/
mbed_official 324:406fd2029f23 64 kStatus_LPUART_BitCountNotSupported, /*!< LPUART bit count configuration not supported.*/
mbed_official 324:406fd2029f23 65 kStatus_LPUART_StopBitCountNotSupported, /*!< LPUART stop bit count configuration not supported.*/
mbed_official 324:406fd2029f23 66 kStatus_LPUART_RxStandbyModeError, /*!< LPUART unable to place receiver in standby mode.*/
mbed_official 324:406fd2029f23 67 kStatus_LPUART_ClearStatusFlagError, /*!< LPUART clear status flag error.*/
mbed_official 324:406fd2029f23 68 kStatus_LPUART_MSBFirstNotSupported, /*!< LPUART MSB first feature not supported.*/
mbed_official 324:406fd2029f23 69 kStatus_LPUART_Resync_NotSupported, /*!< LPUART resync disable operation not supported.*/
mbed_official 324:406fd2029f23 70 kStatus_LPUART_TxNotDisabled, /*!< LPUART Transmitter not disabled before enabling feature*/
mbed_official 324:406fd2029f23 71 kStatus_LPUART_RxNotDisabled, /*!< LPUART Receiver not disabled before enabling feature*/
mbed_official 324:406fd2029f23 72 kStatus_LPUART_TxOrRxNotDisabled, /*!< LPUART Transmitter or Receiver not disabled*/
mbed_official 324:406fd2029f23 73 kStatus_LPUART_TxBusy, /*!< LPUART transmit still in progress.*/
mbed_official 324:406fd2029f23 74 kStatus_LPUART_RxBusy, /*!< LPUART receive still in progress.*/
mbed_official 324:406fd2029f23 75 kStatus_LPUART_NoTransmitInProgress, /*!< LPUART no transmit in progress.*/
mbed_official 324:406fd2029f23 76 kStatus_LPUART_NoReceiveInProgress, /*!< LPUART no receive in progress.*/
mbed_official 324:406fd2029f23 77 kStatus_LPUART_InvalidInstanceNumber, /*!< Invalid LPUART base address */
mbed_official 324:406fd2029f23 78 kStatus_LPUART_InvalidBitSetting, /*!< Invalid setting for desired LPUART register bit field */
mbed_official 324:406fd2029f23 79 kStatus_LPUART_OverSamplingNotSupported, /*!< LPUART oversampling not supported.*/
mbed_official 324:406fd2029f23 80 kStatus_LPUART_BothEdgeNotSupported, /*!< LPUART both edge sampling not supported. */
mbed_official 324:406fd2029f23 81 kStatus_LPUART_Timeout, /*!< LPUART transfer timed out.*/
mbed_official 324:406fd2029f23 82 kStatus_LPUART_Initialized,
mbed_official 324:406fd2029f23 83 } lpuart_status_t;
mbed_official 324:406fd2029f23 84
mbed_official 324:406fd2029f23 85 /*! @brief LPUART number of stop bits*/
mbed_official 324:406fd2029f23 86 typedef enum _lpuart_stop_bit_count {
mbed_official 324:406fd2029f23 87 kLpuartOneStopBit = 0, /*!< one stop bit*/
mbed_official 324:406fd2029f23 88 kLpuartTwoStopBit = 1, /*!< two stop bits*/
mbed_official 324:406fd2029f23 89 } lpuart_stop_bit_count_t;
mbed_official 324:406fd2029f23 90
mbed_official 324:406fd2029f23 91 /*! @brief LPUART parity mode*/
mbed_official 324:406fd2029f23 92 typedef enum _lpuart_parity_mode {
mbed_official 324:406fd2029f23 93 kLpuartParityDisabled = 0x0, /*!< parity disabled*/
mbed_official 324:406fd2029f23 94 kLpuartParityEven = 0x2, /*!< parity enabled, type even, bit setting: PE|PT = 10*/
mbed_official 324:406fd2029f23 95 kLpuartParityOdd = 0x3, /*!< parity enabled, type odd, bit setting: PE|PT = 11*/
mbed_official 324:406fd2029f23 96 } lpuart_parity_mode_t;
mbed_official 324:406fd2029f23 97
mbed_official 324:406fd2029f23 98 /*! @brief LPUART number of bits in a character*/
mbed_official 324:406fd2029f23 99 typedef enum _lpuart_bit_count_per_char {
mbed_official 324:406fd2029f23 100 kLpuart8BitsPerChar = 0, /*!< 8-bit data characters*/
mbed_official 324:406fd2029f23 101 kLpuart9BitsPerChar = 1, /*!< 9-bit data characters*/
mbed_official 324:406fd2029f23 102 kLpuart10BitsPerChar = 2, /*!< 10-bit data characters*/
mbed_official 324:406fd2029f23 103 } lpuart_bit_count_per_char_t;
mbed_official 324:406fd2029f23 104
mbed_official 324:406fd2029f23 105 /*! @brief LPUART operation configuration constants*/
mbed_official 324:406fd2029f23 106 typedef enum _lpuart_operation_config {
mbed_official 324:406fd2029f23 107 kLpuartOperates = 0,/*!< LPUART continues to operate normally.*/
mbed_official 324:406fd2029f23 108 kLpuartStops = 1, /*!< LPUART stops operation. */
mbed_official 324:406fd2029f23 109 } lpuart_operation_config_t;
mbed_official 324:406fd2029f23 110
mbed_official 324:406fd2029f23 111 /*! @brief LPUART wakeup from standby method constants*/
mbed_official 324:406fd2029f23 112 typedef enum _lpuart_wakeup_method {
mbed_official 324:406fd2029f23 113 kLpuartIdleLineWake = 0, /*!< Idle-line wakes the LPUART receiver from standby. */
mbed_official 324:406fd2029f23 114 kLpuartAddrMarkWake = 1, /*!< Addr-mark wakes LPUART receiver from standby.*/
mbed_official 324:406fd2029f23 115 } lpuart_wakeup_method_t;
mbed_official 324:406fd2029f23 116
mbed_official 324:406fd2029f23 117 /*! @brief LPUART idle line detect selection types*/
mbed_official 324:406fd2029f23 118 typedef enum _lpuart_idle_line_select {
mbed_official 324:406fd2029f23 119 kLpuartIdleLineAfterStartBit = 0, /*!< LPUART idle character bit count start after start bit */
mbed_official 324:406fd2029f23 120 kLpuartIdleLineAfterStopBit = 1, /*!< LPUART idle character bit count start after stop bit */
mbed_official 324:406fd2029f23 121 } lpuart_idle_line_select_t;
mbed_official 324:406fd2029f23 122
mbed_official 324:406fd2029f23 123 /*!
mbed_official 324:406fd2029f23 124 * @brief LPUART break character length settings for transmit/detect.
mbed_official 324:406fd2029f23 125 *
mbed_official 324:406fd2029f23 126 * The actual maximum bit times may vary depending on the LPUART instance.
mbed_official 324:406fd2029f23 127 */
mbed_official 324:406fd2029f23 128 typedef enum _lpuart_break_char_length {
mbed_official 324:406fd2029f23 129 kLpuartBreakChar10BitMinimum = 0, /*!< LPUART break char length 10 bit times (if M = 0, SBNS = 0)
mbed_official 324:406fd2029f23 130 or 11 (if M = 1, SBNS = 0 or M = 0, SBNS = 1) or 12 (if M = 1,
mbed_official 324:406fd2029f23 131 SBNS = 1 or M10 = 1, SNBS = 0) or 13 (if M10 = 1, SNBS = 1 .*/
mbed_official 324:406fd2029f23 132 kLpuartBreakChar13BitMinimum = 1, /*!< LPUART break char length 13 bit times (if M = 0, SBNS = 0)
mbed_official 324:406fd2029f23 133 or 14 (if M = 1, SBNS = 0 or M = 0, SBNS = 1) or 15 (if M = 1,
mbed_official 324:406fd2029f23 134 SBNS = 1 or M10 = 1, SNBS = 0) or 16 (if M10 = 1, SNBS = 1)*/
mbed_official 324:406fd2029f23 135 } lpuart_break_char_length_t;
mbed_official 324:406fd2029f23 136
mbed_official 324:406fd2029f23 137 /*! @brief LPUART single-wire mode TX direction*/
mbed_official 324:406fd2029f23 138 typedef enum _lpuart_singlewire_txdir {
mbed_official 324:406fd2029f23 139 kLpuartSinglewireTxdirIn = 0, /*!< LPUART Single Wire mode TXDIR input*/
mbed_official 324:406fd2029f23 140 kLpuartSinglewireTxdirOut = 1, /*!< LPUART Single Wire mode TXDIR output*/
mbed_official 324:406fd2029f23 141 } lpuart_singlewire_txdir_t;
mbed_official 324:406fd2029f23 142
mbed_official 324:406fd2029f23 143 /*! @brief LPUART Configures the match addressing mode used.*/
mbed_official 324:406fd2029f23 144 typedef enum _lpuart_match_config {
mbed_official 324:406fd2029f23 145 kLpuartAddressMatchWakeup = 0, /*!< LPUART Address Match Wakeup*/
mbed_official 324:406fd2029f23 146 kLpuartIdleMatchWakeup = 1, /*!< LPUART Idle Match Wakeup*/
mbed_official 324:406fd2029f23 147 kLpuartMatchOnAndMatchOff = 2, /*!< LPUART Match On and Match Off*/
mbed_official 324:406fd2029f23 148 kLpuartEnablesRwuOnDataMatch = 3, /*!< LPUART Enables RWU on Data Match and Match On/Off for transmitter CTS input*/
mbed_official 324:406fd2029f23 149 } lpuart_match_config_t;
mbed_official 324:406fd2029f23 150
mbed_official 324:406fd2029f23 151 /*! @brief LPUART infra-red transmitter pulse width options*/
mbed_official 324:406fd2029f23 152 typedef enum _lpuart_ir_tx_pulsewidth {
mbed_official 324:406fd2029f23 153 kLpuartIrThreeSixteenthsWidth = 0, /*!< 3/16 pulse*/
mbed_official 324:406fd2029f23 154 kLpuartIrOneSixteenthWidth = 1, /*!< 1/16 pulse*/
mbed_official 324:406fd2029f23 155 kLpuartIrOneThirtysecondsWidth = 2, /*!< 1/32 pulse*/
mbed_official 324:406fd2029f23 156 kLpuartIrOneFourthWidth = 3, /*!< 1/4 pulse*/
mbed_official 324:406fd2029f23 157 } lpuart_ir_tx_pulsewidth_t;
mbed_official 324:406fd2029f23 158
mbed_official 324:406fd2029f23 159 /*! @brief LPUART Configures the number of idle characters that must be received before the IDLE flag is set. */
mbed_official 324:406fd2029f23 160 typedef enum _lpuart_idle_config {
mbed_official 324:406fd2029f23 161 kLpuart_1_IdleChar = 0, /*!< 1 idle character*/
mbed_official 324:406fd2029f23 162 kLpuart_2_IdleChar = 1, /*!< 2 idle character*/
mbed_official 324:406fd2029f23 163 kLpuart_4_IdleChar = 2, /*!< 4 idle character*/
mbed_official 324:406fd2029f23 164 kLpuart_8_IdleChar = 3, /*!< 8 idle character*/
mbed_official 324:406fd2029f23 165 kLpuart_16_IdleChar = 4, /*!< 16 idle character*/
mbed_official 324:406fd2029f23 166 kLpuart_32_IdleChar = 5, /*!< 32 idle character*/
mbed_official 324:406fd2029f23 167 kLpuart_64_IdleChar = 6, /*!< 64 idle character*/
mbed_official 324:406fd2029f23 168 kLpuart_128_IdleChar = 7, /*!< 128 idle character*/
mbed_official 324:406fd2029f23 169 } lpuart_idle_config_t;
mbed_official 324:406fd2029f23 170
mbed_official 324:406fd2029f23 171 /*! @brief LPUART Transmits the CTS Configuration. Configures the source of the CTS input.*/
mbed_official 324:406fd2029f23 172 typedef enum _lpuart_cts_source {
mbed_official 324:406fd2029f23 173 kLpuartCtsSourcePin = 0, /*!< LPUART CTS input is the LPUART_CTS pin.*/
mbed_official 324:406fd2029f23 174 kLpuartCtsSourceInvertedReceiverMatch = 1, /*!< LPUART CTS input is the inverted Receiver Match result.*/
mbed_official 324:406fd2029f23 175 } lpuart_cts_source_t;
mbed_official 324:406fd2029f23 176
mbed_official 324:406fd2029f23 177 /*! @brief LPUART Transmits CTS Source.Configures if the CTS state is checked at the start of each character or only when the transmitter is idle.*/
mbed_official 324:406fd2029f23 178 typedef enum _lpuart_cts_config {
mbed_official 324:406fd2029f23 179 kLpuartCtsSampledOnEachCharacter = 0, /*!< LPUART CTS input is sampled at the start of each character.*/
mbed_official 324:406fd2029f23 180 kLpuartCtsSampledOnIdle = 1, /*!< LPUART CTS input is sampled when the transmitter is idle.*/
mbed_official 324:406fd2029f23 181 } lpuart_cts_config_t;
mbed_official 324:406fd2029f23 182
mbed_official 324:406fd2029f23 183 /*! @brief Structure for idle line configuration settings*/
mbed_official 324:406fd2029f23 184 typedef struct LpuartIdleLineConfig {
mbed_official 324:406fd2029f23 185 unsigned idleLineType : 1; /*!< ILT, Idle bit count start: 0 - after start bit (default),*/
mbed_official 324:406fd2029f23 186 /*! 1 - after stop bit */
mbed_official 324:406fd2029f23 187 unsigned rxWakeIdleDetect : 1; /*!< RWUID, Receiver Wake Up Idle Detect. IDLE status bit */
mbed_official 324:406fd2029f23 188 /*! operation during receive standbyControls whether idle */
mbed_official 324:406fd2029f23 189 /*! character that wakes up receiver will also set */
mbed_official 324:406fd2029f23 190 /*! IDLE status bit 0 - IDLE status bit doesn't */
mbed_official 324:406fd2029f23 191 /*! get set (default), 1 - IDLE status bit gets set*/
mbed_official 324:406fd2029f23 192 } lpuart_idle_line_config_t;
mbed_official 324:406fd2029f23 193
mbed_official 324:406fd2029f23 194 /*!
mbed_official 324:406fd2029f23 195 * @brief LPUART status flags.
mbed_official 324:406fd2029f23 196 *
mbed_official 324:406fd2029f23 197 * This provides constants for the LPUART status flags for use in the UART functions.
mbed_official 324:406fd2029f23 198 */
mbed_official 324:406fd2029f23 199 typedef enum _lpuart_status_flag {
mbed_official 324:406fd2029f23 200 kLpuartTxDataRegEmpty = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_TDRE, /*!< Tx data register empty flag, sets when Tx buffer is empty */
mbed_official 324:406fd2029f23 201 kLpuartTxComplete = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_TC, /*!< Transmission complete flag, sets when transmission activity complete */
mbed_official 324:406fd2029f23 202 kLpuartRxDataRegFull = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_RDRF, /*!< Rx data register full flag, sets when the receive data buffer is full */
mbed_official 324:406fd2029f23 203 kLpuartIdleLineDetect = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_IDLE, /*!< Idle line detect flag, sets when idle line detected */
mbed_official 324:406fd2029f23 204 kLpuartRxOverrun = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_OR, /*!< Rxr Overrun, sets when new data is received before data is read from receive register */
mbed_official 324:406fd2029f23 205 kLpuartNoiseDetect = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_NF, /*!< Rxr takes 3 samples of each received bit. If any of these samples differ, noise flag sets */
mbed_official 324:406fd2029f23 206 kLpuartFrameErr = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_FE, /*!< Frame error flag, sets if logic 0 was detected where stop bit expected */
mbed_official 324:406fd2029f23 207 kLpuartParityErr = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_PF, /*!< If parity enabled, sets upon parity error detection */
mbed_official 324:406fd2029f23 208 kLpuartLineBreakDetect = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_LBKDE, /*!< LIN break detect interrupt flag, sets when LIN break char detected and LIN circuit enabled */
mbed_official 324:406fd2029f23 209 kLpuartRxActiveEdgeDetect = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_RXEDGIF, /*!< Rx pin active edge interrupt flag, sets when active edge detected */
mbed_official 324:406fd2029f23 210 kLpuartRxActive = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_RAF, /*!< Receiver Active Flag (RAF), sets at beginning of valid start bit */
mbed_official 324:406fd2029f23 211 #if FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS
mbed_official 324:406fd2029f23 212 kLpuartNoiseInCurrentWord = LPUART_DATA_REG_ID << LPUART_SHIFT | BP_LPUART_DATA_NOISY, /*!< NOISY bit, sets if noise detected in current data word */
mbed_official 324:406fd2029f23 213 kLpuartParityErrInCurrentWord = LPUART_DATA_REG_ID << LPUART_SHIFT | BP_LPUART_DATA_PARITYE, /*!< PARITYE bit, sets if noise detected in current data word */
mbed_official 324:406fd2029f23 214 #endif
mbed_official 324:406fd2029f23 215 #if FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING
mbed_official 324:406fd2029f23 216 kLpuartMatchAddrOne = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_MA1F, /*!< Address one match flag */
mbed_official 324:406fd2029f23 217 kLpuartMatchAddrTwo = LPUART_STAT_REG_ID << LPUART_SHIFT | BP_LPUART_STAT_MA2F, /*!< Address two match flag */
mbed_official 324:406fd2029f23 218 #endif
mbed_official 324:406fd2029f23 219 } lpuart_status_flag_t;
mbed_official 324:406fd2029f23 220
mbed_official 324:406fd2029f23 221 /*! @brief LPUART interrupt configuration structure, default settings are 0 (disabled)*/
mbed_official 324:406fd2029f23 222 typedef enum _lpuart_interrupt {
mbed_official 324:406fd2029f23 223 kLpuartIntLinBreakDetect = LPUART_BAUD_REG_ID << LPUART_SHIFT | BP_LPUART_BAUD_LBKDIE, /*!< LIN break detect. */
mbed_official 324:406fd2029f23 224 kLpuartIntRxActiveEdge = LPUART_BAUD_REG_ID << LPUART_SHIFT | BP_LPUART_BAUD_RXEDGIE, /*!< RX Active Edge. */
mbed_official 324:406fd2029f23 225 kLpuartIntTxDataRegEmpty = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_TIE, /*!< Transmit data register empty. */
mbed_official 324:406fd2029f23 226 kLpuartIntTxComplete = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_TCIE, /*!< Transmission complete. */
mbed_official 324:406fd2029f23 227 kLpuartIntRxDataRegFull = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_RIE, /*!< Receiver data register full. */
mbed_official 324:406fd2029f23 228 kLpuartIntIdleLine = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_ILIE, /*!< Idle line. */
mbed_official 324:406fd2029f23 229 kLpuartIntRxOverrun = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_ORIE, /*!< Receiver Overrun. */
mbed_official 324:406fd2029f23 230 kLpuartIntNoiseErrFlag = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_NEIE, /*!< Noise error flag. */
mbed_official 324:406fd2029f23 231 kLpuartIntFrameErrFlag = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_FEIE, /*!< Framing error flag. */
mbed_official 324:406fd2029f23 232 kLpuartIntParityErrFlag = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_PEIE, /*!< Parity error flag. */
mbed_official 324:406fd2029f23 233 #if FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING
mbed_official 324:406fd2029f23 234 kLpuartIntMatchAddrOne = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_MA1IE, /*!< Match address one flag. */
mbed_official 324:406fd2029f23 235 kLpuartIntMatchAddrTwo = LPUART_CTRL_REG_ID << LPUART_SHIFT | BP_LPUART_CTRL_MA2IE, /*!< Match address two flag. */
mbed_official 324:406fd2029f23 236 #endif
mbed_official 324:406fd2029f23 237 } lpuart_interrupt_t;
mbed_official 324:406fd2029f23 238
mbed_official 324:406fd2029f23 239
mbed_official 324:406fd2029f23 240 /*******************************************************************************
mbed_official 324:406fd2029f23 241 * API
mbed_official 324:406fd2029f23 242 ******************************************************************************/
mbed_official 324:406fd2029f23 243
mbed_official 324:406fd2029f23 244 #if defined(__cplusplus)
mbed_official 324:406fd2029f23 245 extern "C" {
mbed_official 324:406fd2029f23 246 #endif
mbed_official 324:406fd2029f23 247
mbed_official 324:406fd2029f23 248 /*!
mbed_official 324:406fd2029f23 249 * @name LPUART Common Configurations
mbed_official 324:406fd2029f23 250 * @{
mbed_official 324:406fd2029f23 251 */
mbed_official 324:406fd2029f23 252
mbed_official 324:406fd2029f23 253 /*!
mbed_official 324:406fd2029f23 254 * @brief Initializes the LPUART controller to known state.
mbed_official 324:406fd2029f23 255 *
mbed_official 324:406fd2029f23 256 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 257 */
mbed_official 324:406fd2029f23 258 void LPUART_HAL_Init(uint32_t baseAddr);
mbed_official 324:406fd2029f23 259
mbed_official 324:406fd2029f23 260 /*!
mbed_official 324:406fd2029f23 261 * @brief Enables the LPUART transmitter.
mbed_official 324:406fd2029f23 262 *
mbed_official 324:406fd2029f23 263 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 264 */
mbed_official 324:406fd2029f23 265 void LPUART_HAL_EnableTransmitter(uint32_t baseAddr);
mbed_official 324:406fd2029f23 266
mbed_official 324:406fd2029f23 267 /*!
mbed_official 324:406fd2029f23 268 * @brief Disables the LPUART transmitter.
mbed_official 324:406fd2029f23 269 *
mbed_official 324:406fd2029f23 270 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 271 */
mbed_official 324:406fd2029f23 272 static inline void LPUART_HAL_DisableTransmitter(uint32_t baseAddr)
mbed_official 324:406fd2029f23 273 {
mbed_official 324:406fd2029f23 274 BW_LPUART_CTRL_TE(baseAddr, 0);
mbed_official 324:406fd2029f23 275 }
mbed_official 324:406fd2029f23 276
mbed_official 324:406fd2029f23 277 /*!
mbed_official 324:406fd2029f23 278 * @brief Gets the LPUART transmitter enabled/disabled configuration.
mbed_official 324:406fd2029f23 279 *
mbed_official 324:406fd2029f23 280 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 281 * @return State of LPUART transmitter enable(1)/disable(0)
mbed_official 324:406fd2029f23 282 */
mbed_official 324:406fd2029f23 283 static inline bool LPUART_HAL_IsTransmitterEnabled(uint32_t baseAddr)
mbed_official 324:406fd2029f23 284 {
mbed_official 324:406fd2029f23 285 return BR_LPUART_CTRL_TE(baseAddr);
mbed_official 324:406fd2029f23 286 }
mbed_official 324:406fd2029f23 287
mbed_official 324:406fd2029f23 288 /*!
mbed_official 324:406fd2029f23 289 * @brief Enables the LPUART receiver.
mbed_official 324:406fd2029f23 290 *
mbed_official 324:406fd2029f23 291 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 292 */
mbed_official 324:406fd2029f23 293 static inline void LPUART_HAL_EnableReceiver(uint32_t baseAddr)
mbed_official 324:406fd2029f23 294 {
mbed_official 324:406fd2029f23 295 BW_LPUART_CTRL_RE(baseAddr, 1);
mbed_official 324:406fd2029f23 296 }
mbed_official 324:406fd2029f23 297
mbed_official 324:406fd2029f23 298 /*!
mbed_official 324:406fd2029f23 299 * @brief Disables the LPUART receiver.
mbed_official 324:406fd2029f23 300 *
mbed_official 324:406fd2029f23 301 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 302 */
mbed_official 324:406fd2029f23 303 static inline void LPUART_HAL_DisableReceiver(uint32_t baseAddr)
mbed_official 324:406fd2029f23 304 {
mbed_official 324:406fd2029f23 305 BW_LPUART_CTRL_RE(baseAddr, 0);
mbed_official 324:406fd2029f23 306 }
mbed_official 324:406fd2029f23 307
mbed_official 324:406fd2029f23 308 /*!
mbed_official 324:406fd2029f23 309 * @brief Gets the LPUART receiver enabled/disabled configuration.
mbed_official 324:406fd2029f23 310 *
mbed_official 324:406fd2029f23 311 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 312 * @return State of LPUART receiver enable(1)/disable(0)
mbed_official 324:406fd2029f23 313 */
mbed_official 324:406fd2029f23 314 static inline bool LPUART_HAL_IsReceiverEnabled(uint32_t baseAddr)
mbed_official 324:406fd2029f23 315 {
mbed_official 324:406fd2029f23 316 return BR_LPUART_CTRL_RE(baseAddr);
mbed_official 324:406fd2029f23 317 }
mbed_official 324:406fd2029f23 318
mbed_official 324:406fd2029f23 319 /*!
mbed_official 324:406fd2029f23 320 * @brief Configures the LPUART baud rate.
mbed_official 324:406fd2029f23 321 *
mbed_official 324:406fd2029f23 322 * In some LPUART instances the user must disable the transmitter/receiver
mbed_official 324:406fd2029f23 323 * before calling this function.
mbed_official 324:406fd2029f23 324 * Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 325 *
mbed_official 324:406fd2029f23 326 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 327 * @param sourceClockInHz LPUART source input clock in Hz.
mbed_official 324:406fd2029f23 328 * @param desiredBaudRate LPUART desired baud rate.
mbed_official 324:406fd2029f23 329 * @return An error code or kStatus_Success
mbed_official 324:406fd2029f23 330 */
mbed_official 324:406fd2029f23 331 lpuart_status_t LPUART_HAL_SetBaudRate(uint32_t baseAddr, uint32_t sourceClockInHz,
mbed_official 324:406fd2029f23 332 uint32_t desiredBaudRate);
mbed_official 324:406fd2029f23 333
mbed_official 324:406fd2029f23 334 /*!
mbed_official 324:406fd2029f23 335 * @brief Sets the LPUART baud rate modulo divisor.
mbed_official 324:406fd2029f23 336 *
mbed_official 324:406fd2029f23 337 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 338 * @param baudRateDivisor The baud rate modulo division "SBR"
mbed_official 324:406fd2029f23 339 */
mbed_official 324:406fd2029f23 340 static inline void LPUART_HAL_SetBaudRateDivisor(uint32_t baseAddr, uint32_t baudRateDivisor)
mbed_official 324:406fd2029f23 341 {
mbed_official 324:406fd2029f23 342 assert ((baudRateDivisor < 0x1FFF) && (baudRateDivisor > 1));
mbed_official 324:406fd2029f23 343 BW_LPUART_BAUD_SBR(baseAddr, baudRateDivisor);
mbed_official 324:406fd2029f23 344 }
mbed_official 324:406fd2029f23 345
mbed_official 324:406fd2029f23 346 #if FSL_FEATURE_LPUART_HAS_BAUD_RATE_OVER_SAMPLING_SUPPORT
mbed_official 324:406fd2029f23 347 /*!
mbed_official 324:406fd2029f23 348 * @brief Sets the LPUART baud rate oversampling ratio (Note: Feature available on select
mbed_official 324:406fd2029f23 349 * LPUART instances used together with baud rate programming)
mbed_official 324:406fd2029f23 350 * The oversampling ratio should be set between 4x (00011) and 32x (11111). Writing
mbed_official 324:406fd2029f23 351 * an invalid oversampling ratio results in an error and is set to a default
mbed_official 324:406fd2029f23 352 * 16x (01111) oversampling ratio.
mbed_official 324:406fd2029f23 353 * IDisable the transmitter/receiver before calling
mbed_official 324:406fd2029f23 354 * this function.
mbed_official 324:406fd2029f23 355 *
mbed_official 324:406fd2029f23 356 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 357 * @param overSamplingRatio The oversampling ratio "OSR"
mbed_official 324:406fd2029f23 358 */
mbed_official 324:406fd2029f23 359 static inline void LPUART_HAL_SetOversamplingRatio(uint32_t baseAddr, uint32_t overSamplingRatio)
mbed_official 324:406fd2029f23 360 {
mbed_official 324:406fd2029f23 361 assert(overSamplingRatio < 0x1F);
mbed_official 324:406fd2029f23 362 BW_LPUART_BAUD_OSR(baseAddr, overSamplingRatio);
mbed_official 324:406fd2029f23 363 }
mbed_official 324:406fd2029f23 364 #endif
mbed_official 324:406fd2029f23 365
mbed_official 324:406fd2029f23 366 #if FSL_FEATURE_LPUART_HAS_BOTH_EDGE_SAMPLING_SUPPORT
mbed_official 324:406fd2029f23 367 /*!
mbed_official 324:406fd2029f23 368 * @brief Configures the LPUART baud rate both edge sampling (Note: Feature available on select
mbed_official 324:406fd2029f23 369 * LPUART instances used with baud rate programming)
mbed_official 324:406fd2029f23 370 * When enabled, the received data is sampled on both edges of the baud rate clock.
mbed_official 324:406fd2029f23 371 * This must be set when the oversampling ratio is between 4x and 7x.
mbed_official 324:406fd2029f23 372 * This function should only be called when the receiver is disabled.
mbed_official 324:406fd2029f23 373 *
mbed_official 324:406fd2029f23 374 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 375 * @param enableBothEdgeSampling Enable (1) or Disable (0) Both Edge Sampling
mbed_official 324:406fd2029f23 376 * @return An error code or kStatus_Success
mbed_official 324:406fd2029f23 377 */
mbed_official 324:406fd2029f23 378 static inline void LPUART_HAL_SetBothEdgeSamplingCmd(uint32_t baseAddr, bool enableBothEdgeSampling)
mbed_official 324:406fd2029f23 379 {
mbed_official 324:406fd2029f23 380 BW_LPUART_BAUD_BOTHEDGE(baseAddr, enableBothEdgeSampling);
mbed_official 324:406fd2029f23 381 }
mbed_official 324:406fd2029f23 382 #endif
mbed_official 324:406fd2029f23 383
mbed_official 324:406fd2029f23 384 /*!
mbed_official 324:406fd2029f23 385 * @brief Configures the number of bits per character in the LPUART controller.
mbed_official 324:406fd2029f23 386 *
mbed_official 324:406fd2029f23 387 * In some LPUART instances, the user should disable the transmitter/receiver
mbed_official 324:406fd2029f23 388 * before calling this function.
mbed_official 324:406fd2029f23 389 * Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 390 *
mbed_official 324:406fd2029f23 391 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 392 * @param bitCountPerChar Number of bits per char (8, 9, or
mbed_official 324:406fd2029f23 393 * 10, depending on the LPUART instance)
mbed_official 324:406fd2029f23 394 */
mbed_official 324:406fd2029f23 395 void LPUART_HAL_SetBitCountPerChar(uint32_t baseAddr, lpuart_bit_count_per_char_t bitCountPerChar);
mbed_official 324:406fd2029f23 396
mbed_official 324:406fd2029f23 397
mbed_official 324:406fd2029f23 398 /*!
mbed_official 324:406fd2029f23 399 * @brief Configures parity mode in the LPUART controller.
mbed_official 324:406fd2029f23 400 *
mbed_official 324:406fd2029f23 401 * In some LPUART instances, the user should disable the transmitter/receiver
mbed_official 324:406fd2029f23 402 * before calling this function.
mbed_official 324:406fd2029f23 403 * Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 404 *
mbed_official 324:406fd2029f23 405 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 406 * @param parityModeType Parity mode (enabled, disable, odd, even - see parity_mode_t struct)
mbed_official 324:406fd2029f23 407 */
mbed_official 324:406fd2029f23 408 void LPUART_HAL_SetParityMode(uint32_t baseAddr, lpuart_parity_mode_t parityModeType);
mbed_official 324:406fd2029f23 409
mbed_official 324:406fd2029f23 410 /*!
mbed_official 324:406fd2029f23 411 * @brief Configures the number of stop bits in the LPUART controller.
mbed_official 324:406fd2029f23 412 * In some LPUART instances, the user should disable the transmitter/receiver
mbed_official 324:406fd2029f23 413 * before calling this function.
mbed_official 324:406fd2029f23 414 * Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 415 *
mbed_official 324:406fd2029f23 416 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 417 * @param stopBitCount Number of stop bits (1 or 2 - see lpuart_stop_bit_count_t struct)
mbed_official 324:406fd2029f23 418 * @return An error code (an unsupported setting in some LPUARTs) or kStatus_Success
mbed_official 324:406fd2029f23 419 */
mbed_official 324:406fd2029f23 420 static inline void LPUART_HAL_SetStopBitCount(uint32_t baseAddr, lpuart_stop_bit_count_t stopBitCount)
mbed_official 324:406fd2029f23 421 {
mbed_official 324:406fd2029f23 422 /* configure the number of stop bits */
mbed_official 324:406fd2029f23 423 BW_LPUART_BAUD_SBNS(baseAddr, stopBitCount);
mbed_official 324:406fd2029f23 424 }
mbed_official 324:406fd2029f23 425
mbed_official 324:406fd2029f23 426 /*!
mbed_official 324:406fd2029f23 427 * @brief Configures the transmit and receive inversion control in the LPUART controller.
mbed_official 324:406fd2029f23 428 *
mbed_official 324:406fd2029f23 429 * This function should only be called when the LPUART is between transmit and receive packets.
mbed_official 324:406fd2029f23 430 *
mbed_official 324:406fd2029f23 431 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 432 * @param rxInvert Enable (1) or disable (0) receive inversion
mbed_official 324:406fd2029f23 433 * @param txInvert Enable (1) or disable (0) transmit inversion
mbed_official 324:406fd2029f23 434 */
mbed_official 324:406fd2029f23 435 void LPUART_HAL_SetTxRxInversionCmd(uint32_t baseAddr, uint32_t rxInvert, uint32_t txInvert);
mbed_official 324:406fd2029f23 436
mbed_official 324:406fd2029f23 437 /*@}*/
mbed_official 324:406fd2029f23 438
mbed_official 324:406fd2029f23 439 /*!
mbed_official 324:406fd2029f23 440 * @name LPUART Interrupts and DMA
mbed_official 324:406fd2029f23 441 * @{
mbed_official 324:406fd2029f23 442 */
mbed_official 324:406fd2029f23 443
mbed_official 324:406fd2029f23 444 /*!
mbed_official 324:406fd2029f23 445 * @brief Configures the LPUART module interrupts to enable/disable various interrupt sources.
mbed_official 324:406fd2029f23 446 *
mbed_official 324:406fd2029f23 447 * @param baseAddr LPUART module base address.
mbed_official 324:406fd2029f23 448 * @param interrupt LPUART interrupt configuration data.
mbed_official 324:406fd2029f23 449 * @param enable true: enable, false: disable.
mbed_official 324:406fd2029f23 450 */
mbed_official 324:406fd2029f23 451 void LPUART_HAL_SetIntMode(uint32_t baseAddr, lpuart_interrupt_t interrupt, bool enable);
mbed_official 324:406fd2029f23 452
mbed_official 324:406fd2029f23 453 /*!
mbed_official 324:406fd2029f23 454 * @brief Returns whether the LPUART module interrupts is enabled/disabled.
mbed_official 324:406fd2029f23 455 *
mbed_official 324:406fd2029f23 456 * @param baseAddr LPUART module base address.
mbed_official 324:406fd2029f23 457 * @param interrupt LPUART interrupt configuration data.
mbed_official 324:406fd2029f23 458 * @return true: enable, false: disable.
mbed_official 324:406fd2029f23 459 */
mbed_official 324:406fd2029f23 460 bool LPUART_HAL_GetIntMode(uint32_t baseAddr, lpuart_interrupt_t interrupt);
mbed_official 324:406fd2029f23 461
mbed_official 324:406fd2029f23 462 /*!
mbed_official 324:406fd2029f23 463 * @brief Enable/Disable the transmission_complete_interrupt.
mbed_official 324:406fd2029f23 464 *
mbed_official 324:406fd2029f23 465 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 466 * @param enable true: enable, false: disable.
mbed_official 324:406fd2029f23 467 */
mbed_official 324:406fd2029f23 468 static inline void LPUART_HAL_SetTxDataRegEmptyIntCmd(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 469 {
mbed_official 324:406fd2029f23 470 BW_LPUART_CTRL_TIE(baseAddr, enable);
mbed_official 324:406fd2029f23 471 }
mbed_official 324:406fd2029f23 472
mbed_official 324:406fd2029f23 473 /*!
mbed_official 324:406fd2029f23 474 * @brief Gets the configuration of the transmission_data_register_empty_interrupt enable setting.
mbed_official 324:406fd2029f23 475 *
mbed_official 324:406fd2029f23 476 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 477 * @return Bit setting of the interrupt enable bit
mbed_official 324:406fd2029f23 478 */
mbed_official 324:406fd2029f23 479 static inline bool LPUART_HAL_GetTxDataRegEmptyIntCmd(uint32_t baseAddr)
mbed_official 324:406fd2029f23 480 {
mbed_official 324:406fd2029f23 481 return BR_LPUART_CTRL_TIE(baseAddr);
mbed_official 324:406fd2029f23 482 }
mbed_official 324:406fd2029f23 483
mbed_official 324:406fd2029f23 484 /*!
mbed_official 324:406fd2029f23 485 * @brief Enables the rx_data_register_full_interrupt.
mbed_official 324:406fd2029f23 486 *
mbed_official 324:406fd2029f23 487 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 488 * @param enable true: enable, false: disable.
mbed_official 324:406fd2029f23 489 */
mbed_official 324:406fd2029f23 490 static inline void LPUART_HAL_SetRxDataRegFullIntCmd(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 491 {
mbed_official 324:406fd2029f23 492 BW_LPUART_CTRL_RIE(baseAddr, enable);
mbed_official 324:406fd2029f23 493 }
mbed_official 324:406fd2029f23 494
mbed_official 324:406fd2029f23 495 /*!
mbed_official 324:406fd2029f23 496 * @brief Gets the configuration of the rx_data_register_full_interrupt enable.
mbed_official 324:406fd2029f23 497 *
mbed_official 324:406fd2029f23 498 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 499 * @return Bit setting of the interrupt enable bit
mbed_official 324:406fd2029f23 500 */
mbed_official 324:406fd2029f23 501 static inline bool LPUART_HAL_GetRxDataRegFullIntCmd(uint32_t baseAddr)
mbed_official 324:406fd2029f23 502 {
mbed_official 324:406fd2029f23 503 return BR_LPUART_CTRL_RIE(baseAddr);
mbed_official 324:406fd2029f23 504 }
mbed_official 324:406fd2029f23 505
mbed_official 324:406fd2029f23 506 #if FSL_FEATURE_LPUART_HAS_DMA_ENABLE
mbed_official 324:406fd2029f23 507 /*!
mbed_official 324:406fd2029f23 508 * @brief LPUART configures DMA requests for Transmitter and Receiver.
mbed_official 324:406fd2029f23 509 *
mbed_official 324:406fd2029f23 510 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 511 * @param txDmaConfig Transmit DMA request configuration (enable:1 /disable: 0)
mbed_official 324:406fd2029f23 512 * @param rxDmaConfig Receive DMA request configuration (enable: 1/disable: 0)
mbed_official 324:406fd2029f23 513 */
mbed_official 324:406fd2029f23 514 void LPUART_HAL_ConfigureDma(uint32_t baseAddr, bool txDmaConfig, bool rxDmaConfig);
mbed_official 324:406fd2029f23 515
mbed_official 324:406fd2029f23 516 /*!
mbed_official 324:406fd2029f23 517 * @brief Gets the LPUART Transmit DMA request configuration.
mbed_official 324:406fd2029f23 518 *
mbed_official 324:406fd2029f23 519 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 520 * @return Transmit DMA request configuration (enable: 1/disable: 0)
mbed_official 324:406fd2029f23 521 */
mbed_official 324:406fd2029f23 522 static inline bool LPUART_HAL_IsTxDmaEnabled(uint32_t baseAddr)
mbed_official 324:406fd2029f23 523 {
mbed_official 324:406fd2029f23 524 /* TDMAE configures the transmit data register empty flag, S1[TDRE], to */
mbed_official 324:406fd2029f23 525 /* generate a DMA request. */
mbed_official 324:406fd2029f23 526 return BR_LPUART_BAUD_TDMAE(baseAddr);
mbed_official 324:406fd2029f23 527 }
mbed_official 324:406fd2029f23 528
mbed_official 324:406fd2029f23 529 /*!
mbed_official 324:406fd2029f23 530 * @brief Gets the LPUART receive DMA request configuration.
mbed_official 324:406fd2029f23 531 *
mbed_official 324:406fd2029f23 532 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 533 * @return Receives the DMA request configuration (enable: 1/disable: 0).
mbed_official 324:406fd2029f23 534 */
mbed_official 324:406fd2029f23 535 static inline bool LPUART_HAL_IsRxDmaEnabled(uint32_t baseAddr)
mbed_official 324:406fd2029f23 536 {
mbed_official 324:406fd2029f23 537 /* RDMAE configures the receive data register fell flag, S1[RDRF], to */
mbed_official 324:406fd2029f23 538 /* generate a DMA request. */
mbed_official 324:406fd2029f23 539 return BR_LPUART_BAUD_RDMAE(baseAddr);
mbed_official 324:406fd2029f23 540 }
mbed_official 324:406fd2029f23 541
mbed_official 324:406fd2029f23 542 #endif
mbed_official 324:406fd2029f23 543
mbed_official 324:406fd2029f23 544 /*@}*/
mbed_official 324:406fd2029f23 545
mbed_official 324:406fd2029f23 546 /*!
mbed_official 324:406fd2029f23 547 * @name LPUART Transfer Functions
mbed_official 324:406fd2029f23 548 * @{
mbed_official 324:406fd2029f23 549 */
mbed_official 324:406fd2029f23 550
mbed_official 324:406fd2029f23 551 /*!
mbed_official 324:406fd2029f23 552 * @brief Sends the LPUART 8-bit character.
mbed_official 324:406fd2029f23 553 *
mbed_official 324:406fd2029f23 554 * @param baseAddr LPUART Instance
mbed_official 324:406fd2029f23 555 * @param data data to send (8-bit)
mbed_official 324:406fd2029f23 556 */
mbed_official 324:406fd2029f23 557 static inline void LPUART_HAL_Putchar(uint32_t baseAddr, uint8_t data)
mbed_official 324:406fd2029f23 558 {
mbed_official 324:406fd2029f23 559 /* put 8-bit data into the lpuart data register */
mbed_official 324:406fd2029f23 560 HW_LPUART_DATA_WR(baseAddr, data);
mbed_official 324:406fd2029f23 561 }
mbed_official 324:406fd2029f23 562
mbed_official 324:406fd2029f23 563 /*!
mbed_official 324:406fd2029f23 564 * @brief Sends the LPUART 9-bit character.
mbed_official 324:406fd2029f23 565 *
mbed_official 324:406fd2029f23 566 * @param baseAddr LPUART Instance
mbed_official 324:406fd2029f23 567 * @param data data to send (9-bit)
mbed_official 324:406fd2029f23 568 */
mbed_official 324:406fd2029f23 569 void LPUART_HAL_Putchar9(uint32_t baseAddr, uint16_t data);
mbed_official 324:406fd2029f23 570
mbed_official 324:406fd2029f23 571 /*!
mbed_official 324:406fd2029f23 572 * @brief Sends the LPUART 10-bit character (Note: Feature available on select LPUART instances).
mbed_official 324:406fd2029f23 573 *
mbed_official 324:406fd2029f23 574 * @param baseAddr LPUART Instance
mbed_official 324:406fd2029f23 575 * @param data data to send (10-bit)
mbed_official 324:406fd2029f23 576 * @return An error code or kStatus_Success
mbed_official 324:406fd2029f23 577 */
mbed_official 324:406fd2029f23 578 lpuart_status_t LPUART_HAL_Putchar10(uint32_t baseAddr, uint16_t data);
mbed_official 324:406fd2029f23 579
mbed_official 324:406fd2029f23 580 /*!
mbed_official 324:406fd2029f23 581 * @brief Gets the LPUART 8-bit character.
mbed_official 324:406fd2029f23 582 *
mbed_official 324:406fd2029f23 583 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 584 * @param readData data read from receive (8-bit)
mbed_official 324:406fd2029f23 585 */
mbed_official 324:406fd2029f23 586 void LPUART_HAL_Getchar(uint32_t baseAddr, uint8_t *readData);
mbed_official 324:406fd2029f23 587
mbed_official 324:406fd2029f23 588 /*!
mbed_official 324:406fd2029f23 589 * @brief Gets the LPUART 9-bit character.
mbed_official 324:406fd2029f23 590 *
mbed_official 324:406fd2029f23 591 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 592 * @param readData data read from receive (9-bit)
mbed_official 324:406fd2029f23 593 */
mbed_official 324:406fd2029f23 594 void LPUART_HAL_Getchar9(uint32_t baseAddr, uint16_t *readData);
mbed_official 324:406fd2029f23 595
mbed_official 324:406fd2029f23 596 /*!
mbed_official 324:406fd2029f23 597 * @brief Gets the LPUART 10-bit character.
mbed_official 324:406fd2029f23 598 *
mbed_official 324:406fd2029f23 599 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 600 * @param readData data read from receive (10-bit)
mbed_official 324:406fd2029f23 601 * @return An error code or kStatus_Success
mbed_official 324:406fd2029f23 602 */
mbed_official 324:406fd2029f23 603 lpuart_status_t LPUART_HAL_Getchar10(uint32_t baseAddr, uint16_t *readData);
mbed_official 324:406fd2029f23 604
mbed_official 324:406fd2029f23 605 /*!
mbed_official 324:406fd2029f23 606 * @brief Configures the number of idle characters that must be received before the IDLE flag is set.
mbed_official 324:406fd2029f23 607 *
mbed_official 324:406fd2029f23 608 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 609 * @param idle_config idle characters configuration
mbed_official 324:406fd2029f23 610 */
mbed_official 324:406fd2029f23 611 static inline void LPUART_HAL_IdleConfig(uint32_t baseAddr, lpuart_idle_config_t idleConfig)
mbed_official 324:406fd2029f23 612 {
mbed_official 324:406fd2029f23 613 BW_LPUART_CTRL_IDLECFG(baseAddr, idleConfig);
mbed_official 324:406fd2029f23 614 }
mbed_official 324:406fd2029f23 615
mbed_official 324:406fd2029f23 616 /*!
mbed_official 324:406fd2029f23 617 * @brief Gets the configuration of the number of idle characters that must be received before the IDLE flag is set.
mbed_official 324:406fd2029f23 618 *
mbed_official 324:406fd2029f23 619 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 620 * @return idle characters configuration
mbed_official 324:406fd2029f23 621 */
mbed_official 324:406fd2029f23 622 static inline lpuart_idle_config_t LPUART_HAL_GetIdleconfig(uint32_t baseAddr)
mbed_official 324:406fd2029f23 623 {
mbed_official 324:406fd2029f23 624 /* get the receiver idle character config based on the LPUART baseAddr */
mbed_official 324:406fd2029f23 625 return (lpuart_idle_config_t)BR_LPUART_CTRL_IDLECFG(baseAddr);
mbed_official 324:406fd2029f23 626 }
mbed_official 324:406fd2029f23 627
mbed_official 324:406fd2029f23 628 #if FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS
mbed_official 324:406fd2029f23 629 /*!
mbed_official 324:406fd2029f23 630 * @brief Configures bit10 (if enabled) or bit9 (if disabled) as the parity bit in the serial
mbed_official 324:406fd2029f23 631 * transmission.
mbed_official 324:406fd2029f23 632 * This sets LPUARTx_C4[M10] - it is also required to set LPUARTx_C1[M] and LPUARTx_C1[PE]
mbed_official 324:406fd2029f23 633 *
mbed_official 324:406fd2029f23 634 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 635 * @param enable Enable (1) to configure bit10 as the parity bit, disable (0) to
mbed_official 324:406fd2029f23 636 * configure bit 9 as the parity bit in the serial transmission
mbed_official 324:406fd2029f23 637 */
mbed_official 324:406fd2029f23 638 static inline void LPUART_HAL_ConfigureBit10AsParityBitOperation(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 639 {
mbed_official 324:406fd2029f23 640 /* to enable the parity bit as the tenth data bit, along with enabling LPUARTx_C4[M10] */
mbed_official 324:406fd2029f23 641 /* need to also enable parity and set LPUARTx_CTRL[M] bit */
mbed_official 324:406fd2029f23 642 /* assumed that the user has already set the appropriate bits */
mbed_official 324:406fd2029f23 643 BW_LPUART_BAUD_M10(baseAddr, enable);
mbed_official 324:406fd2029f23 644 }
mbed_official 324:406fd2029f23 645
mbed_official 324:406fd2029f23 646 /*!
mbed_official 324:406fd2029f23 647 * @brief Gets the configuration of bit10 (if enabled) or bit9 (if disabled) as the
mbed_official 324:406fd2029f23 648 * parity bit in the serial transmission.
mbed_official 324:406fd2029f23 649 *
mbed_official 324:406fd2029f23 650 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 651 * @return Configuration of bit10 (enabled (1)), or bit 9 (disabled (0)) as the
mbed_official 324:406fd2029f23 652 * parity bit in the serial transmission
mbed_official 324:406fd2029f23 653 */
mbed_official 324:406fd2029f23 654 static inline bool LPUART_HAL_IsBit10SetAsParityBit(uint32_t baseAddr)
mbed_official 324:406fd2029f23 655 {
mbed_official 324:406fd2029f23 656 /* to see if the parity bit is set as the tenth data bit, */
mbed_official 324:406fd2029f23 657 /* return value of LPUARTx_BAUD[M10] */
mbed_official 324:406fd2029f23 658 return BR_LPUART_BAUD_M10(baseAddr);
mbed_official 324:406fd2029f23 659 }
mbed_official 324:406fd2029f23 660
mbed_official 324:406fd2029f23 661 /*!
mbed_official 324:406fd2029f23 662 * @brief Checks whether the current data word was received with noise.
mbed_official 324:406fd2029f23 663 *
mbed_official 324:406fd2029f23 664 * @param baseAddr LPUART base address.
mbed_official 324:406fd2029f23 665 * @return The status of the NOISY bit in the LPUART extended data register
mbed_official 324:406fd2029f23 666 */
mbed_official 324:406fd2029f23 667 static inline bool LPUART_HAL_IsCurrentDatawordReceivedWithNoise(uint32_t baseAddr)
mbed_official 324:406fd2029f23 668 {
mbed_official 324:406fd2029f23 669 /* to see if the current dataword was received with noise, */
mbed_official 324:406fd2029f23 670 /* return value of LPUARTx_DATA[NOISY] */
mbed_official 324:406fd2029f23 671 return BR_LPUART_DATA_NOISY(baseAddr);
mbed_official 324:406fd2029f23 672 }
mbed_official 324:406fd2029f23 673
mbed_official 324:406fd2029f23 674 /*!
mbed_official 324:406fd2029f23 675 * @brief Checks whether the receive buffer is empty.
mbed_official 324:406fd2029f23 676 *
mbed_official 324:406fd2029f23 677 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 678 * @return TRUE if the receive-buffer is empty.
mbed_official 324:406fd2029f23 679 */
mbed_official 324:406fd2029f23 680 static inline bool LPUART_HAL_IsReceiveBufferEmpty(uint32_t baseAddr)
mbed_official 324:406fd2029f23 681 {
mbed_official 324:406fd2029f23 682 /* to see if the current state of data buffer is empty, */
mbed_official 324:406fd2029f23 683 /* return value of LPUARTx_DATA[RXEMPT] */
mbed_official 324:406fd2029f23 684 return BR_LPUART_DATA_RXEMPT(baseAddr);
mbed_official 324:406fd2029f23 685 }
mbed_official 324:406fd2029f23 686
mbed_official 324:406fd2029f23 687 /*!
mbed_official 324:406fd2029f23 688 * @brief Checks whether the previous BUS state was idle before this byte is received.
mbed_official 324:406fd2029f23 689 *
mbed_official 324:406fd2029f23 690 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 691 * @return TRUE if the previous BUS state was IDLE.
mbed_official 324:406fd2029f23 692 */
mbed_official 324:406fd2029f23 693 static inline bool LPUART_HAL_ItWasPreviousBusStateIdle(uint32_t baseAddr)
mbed_official 324:406fd2029f23 694 {
mbed_official 324:406fd2029f23 695 /* to see if the current dataword was received with parity error, */
mbed_official 324:406fd2029f23 696 /* return value of LPUARTx_DATA[PARITYE] */
mbed_official 324:406fd2029f23 697 return BR_LPUART_DATA_IDLINE(baseAddr);
mbed_official 324:406fd2029f23 698 }
mbed_official 324:406fd2029f23 699
mbed_official 324:406fd2029f23 700 /*!
mbed_official 324:406fd2029f23 701 * @brief Checks whether the current data word was received with parity error.
mbed_official 324:406fd2029f23 702 *
mbed_official 324:406fd2029f23 703 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 704 * @return The status of the PARITYE bit in the LPUART extended data register
mbed_official 324:406fd2029f23 705 */
mbed_official 324:406fd2029f23 706 static inline bool LPUART_HAL_IsCurrentDatawordReceivedWithParityError(uint32_t baseAddr)
mbed_official 324:406fd2029f23 707 {
mbed_official 324:406fd2029f23 708 /* to see if the current dataword was received with parity error, */
mbed_official 324:406fd2029f23 709 /* return value of LPUARTx_DATA[PARITYE] */
mbed_official 324:406fd2029f23 710 return BR_LPUART_DATA_PARITYE(baseAddr);
mbed_official 324:406fd2029f23 711 }
mbed_official 324:406fd2029f23 712 #endif /* FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS */
mbed_official 324:406fd2029f23 713
mbed_official 324:406fd2029f23 714 /*@}*/
mbed_official 324:406fd2029f23 715
mbed_official 324:406fd2029f23 716 /*!
mbed_official 324:406fd2029f23 717 * @name LPUART Special Feature Configurations
mbed_official 324:406fd2029f23 718 * @{
mbed_official 324:406fd2029f23 719 */
mbed_official 324:406fd2029f23 720
mbed_official 324:406fd2029f23 721 /*!
mbed_official 324:406fd2029f23 722 * @brief Configures the LPUART operation in wait mode (operates or stops operations in wait mode).
mbed_official 324:406fd2029f23 723 * In some LPUART instances, the user should disable the transmitter/receiver
mbed_official 324:406fd2029f23 724 * before calling this function.
mbed_official 324:406fd2029f23 725 * Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 726 *
mbed_official 324:406fd2029f23 727 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 728 * @param mode LPUART wait mode operation - operates or stops to operate in wait mode.
mbed_official 324:406fd2029f23 729 */
mbed_official 324:406fd2029f23 730 static inline void LPUART_HAL_SetWaitModeOperation(uint32_t baseAddr, lpuart_operation_config_t mode)
mbed_official 324:406fd2029f23 731 {
mbed_official 324:406fd2029f23 732 /* configure lpuart operation in wait mode */
mbed_official 324:406fd2029f23 733 /* In CPU wait mode: 0 - lpuart clocks continue to run; 1 - lpuart clocks freeze */
mbed_official 324:406fd2029f23 734 BW_LPUART_CTRL_DOZEEN(baseAddr, mode);
mbed_official 324:406fd2029f23 735 }
mbed_official 324:406fd2029f23 736
mbed_official 324:406fd2029f23 737 /*!
mbed_official 324:406fd2029f23 738 * @brief Gets the LPUART operation in wait mode (operates or stops operations in wait mode).
mbed_official 324:406fd2029f23 739 *
mbed_official 324:406fd2029f23 740 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 741 * @return LPUART wait mode operation configuration - kLpuartOperates or KLpuartStops in wait mode
mbed_official 324:406fd2029f23 742 */
mbed_official 324:406fd2029f23 743 lpuart_operation_config_t LPUART_HAL_GetWaitModeOperationConfig(uint32_t baseAddr);
mbed_official 324:406fd2029f23 744
mbed_official 324:406fd2029f23 745 /*!
mbed_official 324:406fd2029f23 746 * @brief Configures the LPUART loopback operation (enable/disable loopback operation)
mbed_official 324:406fd2029f23 747 *
mbed_official 324:406fd2029f23 748 * In some LPUART instances, the user should disable the transmitter/receiver
mbed_official 324:406fd2029f23 749 * before calling this function.
mbed_official 324:406fd2029f23 750 * Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 751 *
mbed_official 324:406fd2029f23 752 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 753 * @param enable LPUART loopback mode - disabled (0) or enabled (1)
mbed_official 324:406fd2029f23 754 */
mbed_official 324:406fd2029f23 755 void LPUART_HAL_SedLoopbackCmd(uint32_t baseAddr, bool enable);
mbed_official 324:406fd2029f23 756
mbed_official 324:406fd2029f23 757 /*!
mbed_official 324:406fd2029f23 758 * @brief Configures the LPUART single-wire operation (enable/disable single-wire mode)
mbed_official 324:406fd2029f23 759 *
mbed_official 324:406fd2029f23 760 * In some LPUART instances, the user should disable the transmitter/receiver
mbed_official 324:406fd2029f23 761 * before calling this function.
mbed_official 324:406fd2029f23 762 * Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 763 *
mbed_official 324:406fd2029f23 764 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 765 * @param enable LPUART loopback mode - disabled (0) or enabled (1)
mbed_official 324:406fd2029f23 766 */
mbed_official 324:406fd2029f23 767 void LPUART_HAL_SetSingleWireCmd(uint32_t baseAddr, bool enable);
mbed_official 324:406fd2029f23 768
mbed_official 324:406fd2029f23 769 /*!
mbed_official 324:406fd2029f23 770 * @brief Configures the LPUART transmit direction while in single-wire mode.
mbed_official 324:406fd2029f23 771 *
mbed_official 324:406fd2029f23 772 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 773 * @param direction LPUART single-wire transmit direction - input or output
mbed_official 324:406fd2029f23 774 */
mbed_official 324:406fd2029f23 775 static inline void LPUART_HAL_ConfigureTxdirInSinglewireMode(uint32_t baseAddr,
mbed_official 324:406fd2029f23 776 lpuart_singlewire_txdir_t direction)
mbed_official 324:406fd2029f23 777 {
mbed_official 324:406fd2029f23 778 /* configure LPUART transmit direction (input or output) when in single-wire mode */
mbed_official 324:406fd2029f23 779 /* it is assumed LPUART is in single-wire mode */
mbed_official 324:406fd2029f23 780 BW_LPUART_CTRL_TXDIR(baseAddr, direction);
mbed_official 324:406fd2029f23 781 }
mbed_official 324:406fd2029f23 782
mbed_official 324:406fd2029f23 783 /*!
mbed_official 324:406fd2029f23 784 * @brief Places the LPUART receiver in standby mode.
mbed_official 324:406fd2029f23 785 *
mbed_official 324:406fd2029f23 786 * In some LPUART instances,
mbed_official 324:406fd2029f23 787 * before placing LPUART in standby mode, first determine whether the receiver is set to
mbed_official 324:406fd2029f23 788 * wake on idle or whether it is already in idle state.
mbed_official 324:406fd2029f23 789 * NOTE that the RWU should only be set with C1[WAKE] = 0 (wakeup on idle) if the channel is currently
mbed_official 324:406fd2029f23 790 * not idle.
mbed_official 324:406fd2029f23 791 * This can be determined by the S2[RAF] flag. If it is set to wake up an IDLE event and the channel is
mbed_official 324:406fd2029f23 792 * already idle, it is possible that the LPUART will discard data since data must be received
mbed_official 324:406fd2029f23 793 * (or a LIN break detect) after an IDLE is detected and before IDLE is allowed to reasserted.
mbed_official 324:406fd2029f23 794 *
mbed_official 324:406fd2029f23 795 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 796 * @return Error code or kStatus_Success
mbed_official 324:406fd2029f23 797 */
mbed_official 324:406fd2029f23 798 lpuart_status_t LPUART_HAL_PutReceiverInStandbyMode(uint32_t baseAddr);
mbed_official 324:406fd2029f23 799
mbed_official 324:406fd2029f23 800 /*!
mbed_official 324:406fd2029f23 801 * @brief Places the LPUART receiver in a normal mode (disable standby mode operation).
mbed_official 324:406fd2029f23 802 *
mbed_official 324:406fd2029f23 803 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 804 */
mbed_official 324:406fd2029f23 805 static inline void LPUART_HAL_PutReceiverInNormalMode(uint32_t baseAddr)
mbed_official 324:406fd2029f23 806 {
mbed_official 324:406fd2029f23 807 /* clear the RWU bit to place receiver into normal mode (disable standby mode) */
mbed_official 324:406fd2029f23 808 BW_LPUART_CTRL_RWU(baseAddr, 0);
mbed_official 324:406fd2029f23 809 }
mbed_official 324:406fd2029f23 810
mbed_official 324:406fd2029f23 811 /*!
mbed_official 324:406fd2029f23 812 * @brief Checks whether the LPUART receiver is in a standby mode.
mbed_official 324:406fd2029f23 813 *
mbed_official 324:406fd2029f23 814 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 815 * @return LPUART in normal more (0) or standby (1)
mbed_official 324:406fd2029f23 816 */
mbed_official 324:406fd2029f23 817 static inline bool LPUART_HAL_IsReceiverInStandby(uint32_t baseAddr)
mbed_official 324:406fd2029f23 818 {
mbed_official 324:406fd2029f23 819 /* return the RWU bit setting (0 - normal more, 1 - standby) */
mbed_official 324:406fd2029f23 820 return BR_LPUART_CTRL_RWU(baseAddr);
mbed_official 324:406fd2029f23 821 }
mbed_official 324:406fd2029f23 822
mbed_official 324:406fd2029f23 823 /*!
mbed_official 324:406fd2029f23 824 * @brief LPUART receiver wakeup method (idle line or addr-mark) from standby mode
mbed_official 324:406fd2029f23 825 *
mbed_official 324:406fd2029f23 826 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 827 * @param method LPUART wakeup method: 0 - Idle-line wake (default), 1 - addr-mark wake
mbed_official 324:406fd2029f23 828 */
mbed_official 324:406fd2029f23 829 static inline void LPUART_HAL_SelectReceiverWakeupMethod(uint32_t baseAddr, lpuart_wakeup_method_t method)
mbed_official 324:406fd2029f23 830 {
mbed_official 324:406fd2029f23 831 /* configure the WAKE bit for idle line wake or address mark wake */
mbed_official 324:406fd2029f23 832 BW_LPUART_CTRL_WAKE(baseAddr, method);
mbed_official 324:406fd2029f23 833 }
mbed_official 324:406fd2029f23 834
mbed_official 324:406fd2029f23 835 /*!
mbed_official 324:406fd2029f23 836 * @brief Gets the LPUART receiver wakeup method (idle line or addr-mark) from standby mode.
mbed_official 324:406fd2029f23 837 *
mbed_official 324:406fd2029f23 838 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 839 * @return LPUART wakeup method: kLpuartIdleLineWake: 0 - Idle-line wake (default),
mbed_official 324:406fd2029f23 840 * kLpuartAddrMarkWake: 1 - addr-mark wake
mbed_official 324:406fd2029f23 841 */
mbed_official 324:406fd2029f23 842 lpuart_wakeup_method_t LPUART_HAL_GetReceiverWakeupMethod(uint32_t baseAddr);
mbed_official 324:406fd2029f23 843
mbed_official 324:406fd2029f23 844 /*!
mbed_official 324:406fd2029f23 845 * @brief LPUART idle-line detect operation configuration (idle line bit-count start and wake
mbed_official 324:406fd2029f23 846 * up affect on IDLE status bit).
mbed_official 324:406fd2029f23 847 *
mbed_official 324:406fd2029f23 848 * In some LPUART instances, the user should disable the transmitter/receiver
mbed_official 324:406fd2029f23 849 * before calling this function.
mbed_official 324:406fd2029f23 850 * Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 851 *
mbed_official 324:406fd2029f23 852 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 853 * @param config LPUART configuration data for idle line detect operation
mbed_official 324:406fd2029f23 854 */
mbed_official 324:406fd2029f23 855 void LPUART_HAL_ConfigureIdleLineDetect(uint32_t baseAddr,
mbed_official 324:406fd2029f23 856 const lpuart_idle_line_config_t *config);
mbed_official 324:406fd2029f23 857
mbed_official 324:406fd2029f23 858 /*!
mbed_official 324:406fd2029f23 859 * @brief LPUART break character transmit length configuration
mbed_official 324:406fd2029f23 860 * In some LPUART instances, the user should disable the transmitter before calling
mbed_official 324:406fd2029f23 861 * this function. Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 862 *
mbed_official 324:406fd2029f23 863 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 864 * @param length LPUART break character length setting: 0 - minimum 10-bit times (default),
mbed_official 324:406fd2029f23 865 * 1 - minimum 13-bit times
mbed_official 324:406fd2029f23 866 */
mbed_official 324:406fd2029f23 867 static inline void LPUART_HAL_SetBreakCharTransmitLength(uint32_t baseAddr,
mbed_official 324:406fd2029f23 868 lpuart_break_char_length_t length)
mbed_official 324:406fd2029f23 869 {
mbed_official 324:406fd2029f23 870 /* Configure BRK13 - Break Character transmit length configuration */
mbed_official 324:406fd2029f23 871 /* LPUART break character length setting: */
mbed_official 324:406fd2029f23 872 /* 0 - minimum 10-bit times (default), */
mbed_official 324:406fd2029f23 873 /* 1 - minimum 13-bit times */
mbed_official 324:406fd2029f23 874 BW_LPUART_STAT_BRK13(baseAddr, length);
mbed_official 324:406fd2029f23 875 }
mbed_official 324:406fd2029f23 876
mbed_official 324:406fd2029f23 877 /*!
mbed_official 324:406fd2029f23 878 * @brief LPUART break character detect length configuration
mbed_official 324:406fd2029f23 879 *
mbed_official 324:406fd2029f23 880 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 881 * @param length LPUART break character length setting: 0 - minimum 10-bit times (default),
mbed_official 324:406fd2029f23 882 * 1 - minimum 13-bit times
mbed_official 324:406fd2029f23 883 */
mbed_official 324:406fd2029f23 884 static inline void LPUART_HAL_SetBreakCharDetectLength(uint32_t baseAddr,
mbed_official 324:406fd2029f23 885 lpuart_break_char_length_t length)
mbed_official 324:406fd2029f23 886 {
mbed_official 324:406fd2029f23 887 /* Configure LBKDE - Break Character detect length configuration */
mbed_official 324:406fd2029f23 888 /* LPUART break character length setting: */
mbed_official 324:406fd2029f23 889 /* 0 - minimum 10-bit times (default), */
mbed_official 324:406fd2029f23 890 /* 1 - minimum 13-bit times */
mbed_official 324:406fd2029f23 891 BW_LPUART_STAT_LBKDE(baseAddr, length);
mbed_official 324:406fd2029f23 892 }
mbed_official 324:406fd2029f23 893
mbed_official 324:406fd2029f23 894 /*!
mbed_official 324:406fd2029f23 895 * @brief LPUART transmit sends break character configuration.
mbed_official 324:406fd2029f23 896 *
mbed_official 324:406fd2029f23 897 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 898 * @param enable LPUART normal/queue break char - disabled (normal mode, default: 0) or
mbed_official 324:406fd2029f23 899 * enabled (queue break char: 1)
mbed_official 324:406fd2029f23 900 */
mbed_official 324:406fd2029f23 901 static inline void LPUART_HAL_QueueBreakCharToSend(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 902 {
mbed_official 324:406fd2029f23 903 /* Configure SBK - Send Break */
mbed_official 324:406fd2029f23 904 /* LPUART send break character setting: */
mbed_official 324:406fd2029f23 905 /* 0 - normal transmitter operation, */
mbed_official 324:406fd2029f23 906 /* 1 - Queue break character(s) to be sent */
mbed_official 324:406fd2029f23 907
mbed_official 324:406fd2029f23 908 BW_LPUART_CTRL_SBK(baseAddr, enable);
mbed_official 324:406fd2029f23 909 }
mbed_official 324:406fd2029f23 910
mbed_official 324:406fd2029f23 911 /*!
mbed_official 324:406fd2029f23 912 * @brief LPUART configures match address mode control (Note: Feature available on
mbed_official 324:406fd2029f23 913 * select LPUART instances)
mbed_official 324:406fd2029f23 914 *
mbed_official 324:406fd2029f23 915 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 916 * @param matchAddrMode1 MAEN1: match address mode1 enable (1)/disable (0)
mbed_official 324:406fd2029f23 917 * @param matchAddrMode2 MAEN2: match address mode2 enable (1)/disable (0)
mbed_official 324:406fd2029f23 918 * @param matchAddrValue1 MA: match address value to program into match address register 1
mbed_official 324:406fd2029f23 919 * @param matchAddrValue2 MA: match address value to program into match address register 2
mbed_official 324:406fd2029f23 920 * @param config MATCFG: Configures the match addressing mode used.
mbed_official 324:406fd2029f23 921 * @return An error code or kStatus_Success
mbed_official 324:406fd2029f23 922 */
mbed_official 324:406fd2029f23 923 lpuart_status_t LPUART_HAL_SetMatchAddressOperation(uint32_t baseAddr,
mbed_official 324:406fd2029f23 924 bool matchAddrMode1, bool matchAddrMode2,
mbed_official 324:406fd2029f23 925 uint8_t matchAddrValue1, uint8_t matchAddrValue2,
mbed_official 324:406fd2029f23 926 lpuart_match_config_t config);
mbed_official 324:406fd2029f23 927
mbed_official 324:406fd2029f23 928 /*!
mbed_official 324:406fd2029f23 929 * @brief LPUART sends the MSB first configuration (Note: Feature available on select LPUART instances)
mbed_official 324:406fd2029f23 930 * In some LPUART instances, the user should disable the transmitter/receiver
mbed_official 324:406fd2029f23 931 * before calling this function.
mbed_official 324:406fd2029f23 932 * Generally, this may be applied to all LPUARTs to ensure safe operation.
mbed_official 324:406fd2029f23 933 *
mbed_official 324:406fd2029f23 934 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 935 * @param enable MSB first mode configuration, MSBF: 0 - LSB (default, feature disabled),
mbed_official 324:406fd2029f23 936 * 1 - MSB (feature enabled)
mbed_official 324:406fd2029f23 937 */
mbed_official 324:406fd2029f23 938 static inline void LPUART_HAL_ConfigureSendMsbFirstOperation(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 939 {
mbed_official 324:406fd2029f23 940 BW_LPUART_STAT_MSBF(baseAddr, enable);
mbed_official 324:406fd2029f23 941 }
mbed_official 324:406fd2029f23 942
mbed_official 324:406fd2029f23 943 /*!
mbed_official 324:406fd2029f23 944 * @brief LPUART disables re-sync of received data configuration (Note: Feature available on
mbed_official 324:406fd2029f23 945 * select LPUART instances).
mbed_official 324:406fd2029f23 946 *
mbed_official 324:406fd2029f23 947 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 948 * @param enable disable re-sync of received data word configuration, RESYNCDIS:
mbed_official 324:406fd2029f23 949 * 0 - re-sync of received data word (default, feature disabled),
mbed_official 324:406fd2029f23 950 * 1 - disable the re-sync (feature enabled)
mbed_official 324:406fd2029f23 951 */
mbed_official 324:406fd2029f23 952 static inline void LPUART_HAL_ConfigureReceiveResyncDisableOperation(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 953 {
mbed_official 324:406fd2029f23 954 /* When set, disables the resynchronization of the received data word when a data */
mbed_official 324:406fd2029f23 955 /* one followed by data zero transition is detected. This bit should only be changed */
mbed_official 324:406fd2029f23 956 /* when the receiver is disabled. */
mbed_official 324:406fd2029f23 957 BW_LPUART_BAUD_RESYNCDIS(baseAddr, enable);
mbed_official 324:406fd2029f23 958 }
mbed_official 324:406fd2029f23 959
mbed_official 324:406fd2029f23 960 #if FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT
mbed_official 324:406fd2029f23 961 /*!
mbed_official 324:406fd2029f23 962 * @brief Transmits the CTS source configuration.
mbed_official 324:406fd2029f23 963 *
mbed_official 324:406fd2029f23 964 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 965 * @param source LPUART CTS source
mbed_official 324:406fd2029f23 966 */
mbed_official 324:406fd2029f23 967 static inline void LPUART_HAL_SelectSourceCts(uint32_t baseAddr, lpuart_cts_source_t source)
mbed_official 324:406fd2029f23 968 {
mbed_official 324:406fd2029f23 969 /* Set TXCTSSRC */
mbed_official 324:406fd2029f23 970 BW_LPUART_MODIR_TXCTSSRC(baseAddr, source);
mbed_official 324:406fd2029f23 971 }
mbed_official 324:406fd2029f23 972
mbed_official 324:406fd2029f23 973 /*!
mbed_official 324:406fd2029f23 974 * @brief Transmits the CTS configuration.
mbed_official 324:406fd2029f23 975 * Note: configures if the CTS state is checked at the start of each character or only when the transmitter is idle.
mbed_official 324:406fd2029f23 976 *
mbed_official 324:406fd2029f23 977 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 978 * @param config LPUART CTS configuration
mbed_official 324:406fd2029f23 979 */
mbed_official 324:406fd2029f23 980 static inline void LPUART_HAL_ConfigureCts(uint32_t baseAddr, lpuart_cts_config_t config)
mbed_official 324:406fd2029f23 981 {
mbed_official 324:406fd2029f23 982 /* Set TXCTSC */
mbed_official 324:406fd2029f23 983 BW_LPUART_MODIR_TXCTSC(baseAddr, config);
mbed_official 324:406fd2029f23 984 }
mbed_official 324:406fd2029f23 985
mbed_official 324:406fd2029f23 986 /*!
mbed_official 324:406fd2029f23 987 * @brief Enables the receiver request-to-send.
mbed_official 324:406fd2029f23 988 * Note: do not enable both Receiver RTS (RXRTSE) and Transmit RTS (TXRTSE).
mbed_official 324:406fd2029f23 989 *
mbed_official 324:406fd2029f23 990 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 991 * @param enable disable(0)/enable(1) receiver RTS.
mbed_official 324:406fd2029f23 992 */
mbed_official 324:406fd2029f23 993
mbed_official 324:406fd2029f23 994 static inline void LPUART_HAL_SetReceiverRts(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 995 {
mbed_official 324:406fd2029f23 996 BW_LPUART_MODIR_RXRTSE(baseAddr, enable);
mbed_official 324:406fd2029f23 997 }
mbed_official 324:406fd2029f23 998
mbed_official 324:406fd2029f23 999 /*!
mbed_official 324:406fd2029f23 1000 * @brief Enables the transmitter request-to-send.
mbed_official 324:406fd2029f23 1001 * Note: do not enable both Receiver RTS (RXRTSE) and Transmit RTS (TXRTSE).
mbed_official 324:406fd2029f23 1002 *
mbed_official 324:406fd2029f23 1003 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 1004 * @param enable disable(0)/enable(1) transmitter RTS.
mbed_official 324:406fd2029f23 1005 */
mbed_official 324:406fd2029f23 1006 static inline void LPUART_HAL_SetTransmitterRtsCmd(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 1007 {
mbed_official 324:406fd2029f23 1008 BW_LPUART_MODIR_TXRTSE(baseAddr, enable);
mbed_official 324:406fd2029f23 1009 }
mbed_official 324:406fd2029f23 1010
mbed_official 324:406fd2029f23 1011 /*!
mbed_official 324:406fd2029f23 1012 * @brief Configures the transmitter RTS polarity: 0=active low, 1=active high.
mbed_official 324:406fd2029f23 1013 *
mbed_official 324:406fd2029f23 1014 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 1015 * @param polarity Settings to choose RTS polarity.
mbed_official 324:406fd2029f23 1016 */
mbed_official 324:406fd2029f23 1017 static inline void LPUART_HAL_SetTransmitterRtsPolarityMode(uint32_t baseAddr, bool polarity)
mbed_official 324:406fd2029f23 1018 {
mbed_official 324:406fd2029f23 1019 /* Configure the transmitter rts polarity: 0=active low, 1=active high */
mbed_official 324:406fd2029f23 1020 BW_LPUART_MODIR_TXRTSPOL(baseAddr, polarity);
mbed_official 324:406fd2029f23 1021 }
mbed_official 324:406fd2029f23 1022
mbed_official 324:406fd2029f23 1023 /*!
mbed_official 324:406fd2029f23 1024 * @brief Enables the transmitter clear-to-send.
mbed_official 324:406fd2029f23 1025 *
mbed_official 324:406fd2029f23 1026 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 1027 * @param enable disable(0)/enable(1) transmitter CTS.
mbed_official 324:406fd2029f23 1028 */
mbed_official 324:406fd2029f23 1029 static inline void LPUART_HAL_SetTransmitterCtsCmd(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 1030 {
mbed_official 324:406fd2029f23 1031 BW_LPUART_MODIR_TXCTSE(baseAddr, enable);
mbed_official 324:406fd2029f23 1032 }
mbed_official 324:406fd2029f23 1033
mbed_official 324:406fd2029f23 1034 #endif /* FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT */
mbed_official 324:406fd2029f23 1035
mbed_official 324:406fd2029f23 1036 #if FSL_FEATURE_LPUART_HAS_IR_SUPPORT
mbed_official 324:406fd2029f23 1037 /*!
mbed_official 324:406fd2029f23 1038 * @brief Configures the LPUART infrared operation.
mbed_official 324:406fd2029f23 1039 *
mbed_official 324:406fd2029f23 1040 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 1041 * @param enable Enable (1) or disable (0) the infrared operation
mbed_official 324:406fd2029f23 1042 * @param pulseWidth The transmit narrow pulse width of type lpuart_ir_tx_pulsewidth_t
mbed_official 324:406fd2029f23 1043 */
mbed_official 324:406fd2029f23 1044 void LPUART_HAL_SetInfraredOperation(uint32_t baseAddr, bool enable,
mbed_official 324:406fd2029f23 1045 lpuart_ir_tx_pulsewidth_t pulseWidth);
mbed_official 324:406fd2029f23 1046 #endif /* FSL_FEATURE_LPUART_HAS_IR_SUPPORT */
mbed_official 324:406fd2029f23 1047
mbed_official 324:406fd2029f23 1048 /*@}*/
mbed_official 324:406fd2029f23 1049
mbed_official 324:406fd2029f23 1050 /*!
mbed_official 324:406fd2029f23 1051 * @name LPUART Status Flags
mbed_official 324:406fd2029f23 1052 * @{
mbed_official 324:406fd2029f23 1053 */
mbed_official 324:406fd2029f23 1054
mbed_official 324:406fd2029f23 1055 /*!
mbed_official 324:406fd2029f23 1056 * @brief LPUART get status flag
mbed_official 324:406fd2029f23 1057 *
mbed_official 324:406fd2029f23 1058 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 1059 * @param statusFlag The status flag to query
mbed_official 324:406fd2029f23 1060 */
mbed_official 324:406fd2029f23 1061 bool LPUART_HAL_GetStatusFlag(uint32_t baseAddr, lpuart_status_flag_t statusFlag);
mbed_official 324:406fd2029f23 1062
mbed_official 324:406fd2029f23 1063 /*!
mbed_official 324:406fd2029f23 1064 * @brief Gets the LPUART Transmit data register empty flag.
mbed_official 324:406fd2029f23 1065 *
mbed_official 324:406fd2029f23 1066 * This function returns the state of the LPUART Transmit data register empty flag.
mbed_official 324:406fd2029f23 1067 *
mbed_official 324:406fd2029f23 1068 * @param baseAddr LPUART module base address.
mbed_official 324:406fd2029f23 1069 * @return The status of Transmit data register empty flag, which is set when transmit buffer
mbed_official 324:406fd2029f23 1070 * is empty.
mbed_official 324:406fd2029f23 1071 */
mbed_official 324:406fd2029f23 1072 static inline bool LPUART_HAL_IsTxDataRegEmpty(uint32_t baseAddr)
mbed_official 324:406fd2029f23 1073 {
mbed_official 324:406fd2029f23 1074 /* return status condition of TDRE flag */
mbed_official 324:406fd2029f23 1075 return BR_LPUART_STAT_TDRE(baseAddr);
mbed_official 324:406fd2029f23 1076 }
mbed_official 324:406fd2029f23 1077
mbed_official 324:406fd2029f23 1078 /*!
mbed_official 324:406fd2029f23 1079 * @brief Gets the LPUART receive data register full flag.
mbed_official 324:406fd2029f23 1080 *
mbed_official 324:406fd2029f23 1081 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 1082 * @return Status of the receive data register full flag, sets when the receive data buffer is full.
mbed_official 324:406fd2029f23 1083 */
mbed_official 324:406fd2029f23 1084 static inline bool LPUART_HAL_IsRxDataRegFull(uint32_t baseAddr)
mbed_official 324:406fd2029f23 1085 {
mbed_official 324:406fd2029f23 1086 /* return status condition of RDRF flag */
mbed_official 324:406fd2029f23 1087 return BR_LPUART_STAT_RDRF(baseAddr);
mbed_official 324:406fd2029f23 1088 }
mbed_official 324:406fd2029f23 1089
mbed_official 324:406fd2029f23 1090 /*!
mbed_official 324:406fd2029f23 1091 * @brief Gets the LPUART transmission complete flag.
mbed_official 324:406fd2029f23 1092 *
mbed_official 324:406fd2029f23 1093 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 1094 * @return Status of Transmission complete flag, sets when transmitter is idle
mbed_official 324:406fd2029f23 1095 * (transmission activity complete)
mbed_official 324:406fd2029f23 1096 */
mbed_official 324:406fd2029f23 1097 static inline bool LPUART_HAL_IsTxComplete(uint32_t baseAddr)
mbed_official 324:406fd2029f23 1098 {
mbed_official 324:406fd2029f23 1099 /* return status condition of TC flag */
mbed_official 324:406fd2029f23 1100 return BR_LPUART_STAT_TC(baseAddr);
mbed_official 324:406fd2029f23 1101 }
mbed_official 324:406fd2029f23 1102
mbed_official 324:406fd2029f23 1103 /*!
mbed_official 324:406fd2029f23 1104 * @brief LPUART clears an individual status flag (see lpuart_status_flag_t for list of status bits).
mbed_official 324:406fd2029f23 1105 *
mbed_official 324:406fd2029f23 1106 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 1107 * @param statusFlag Desired LPUART status flag to clear
mbed_official 324:406fd2029f23 1108 * @return An error code or kStatus_Success
mbed_official 324:406fd2029f23 1109 */
mbed_official 324:406fd2029f23 1110 lpuart_status_t LPUART_HAL_ClearStatusFlag(uint32_t baseAddr, lpuart_status_flag_t statusFlag);
mbed_official 324:406fd2029f23 1111
mbed_official 324:406fd2029f23 1112 /*!
mbed_official 324:406fd2029f23 1113 * @brief LPUART clears ALL status flags.
mbed_official 324:406fd2029f23 1114 *
mbed_official 324:406fd2029f23 1115 * @param baseAddr LPUART base address
mbed_official 324:406fd2029f23 1116 */
mbed_official 324:406fd2029f23 1117 void LPUART_HAL_ClearAllNonAutoclearStatusFlags(uint32_t baseAddr);
mbed_official 324:406fd2029f23 1118
mbed_official 324:406fd2029f23 1119 /*@}*/
mbed_official 324:406fd2029f23 1120
mbed_official 324:406fd2029f23 1121 #if defined(__cplusplus)
mbed_official 324:406fd2029f23 1122 }
mbed_official 324:406fd2029f23 1123 #endif
mbed_official 324:406fd2029f23 1124
mbed_official 324:406fd2029f23 1125 /*! @}*/
mbed_official 324:406fd2029f23 1126
mbed_official 324:406fd2029f23 1127 #endif /* MBED_NO_LPUART */
mbed_official 324:406fd2029f23 1128
mbed_official 324:406fd2029f23 1129 #endif /* __FSL_LPUART_HAL_H__ */
mbed_official 324:406fd2029f23 1130
mbed_official 324:406fd2029f23 1131 /*******************************************************************************
mbed_official 324:406fd2029f23 1132 * EOF
mbed_official 324:406fd2029f23 1133 ******************************************************************************/
mbed_official 324:406fd2029f23 1134