no-OS
Classes | Macros | Enumerations
uart_extra.h File Reference

Header file of UART driver for ADuCM302x. More...

#include <drivers/uart/adi_uart.h>
#include <stdbool.h>
#include <stdint.h>
#include "no_os_error.h"
Include dependency graph for uart_extra.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  aducm_uart_init_param
 Stores specific parameter needed to initialize the UART driver for the ADuCM3029 platform. More...
 
struct  no_os_baud_desc
 Structure of an element from baud_rates_26MHz. The baud rate is calculated with the formula: Baudrate = (NO_OS_CLK_FREQ / (div_m + div_n/2048) * pow(2,osr+2) * div_c)). More...
 
struct  no_os_op_desc
 It stores the state of a operation. More...
 
struct  no_os_aducm_uart_desc
 Stores specific parameter needed by the UART driver for internal operations. More...
 

Macros

#define NO_OS_UART_MAX_BYTES   1024u
 

Enumerations

enum  UART_ERROR {
  NO_ERR = 0x00,
  BAD_INPUT_PARAMETERS = 0x01,
  WAITING_FOR_CALLBACK = 0x02,
  HW_ERR_FRAMING = 0x10,
  HW_ERR_PARITY = 0x20,
  HW_ERR_OVERRUN = 0x40,
  BREAK_INTERRUPT = 0x80,
  HW_ERR_RX_CHAN_DMA_BUS_FAULT = 0x100,
  HW_ERR_TX_CHAN_DMA_BUS_FAULT = 0x200,
  HW_ERR_RX_CHAN_DMA_INVALID_DESCR = 0x400,
  HW_ERR_TX_CHAN_DMA_INVALID_DESCR = 0x800,
  HW_ERR_RX_CHAN_DMA_UNKNOWN_ERROR = 0x1000,
  HW_ERR_TX_CHAN_DMA_UNKNOWN_ERROR = 0x2000
}
 Values returned by no_os_uart_get_errors. Multiple values can be set. More...
 
enum  UART_WORDLEN {
  UART_WORDLEN_5BITS,
  UART_WORDLEN_6BITS,
  UART_WORDLEN_7BITS,
  UART_WORDLEN_8BITS
}
 Values for word_length in aducm_uart_init_param. More...
 
enum  UART_PARITY {
  UART_NO_PARITY = 0x0,
  UART_ODD_PARITY = 0x8,
  UART_EVEN_PARITY = 0x18,
  UART_ODD_PARITY_STICKY = 0x28,
  UART_EVEN_PARITY_STICKY = 0x38
}
 Values for parity in aducm_uart_init_param. More...
 
enum  UART_STOPBITS {
  UART_ONE_STOPBIT = 0x00,
  UART_ONE_AND_HALF_TWO_STOPBITS = 0x04
}
 Values for stop_bits in aducm_uart_init_param. More...
 
enum  UART_BAUD {
  BD_9600 = 9600,
  BD_19200 = 19200,
  BD_38400 = 38400,
  BD_57600 = 57600,
  BD_115200 = 115200,
  BD_230400 = 230400,
  BD_460800 = 460800,
  BD_921600 = 921600,
  BD_1000000 = 1000000,
  BD_1500000 = 1500000
}
 Values for baud_rate in aducm_uart_init_param The values are only valid if the ADuCM3029 runs at 26MHz. If other values for the baud rate are needed, the user must add a new set of parameters in baud_rates_26MHz calculated by the given formula. More...
 

Detailed Description

Header file 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.

All rights reserved.

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

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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_UART_MAX_BYTES

#define NO_OS_UART_MAX_BYTES   1024u

Maximum number of bytes that can be transmitted on UART in one transfer

Enumeration Type Documentation

◆ UART_BAUD

enum UART_BAUD

Values for baud_rate in aducm_uart_init_param The values are only valid if the ADuCM3029 runs at 26MHz. If other values for the baud rate are needed, the user must add a new set of parameters in baud_rates_26MHz calculated by the given formula.

Enumerator
BD_9600 

Baud rate of 9600 bps

BD_19200 

Baud rate of 19200 bps

BD_38400 

Baud rate of 38400 bps

BD_57600 

Baud rate of 57600 bps

BD_115200 

Baud rate of 115200 bps

BD_230400 

Baud rate of 230400 bps

BD_460800 

Baud rate of 460800 bps

BD_921600 

Baud rate of 921600 bps

BD_1000000 

Baud rate of 1000000 bps

BD_1500000 

Baud rate of 1500000 bps

◆ UART_ERROR

enum UART_ERROR

Values returned by no_os_uart_get_errors. Multiple values can be set.

Enumerator
NO_ERR 

No errors

BAD_INPUT_PARAMETERS 

Bytes number for read/write was set 0 or greater than NO_OS_UART_MAX_BYTES

WAITING_FOR_CALLBACK 

New call was made before a callback call ended

HW_ERR_FRAMING 

Rx framing error

HW_ERR_PARITY 

Rx parity error

HW_ERR_OVERRUN 

Receive overrun

BREAK_INTERRUPT 

Break condition

HW_ERR_RX_CHAN_DMA_BUS_FAULT 

Rx DMA channel bus fault detected

HW_ERR_TX_CHAN_DMA_BUS_FAULT 

Tx DMA channel bus fault detected

HW_ERR_RX_CHAN_DMA_INVALID_DESCR 

Rx DMA channel invalid descriptor detected.

HW_ERR_TX_CHAN_DMA_INVALID_DESCR 

Tx DMA channel invalid descriptor detected.

HW_ERR_RX_CHAN_DMA_UNKNOWN_ERROR 

Rx DMA channel unknown error detected.

HW_ERR_TX_CHAN_DMA_UNKNOWN_ERROR 

Tx DMA channel unknown error detected.

◆ UART_PARITY

Values for parity in aducm_uart_init_param.

Enumerator
UART_NO_PARITY 

No parity.

UART_ODD_PARITY 

Odd parity.

UART_EVEN_PARITY 

Even Parity.

UART_ODD_PARITY_STICKY 

Sticky odd parity.

UART_EVEN_PARITY_STICKY 

Sticky even parity.

◆ UART_STOPBITS

Values for stop_bits in aducm_uart_init_param.

Enumerator
UART_ONE_STOPBIT 

One stop bit regardless of the word length

UART_ONE_AND_HALF_TWO_STOPBITS 

Number of stop bits based on word length. 1.5 stop bits for word length of 5 bits and 2 for rest( 6,7,8 bit word length)

◆ UART_WORDLEN

Values for word_length in aducm_uart_init_param.

Enumerator
UART_WORDLEN_5BITS 

Word 5 bits wide.

UART_WORDLEN_6BITS 

Word 6 bits wide.

UART_WORDLEN_7BITS 

Word 7 bits wide.

UART_WORDLEN_8BITS 

Word 8 bits wide.