libpynq (release 5EWC0-2023 version 0.2.2 of 2023-09-24 22:22)
Loading...
Searching...
No Matches
uart.c File Reference
#include "uart.h"
#include "arm_shared_memory_system.h"
#include "log.h"
#include <platform.h>
#include <stdio.h>
Include dependency graph for uart.c:

Go to the source code of this file.

Macros

#define UART_REG_RECEIVE_FIFO   0
 
#define UART_REG_TRANSMIT_FIFO   1
 
#define UART_REG_STATUS   2
 
#define UART_REG_CONTROL   3
 
#define UART_REG_STATUS_BIT_RX_FIFO_HAS_DATA   1
 
#define UART_REG_STATUS_BIT_RX_FIFO_FULL   2
 
#define UART_REG_STATUS_BIT_TX_FIFO_EMPTY   4
 
#define UART_REG_STATUS_BIT_TX_FIFO_FULL   8
 
#define UART_REG_CONTROL_BIT_CLEAR_TX_FIFO   1
 
#define UART_REG_CONTROL_BIT_CLEAR_RX_FIFO   2
 
#define UART_REG_CONTROL_BIT_CLEAR_FIFOS    (UART_REG_CONTROL_BIT_CLEAR_RX_FIFO | UART_REG_CONTROL_BIT_CLEAR_TX_FIFO)
 

Functions

void uart_init (const int uart)
 
void uart_destroy (const int uart)
 
void uart_send (const int uart, const uint8_t data)
 
uint8_t uart_recv (const int uart)
 
bool uart_has_data (const int uart)
 
bool uart_has_space (const int uart)
 
void uart_reset_fifos (const int uart)
 

Macro Definition Documentation

◆ UART_REG_CONTROL

#define UART_REG_CONTROL   3

Definition at line 31 of file uart.c.

◆ UART_REG_CONTROL_BIT_CLEAR_FIFOS

#define UART_REG_CONTROL_BIT_CLEAR_FIFOS    (UART_REG_CONTROL_BIT_CLEAR_RX_FIFO | UART_REG_CONTROL_BIT_CLEAR_TX_FIFO)

Definition at line 40 of file uart.c.

◆ UART_REG_CONTROL_BIT_CLEAR_RX_FIFO

#define UART_REG_CONTROL_BIT_CLEAR_RX_FIFO   2

Definition at line 39 of file uart.c.

◆ UART_REG_CONTROL_BIT_CLEAR_TX_FIFO

#define UART_REG_CONTROL_BIT_CLEAR_TX_FIFO   1

Definition at line 38 of file uart.c.

◆ UART_REG_RECEIVE_FIFO

#define UART_REG_RECEIVE_FIFO   0

Definition at line 28 of file uart.c.

◆ UART_REG_STATUS

#define UART_REG_STATUS   2

Definition at line 30 of file uart.c.

◆ UART_REG_STATUS_BIT_RX_FIFO_FULL

#define UART_REG_STATUS_BIT_RX_FIFO_FULL   2

Definition at line 34 of file uart.c.

◆ UART_REG_STATUS_BIT_RX_FIFO_HAS_DATA

#define UART_REG_STATUS_BIT_RX_FIFO_HAS_DATA   1

Definition at line 33 of file uart.c.

◆ UART_REG_STATUS_BIT_TX_FIFO_EMPTY

#define UART_REG_STATUS_BIT_TX_FIFO_EMPTY   4

Definition at line 35 of file uart.c.

◆ UART_REG_STATUS_BIT_TX_FIFO_FULL

#define UART_REG_STATUS_BIT_TX_FIFO_FULL   8

Definition at line 36 of file uart.c.

◆ UART_REG_TRANSMIT_FIFO

#define UART_REG_TRANSMIT_FIFO   1

Definition at line 29 of file uart.c.