uartdrv.c File Reference

UARTDRV API implementation.

License

Copyright 2018 Silicon Laboratories Inc. www.silabs.com

SPDX-License-Identifier: Zlib

The licensor of this software is Silicon Laboratories Inc.

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Definition in file uartdrv.c .

#include <string.h>
#include " uartdrv.h "
#include "em_device.h"
#include " em_emu.h "
#include " em_gpio.h "
#include " em_core.h "
#include " gpiointerrupt.h "

Functions

Ecode_t UARTDRV_Abort ( UARTDRV_Handle_t handle, UARTDRV_AbortType_t type)
Abort ongoing UART transfers.
Ecode_t UARTDRV_DeInit ( UARTDRV_Handle_t handle)
Deinitialize a UART driver instance.
UARTDRV_FlowControlState_t UARTDRV_FlowControlGetPeerStatus ( UARTDRV_Handle_t handle)
Check the peer's flow control status.
UARTDRV_FlowControlState_t UARTDRV_FlowControlGetSelfStatus ( UARTDRV_Handle_t handle)
Check the self flow control status.
Ecode_t UARTDRV_FlowControlIgnoreRestrain ( UARTDRV_Handle_t handle)
Enable transmission when restrained by flow control.
Ecode_t UARTDRV_FlowControlSet ( UARTDRV_Handle_t handle, UARTDRV_FlowControlState_t state)
Set UART flow control state. Set nRTS pin if hardware flow control is enabled. Send XON/XOFF if software flow control is enabled.
Ecode_t UARTDRV_FlowControlSetPeerStatus ( UARTDRV_Handle_t handle, UARTDRV_FlowControlState_t state)
Set peer UART flow control state. Pause/resume transmit accordingly. Only for manual software flow control.
UARTDRV_Count_t UARTDRV_ForceReceive ( UARTDRV_Handle_t handle, uint8_t *data, UARTDRV_Count_t maxCount)
Direct receive without interrupts or callback. This is a blocking function.
Ecode_t UARTDRV_ForceTransmit ( UARTDRV_Handle_t handle, uint8_t *data, UARTDRV_Count_t count)
Direct transmit without interrupts or callback. This is a blocking function. that ignores flow control if enabled.
UARTDRV_Status_t UARTDRV_GetPeripheralStatus ( UARTDRV_Handle_t handle)
Return the status of the UART peripheral associated with a given handle.
uint8_t UARTDRV_GetReceiveDepth ( UARTDRV_Handle_t handle)
Return the number of queued receive operations.
UARTDRV_Status_t UARTDRV_GetReceiveStatus ( UARTDRV_Handle_t handle, uint8_t **buffer, UARTDRV_Count_t *itemsReceived, UARTDRV_Count_t *itemsRemaining)
Check the status of the UART and gather information about any ongoing receive operations.
uint8_t UARTDRV_GetTransmitDepth ( UARTDRV_Handle_t handle)
Returns the number of queued transmit operations.
UARTDRV_Status_t UARTDRV_GetTransmitStatus ( UARTDRV_Handle_t handle, uint8_t **buffer, UARTDRV_Count_t *itemsSent, UARTDRV_Count_t *itemsRemaining)
Check the status of the UART and gather information about any ongoing transmit operations.
Ecode_t UARTDRV_InitLeuart ( UARTDRV_Handle_t handle, const UARTDRV_InitLeuart_t *initData)
Initialize a LEUART driver instance.
Ecode_t UARTDRV_InitUart ( UARTDRV_Handle_t handle, const UARTDRV_InitUart_t *initData)
Initialize a U(S)ART driver instance.
Ecode_t UARTDRV_PauseTransmit ( UARTDRV_Handle_t handle)
Pause an ongoing transmit operation.
Ecode_t UARTDRV_Receive ( UARTDRV_Handle_t handle, uint8_t *data, UARTDRV_Count_t count, UARTDRV_Callback_t callback)
Start a non-blocking receive.
Ecode_t UARTDRV_ReceiveB ( UARTDRV_Handle_t handle, uint8_t *data, UARTDRV_Count_t count)
Start a blocking receive.
Ecode_t UARTDRV_ResumeTransmit ( UARTDRV_Handle_t handle)
Resume a paused transmit operation.
Ecode_t UARTDRV_Transmit ( UARTDRV_Handle_t handle, uint8_t *data, UARTDRV_Count_t count, UARTDRV_Callback_t callback)
Start a non-blocking transmit.
Ecode_t UARTDRV_TransmitB ( UARTDRV_Handle_t handle, uint8_t *data, UARTDRV_Count_t count)
Start a blocking transmit.