no-OS
Macros | Functions | Variables
aducm3029_uart.c File Reference

Implementation of UART driver for ADuCM302x. More...

#include <stdlib.h>
#include "no_os_uart.h"
#include "aducm3029_uart.h"
#include "aducm3029_irq.h"
#include "no_os_util.h"
#include "no_os_alloc.h"
#include <drivers/uart/adi_uart.h>
Include dependency graph for aducm3029_uart.c:

Macros

#define NO_OS_CLK_FREQ   26000000u
 
#define NO_OS_BAUDS_NB   10u
 
#define NO_OS_NUM_UART_DEVICES   1
 

Functions

void uart_rx_callback (void *context)
 

Variables

const struct no_os_baud_desc baud_rates_26MHz [NO_OS_BAUDS_NB]
 
const struct no_os_uart_platform_ops aducm_uart_ops
 aducm3029 platform specific UART platform ops structure More...
 

Detailed Description

Implementation of UART driver for ADuCM302x.

Author
Mihail Chindris (mihai.nosp@m.l.ch.nosp@m.indri.nosp@m.s@an.nosp@m.alog..nosp@m.com)

Copyright 2019(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ NO_OS_BAUDS_NB

#define NO_OS_BAUDS_NB   10u

◆ NO_OS_CLK_FREQ

#define NO_OS_CLK_FREQ   26000000u

◆ NO_OS_NUM_UART_DEVICES

#define NO_OS_NUM_UART_DEVICES   1

In ADuCM302x UART0 is available

Function Documentation

◆ uart_rx_callback()

void uart_rx_callback ( void *  context)

Variable Documentation

◆ aducm_uart_ops

const struct no_os_uart_platform_ops aducm_uart_ops
Initial value:
= {
.init = &aducm3029_uart_init,
.read = &aducm3029_uart_read,
.write = &aducm3029_uart_write,
.read_nonblocking = &aducm3029_uart_read_nonblocking,
.write_nonblocking = &aducm3029_uart_write_nonblocking,
.get_errors = &aducm3029_uart_get_errors,
.remove = &aducm3029_uart_remove
}

aducm3029 platform specific UART platform ops structure

◆ baud_rates_26MHz

const struct no_os_baud_desc baud_rates_26MHz[NO_OS_BAUDS_NB]
Initial value:
= {
{9600, 1078, 3, 24, 3},
{19200, 1078, 3, 12, 3},
{38400, 1321, 3, 8, 2},
{57600, 1078, 3, 4, 3},
{115200, 1563, 1, 4, 3},
{230400, 1563, 1, 2, 3},
{460800, 1563, 1, 1, 3},
{921600, 1563, 1, 1, 2},
{1000000, 1280, 1, 1, 2},
{1500000, 171, 1, 1, 2}
}

Stores calculated baud rates and parameters