MKM34Z256VLx7 Bare Metal Software Drivers  R4.1.6
Reference Manual
LPUART API Specification

Overview

This section describes functions and macros of the driver's API.

Macros

#define LPUART_TxIsrDisable(module)
 Disables transmitter interrupt or DMA transfer. More...
 
#define LPUART_TxIsrEnable(module)
 Enables transmitter interrupt or DMA transfer. More...
 
#define LPUART_TxCmplIsrDisable(module)
 Disables transmission complete interrupt. More...
 
#define LPUART_TxCmplIsrEnable(module)
 Enables transmission complete interrupt. More...
 
#define LPUART_RxIsrDisable(module)
 Disables receiver interrupt. More...
 
#define LPUART_RxIsrEnable(module)
 Enables receiver full interrupt or DMA transfer. More...
 
#define LPUART_EdgIsrEnable(module)
 Enables RxD input active edge interrupt. More...
 
#define LPUART_EdgIsrClr(module)
 Clears RxD input active edge interrupt flag. More...
 
#define LPUART_EdgIsrClrEnable(module)
 Clears RxD input active edge interrupt flag and enables RxD input active edge interrupt. More...
 
#define LPUART_EdgIsrDisable(module)
 Disables RxD input active edge interrupt. More...
 
#define LPUART_ParityDisable(module)
 Disables hardware parity on LPUART. More...
 
#define LPUART_ParityEnable(module)
 Enables hardware parity on LPUART. More...
 
#define LPUART_SetOddParity(module)
 Enables odd parity. More...
 
#define LPUART_SetEvenParity(module)
 Enables even parity. More...
 
#define LPUART_Set9BitMode(module)
 Enables 9-bit mode. More...
 
#define LPUART_Set8BitMode(module)
 Enables 8-bit mode. More...
 
#define LPUART_RxDisable(module)
 Disables receiver. More...
 
#define LPUART_RxEnable(module)
 Enables receiver. More...
 
#define LPUART_TxDisable(module)
 Disables transmitter. More...
 
#define LPUART_TxEnable(module)
 Enables transmitter. More...
 
#define LPUART_MSBFirstDisable(module)
 Disables MSB bit first. More...
 
#define LPUART_MSBFirstEnable(module)
 Enables MSB bit first. More...
 
#define LPUART_RxInvDisable(module)
 Disables receive data inversion. More...
 
#define LPUART_RxInvEnable(module)
 Enables receive data inversion. More...
 
#define LPUART_RxWakeupIdleDisable(module)
 Disables receive wake up idle detect. More...
 
#define LPUART_RxWakeupIdleEnable(module)
 Enables receive wake up idle detect. More...
 
#define LPUART_LongBreakCharEnable(module)
 Enables long Break character generation. More...
 
#define LPUART_LongBreakCharDisable(module)
 Disables long Break character generation. More...
 
#define LPUART_LINBreakDisable(module)
 Disables LIN Break Detection. More...
 
#define LPUART_LINBreakEnable(module)
 Enables LIN Break Detection. More...
 
#define LPUART_TxIdle(module)
 Reads and returns transmitter state. More...
 
#define LPUART_RxFull(module)
 Reads and returns receiver state. More...
 
#define LPUART_TxComplete(module)
 Returns transfer complete state. More...
 
#define LPUART_ClrFlags(module, mask)
 Clears LPUART flags. More...
 
#define LPUART_GetChar(module)
 Reads and returns received character. More...
 
#define LPUART_PutChar(module, c)
 Sends character. More...
 
#define LPUART_GetData(module)
 Reads and returns 10-bits data. More...
 
#define LPUART_PutData(module, c)
 Sends data. More...
 
#define LPUART_PutStr(module, str)
 Sends string. More...
 
#define LPUART_Rd(module, buffer, count)
 Reads count bytes and stores them in a buffer. More...
 
#define LPUART_Wr(module, buffer, count)
 Writes count bytes from buffer. More...
 
#define LPUART_LoopModeCtrl(module, ctrl)
 Enables/disables internal loop mode. More...
 
