SmartSnippets DA1459x SDK
Data Structures | Macros | Typedefs | Enumerations | Functions
ad_uart.h File Reference

UART adapter API. More...

#include "ad.h"
#include "hw_uart.h"
#include "hw_dma.h"
#include "osal.h"
#include "resmgmt.h"

Go to the source code of this file.

Data Structures

struct  ad_uart_io_conf_t
 UART I/O configuration. More...
 
struct  ad_uart_driver_conf_t
 UART driver configuration. More...
 
struct  ad_uart_controller_conf_t
 UART controller configuration. More...
 

Macros

#define CONFIG_UART_USE_ASYNC_TRANSACTIONS   (1)
 Controls whether UART asynchronous transaction API will be used.
 
#define CONFIG_UART_USE_SYNC_TRANSACTIONS   (1)
 Controls whether UART synchronous transaction API will be used. More...
 

Typedefs

typedef void(* ad_uart_user_cb) (void *user_data, uint16_t transferred)
 Asynchronous callback function. More...
 

Enumerations

enum  AD_UART_RES_TYPE { AD_UART_RES_TYPE_CONFIG, AD_UART_RES_TYPE_WRITE, AD_UART_RES_TYPE_READ, AD_UART_RES_TYPES }
 UART resource types. More...
 
enum  AD_UART_ERROR { ,
  AD_UART_ERROR_CONFIG_RX_SIZE = -8, AD_UART_ERROR_IO_CFG_INVALID = -7, AD_UART_ERROR_RESOURCE_NOT_AVAILABLE = -6, AD_UART_ERROR_CONTROLLER_BUSY = -5,
  AD_UART_ERROR_DEVICE_CLOSED = -4, AD_UART_ERROR_CONTROLLER_CONF_INVALID = -3, AD_UART_ERROR_AUTOFLOW_CONF_INVALID = -2, AD_UART_ERROR_HANDLE_INVALID = -1,
  AD_UART_ERROR_NONE = 0
}
 UART adapter error codes. More...
 

Functions

void ad_uart_init (void)
 Initialize UART adapter. More...
 
ad_uart_handle_t ad_uart_open (const ad_uart_controller_conf_t *ad_uart_ctrl_conf)
 Open UART controller. More...
 
int ad_uart_close (ad_uart_handle_t handle, bool force)
 Close UART controller. More...
 
int ad_uart_reconfig (ad_uart_handle_t handle, const ad_uart_driver_conf_t *ad_drv)
 Reconfigure UART controller. More...
 
int ad_uart_write (ad_uart_handle_t handle, const char *wbuf, size_t wlen)
 Perform a blocking write transaction. More...
 
int ad_uart_read (ad_uart_handle_t handle, char *rbuf, size_t rlen, OS_TICK_TIME timeout)
 Perform a blocking read transaction. More...
 
int ad_uart_write_async (ad_uart_handle_t handle, const char *wbuf, size_t wlen, ad_uart_user_cb cb, void *user_data)
 Perform a non blocking write transaction. More...
 
int ad_uart_read_async (ad_uart_handle_t handle, char *rbuf, size_t rlen, ad_uart_user_cb cb, void *user_data)
 Perform a non blocking read transaction. More...
 
int ad_uart_complete_async_read (ad_uart_handle_t handle)
 Finish asynchronous read. More...
 
int ad_uart_complete_async_write (ad_uart_handle_t handle)
 Finish asynchronous write. More...
 
HW_UART_ID ad_uart_get_hw_uart_id (ad_uart_handle_t handle)
 Get UART controller id. More...
 
int ad_uart_io_config (HW_UART_ID id, const ad_uart_io_conf_t *io, AD_IO_CONF_STATE state)
 Initialize controller pins to on / off io configuration. More...
 

Detailed Description

UART adapter API.

Copyright (C) 2015-2023 Renesas Electronics Corporation and/or its affiliates. All rights reserved. Confidential Information.

This software ("Software") is supplied by Renesas Electronics Corporation and/or its affiliates ("Renesas"). Renesas grants you a personal, non-exclusive, non-transferable, revocable, non-sub-licensable right and license to use the Software, solely if used in or together with Renesas products. You may make copies of this Software, provided this copyright notice and disclaimer ("Notice") is included in all such copies. Renesas reserves the right to change or discontinue the Software at any time without notice.

THE SOFTWARE IS PROVIDED "AS IS". RENESAS DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. TO THE MAXIMUM EXTENT PERMITTED UNDER LAW, IN NO EVENT SHALL RENESAS BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE, EVEN IF RENESAS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. USE OF THIS SOFTWARE MAY BE SUBJECT TO TERMS AND CONDITIONS CONTAINED IN AN ADDITIONAL AGREEMENT BETWEEN YOU AND RENESAS. IN CASE OF CONFLICT BETWEEN THE TERMS OF THIS NOTICE AND ANY SUCH ADDITIONAL LICENSE AGREEMENT, THE TERMS OF THE AGREEMENT SHALL TAKE PRECEDENCE. BY CONTINUING TO USE THIS SOFTWARE, YOU AGREE TO THE TERMS OF THIS NOTICE.IF YOU DO NOT AGREE TO THESE TERMS, YOU ARE NOT PERMITTED TO USE THIS SOFTWARE.