#define LPUART_SingleWireEnable(module, dir)
 Enables single-wire mode. More...
 
#define LPUART_SingleWireDisable(module)
 Disables single-wire mode. More...
 
#define LPUART_MatchAddrDisable(module)
 Disables match address mode. More...
 
#define LPUART_MatchAddrConfig(module, ma, addr1, addr2)
 Enables match address mode. More...
 
#define LPUART_InstallCallback(ip, callback)
 Installs callback function for LPUART interrupt vector 43. More...
 
#define LPUART_Init(module, cfg)
 LPUART initialization. More...
 

Macro Definition Documentation

#define LPUART_TxIsrDisable (   module)

This macro disables transmitter interrupt or DMA transfer for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_TxIsrEnable, LPUART_TxCmplIsrDisable, LPUART_TxCmplIsrEnable
#define LPUART_TxIsrEnable (   module)

This macro enables transmitter interrupt or DMA transfer for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_TxIsrDisable, LPUART_TxCmplIsrDisable, LPUART_TxCmplIsrEnable
#define LPUART_TxCmplIsrDisable (   module)

This macro disables transmission complete interrupt request for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_TxIsrEnable, LPUART_TxCmplIsrDisable, LPUART_TxCmplIsrEnable
#define LPUART_TxCmplIsrEnable (   module)

This macro enables transmission complete interrupt request for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_TxCmplIsrDisable, LPUART_TxIsrDisable, LPUART_TxIsrEnable
#define LPUART_RxIsrDisable (   module)

This macro disables transmitter interrupt or DMA transfer for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_RxIsrEnable
#define LPUART_RxIsrEnable (   module)

This macro enables receiver full interrupt or DMA transfer for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_RxIsrDisable
#define LPUART_EdgIsrEnable (   module)

This macro enables RxD input active edge interrupt for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_EdgIsrDisable, LPUART_EdgIsrClr, LPUART_EdgIsrClrEnable
#define LPUART_EdgIsrClr (   module)

This macro clears RxD input active edge interrupt flag for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_EdgIsrDisable, LPUART_EdgIsrEnable, LPUART_EdgIsrClrEnable
#define LPUART_EdgIsrClrEnable (   module)

This macro clears RxD input active edge interrupt flag and it also enables RxD input active edge interrupt for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_EdgIsrDisable, LPUART_EdgIsrEnable, LPUART_EdgIsrClr
#define LPUART_EdgIsrDisable (   module)

This macro disables RxD input active edge interrupt for specified module.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_EdgIsrEnable, LPUART_EdgIsrClrEnable
#define LPUART_ParityDisable (   module)

This macro disables hardware parity generation and checking.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_SetEvenParity, LPUART_SetOddParity, LPUART_ParityEnable
#define LPUART_ParityEnable (   module)

This macro enables hardware parity generation and checking.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_ParityDisable, LPUART_SetOddParity LPUART_SetEvenParity
#define LPUART_SetOddParity (   module)

This macro selects odd parity when the HW parity is enabled.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_ParityDisable, LPUART_ParityEnable LPUART_SetEvenParity
#define LPUART_SetEvenParity (   module)

This macro selects even parity when the HW parity is enabled

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_ParityDisable, LPUART_ParityEnable LPUART_SetOddParity
#define LPUART_Set9BitMode (   module)

This macro enables receiver and transmitter to use 9-bit data characters.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_Set8BitMode
#define LPUART_Set8BitMode (   module)

This macro enables receiver and transmitter to use 8-bit data characters.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_Set9BitMode
#define LPUART_RxDisable (   module)

This macro disables the LPUART receiver.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_RxEnable, LPUART_TxEnable LPUART_TxDisable
#define LPUART_RxEnable (   module)

This macro enables the LPUART receiver.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_RxDisable, LPUART_TxEnable LPUART_TxDisable
#define LPUART_TxDisable (   module)

This macro disables the LPUART transmitter.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_TxEnable, LPUART_RxDisable LPUART_RxEnable
#define LPUART_TxEnable (   module)

This macro enables the LPUART transmitter.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_TxDisable, LPUART_RxDisable, LPUART_RxEnable
#define LPUART_MSBFirstDisable (   module)

This macro disables MSB bit first. The LSB (bit0) is the 1st bit that is transmitted following the start bit.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_MSBFirstEnable
#define LPUART_MSBFirstEnable (   module)

This macro enables MSB bit first. The MSB (bit 9,8,7 or 6) is the 1st bit transmitted following the start bit.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_MSBFirstDisable
#define LPUART_RxInvDisable (   module)

This macro disables receive data inversion.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_RxInvEnable
#define LPUART_RxInvEnable (   module)

This macro enables receive data inversion.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_RxInvDisable
#define LPUART_RxWakeupIdleDisable (   module)

This macro disables receive wake up idle detect.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_RxWakeupIdleEnable
#define LPUART_RxWakeupIdleEnable (   module)

This macro enables receive wake up idle detect.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_RxWakeupIdleDisable
#define LPUART_LongBreakCharEnable (   module)

This macro enables long Break character generation. The Break character with length of 13 bit times is transmitted.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_LongBreakCharDisable
#define LPUART_LongBreakCharDisable (   module)

This macro disables long Break character generation. The Break character with length of 10 bit times is transmitted.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_LongBreakCharEnable
#define LPUART_LINBreakDisable (   module)

This macro disables a longer break character detection length.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_LINBreakEnable
#define LPUART_LINBreakEnable (   module)

This macro enables a longer break character detection length.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_LINBreakDisable
#define LPUART_TxIdle (   module)

This macro returns transmitter state of the specified module.

Parameters
moduleLPUART0.
Returns
true (non-zero) transmitter idle,
false transmitter active.
Note
Implemented as an inline macro.
See also
LPUART_RxFull, LPUART_TxComplete, LPUART_ClrFlags
#define LPUART_RxFull (   module)

This macro returns receiver state of the specified module.

Parameters
moduleLPUART0.
Returns
true (non-zero) character ready,
false receiver busy.
Note
Implemented as an inline macro.
See also
LPUART_TxIdle, LPUART_TxComplete, LPUART_ClrFlags
#define LPUART_TxComplete (   module)

This macro returns transfer complete state.

Parameters
moduleLPUART0.
Returns
true (non-zero) character transmit complete,
false character transmit non-complete.
Note
Implemented as an inline macro.
See also
LPUART_TxIdle, LPUART_RxFull, LPUART_ClrFlags
#define LPUART_ClrFlags (   module,
  mask 
)

This macro clears LPUART flags.

Parameters
moduleLPUART0.
maskSelect one of the LPUART Flags.
Note
Implemented as an inline macro.
See also
LPUART_TxIdle, LPUART_RxFull, LPUART_TxComplete
#define LPUART_GetChar (   module)

This macro reads character received by the specified module.

Parameters
moduleLPUART0.
Returns
int8 received character.
Note
Implemented as an inline macro.
Warning
Doesn't wait for a new byte (until RDRF is set). Insert while(!LPUART_RxFull(LPUART?)); statement prior this macro to ensure new byte is returned.
See also
LPUART_PutChar, LPUART_PutStr, LPUART_Rd, LPUART_GetData, LPUART_PutData, LPUART_Wr
#define LPUART_PutChar (   module,
 
)

This macro sends character to the specified module.

Parameters
moduleLPUART0.
cCharacter.
Note
Implemented as an inline macro.
Warning
Doesn't wait until character is sent. Insert while(!LPUART_TxIdle(LPUART?)); statement prior this macro to ensure transmitter is idle and able to send new character.
See also
LPUART_GetChar, LPUART_PutStr, LPUART_Rd, LPUART_GetChar, LPUART_PutData, LPUART_Wr
#define LPUART_GetData (   module)

This macro reads character received by the specified module.

Parameters
moduleLPUART0.
Returns
int16 received 16 bit word.
Note
Implemented as an inline macro.
Warning
Doesn't wait for a new byte (until RDRF is set). Insert while(!LPUART_RxFull(LPUART?)); statement prior this macro to ensure new byte is returned.
See also
LPUART_PutChar, LPUART_PutStr, LPUART_Rd, LPUART_GetChar, LPUART_PutData, LPUART_Wr
#define LPUART_PutData (   module,
 
)

This macro sends data to the specified module.

Parameters
moduleLPUART0.
c10-bit data to be sent.
Note
Implemented as an inline macro.
Warning
FRETSC (Frame Error / Transmit Special Character) bit is affected.
See also
LPUART_PutChar, LPUART_PutStr, LPUART_Rd, LPUART_GetChar, LPUART_GetData, LPUART_Wr
#define LPUART_PutStr (   module,
  str 
)

This macro sends string to the specified module.

Parameters
moduleLPUART0.
strString terminated by null character.
Note
Implemented as an inline macro.
Warning
Doesn't terminate until NULL character is read.
See also
LPUART_GetChar, LPUART_PutChar, LPUART_Rd, LPUART_GetData, LPUART_PutData, LPUART_Wr
#define LPUART_Rd (   module,
  buffer,
  count 
)

This macro reads count bytes from specified module and stores them in buffer. Returns when count bytes have been read.

Parameters
moduleLPUART0.
bufferuint8 [] specifies the variable in which to store the data that was read from the selected module.
countSpecifies the number of bytes to read from the selected module.
Note
Implemented as an inline macro.
Warning
Doesn't terminate until count bytes are read.
See also
LPUART_GetChar, LPUART_PutChar, LPUART_PutStr, LPUART_GetData, LPUART_PutData, LPUART_Wr
#define LPUART_Wr (   module,
  buffer,
  count 
)

This macro writes count bytes from buffer to the specified module. Returns when count bytes are written.

Parameters
moduleLPUART0.
bufferuint8 [] specifies the variable from which to read the data that will be written to the selected module.
countSpecifies the number of bytes to write to the selected module.
Note
Implemented as an inline macro.
See also
LPUART_GetChar, LPUART_PutChar, LPUART_PutStr, LPUART_GetData, LPUART_PutData, LPUART_Rd
#define LPUART_LoopModeCtrl (   module,
  ctrl 
)

This macro enables/disables internal loop mode for the specified module. When loop mode is set, the RxD pin is disconnected from the LPUART and the transmitter output is internally connected to the receiver input. The transmitter and the receiver must be enabled to use the loop function.

Parameters
moduleLPUART0.
ctrlTRUE (loopback mode enabled, receiver input is internally connected to transmitter output)
FALSE (normal operation).
Note
Implemented as an inline macro.
#define LPUART_SingleWireEnable (   module,
  dir 
)

This macro enables the single-wire mode, TX pin acts as input or output.

Parameters
moduleLPUART0.
dirSelect one of the LPUART Single-wire TxD Pin Directions.
Note
Implemented as an inline macro.
See also
LPUART_SingleWireDisable
#define LPUART_SingleWireDisable (   module)

This macro disables the single-wire mode, TX/RX pins working normally.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_SingleWireEnable
#define LPUART_MatchAddrDisable (   module)

This macro disables match address mode.

Parameters
moduleLPUART0.
Note
Implemented as an inline macro.
See also
LPUART_MatchAddrConfig
#define LPUART_MatchAddrConfig (   module,
  ma,
  addr1,
  addr2 
)

This macro enables match address mode, sets the match addresses.

Parameters
moduleLPUART0.
maSelect one of the LPUART Match Address Enable Bits.
addr1Address of first match.
addr2Address of second match.
Note
Implemented as an inline macro.
See also
LPUART_MatchAddrDisable
#define LPUART_InstallCallback (   ip,
  callback 
)

This function installs callback function for LPUART interrupt vector 43.

Parameters
ipSelect one of the ARM Cortex-M0+ Interrupt Priority Levels.
callbackPointer to the LPUART Callback Function.
Note
Implemented as a function call.
See also
LPUART_Init
#define LPUART_Init (   module,
  cfg 
)

This function initializes Low Power UART (LPUART) block.

Parameters
moduleLPUART0.
cfgSelect one of the LPUART Configuration Structures.
Note
Implemented as function call.
See also
LPUART_InstallCallback