SimAVR
AVR Simulator
avr_uart.c File Reference
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include "avr_uart.h"
#include "sim_hex.h"
Include dependency graph for avr_uart.c:

Macros

#define FONT_GREEN   "\e[32m"
 
#define FONT_DEFAULT   "\e[0m"
 
#define TRACE(_w)
 

Functions

 DEFINE_FIFO (uint8_t, uart_fifo)
 
static avr_cycle_count_t avr_uart_txc_raise (struct avr_t *avr, avr_cycle_count_t when, void *param)
 
static avr_cycle_count_t avr_uart_rxc_raise (struct avr_t *avr, avr_cycle_count_t when, void *param)
 
static uint8_t avr_uart_rxc_read (struct avr_t *avr, avr_io_addr_t addr, void *param)
 
static uint8_t avr_uart_read (struct avr_t *avr, avr_io_addr_t addr, void *param)
 
static void avr_uart_baud_write (struct avr_t *avr, avr_io_addr_t addr, uint8_t v, void *param)
 
static void avr_uart_udr_write (struct avr_t *avr, avr_io_addr_t addr, uint8_t v, void *param)
 
static void avr_uart_write (struct avr_t *avr, avr_io_addr_t addr, uint8_t v, void *param)
 
static void avr_uart_irq_input (struct avr_irq_t *irq, uint32_t value, void *param)
 
void avr_uart_reset (struct avr_io_t *io)
 
static int avr_uart_ioctl (struct avr_io_t *port, uint32_t ctl, void *io_param)
 
void avr_uart_init (avr_t *avr, avr_uart_t *p)
 

Variables

static const char * irq_names [UART_IRQ_COUNT]
 
static avr_io_t _io
 

Macro Definition Documentation

#define FONT_DEFAULT   "\e[0m"
#define FONT_GREEN   "\e[32m"
#define TRACE (   _w)

Function Documentation

static void avr_uart_baud_write ( struct avr_t avr,
avr_io_addr_t  addr,
uint8_t  v,
void *  param 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int avr_uart_ioctl ( struct avr_io_t port,
uint32_t  ctl,
void *  io_param 
)
static
static void avr_uart_irq_input ( struct avr_irq_t irq,
uint32_t  value,
void *  param 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static uint8_t avr_uart_read ( struct avr_t avr,
avr_io_addr_t  addr,
void *  param 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void avr_uart_reset ( struct avr_io_t io)

Here is the call graph for this function:

static avr_cycle_count_t avr_uart_rxc_raise ( struct avr_t avr,
avr_cycle_count_t  when,
void *  param 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static uint8_t avr_uart_rxc_read ( struct avr_t avr,
avr_io_addr_t  addr,
void *  param 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static avr_cycle_count_t avr_uart_txc_raise ( struct avr_t avr,
avr_cycle_count_t  when,
void *  param 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void avr_uart_udr_write ( struct avr_t avr,
avr_io_addr_t  addr,
uint8_t  v,
void *  param 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void avr_uart_write ( struct avr_t avr,
avr_io_addr_t  addr,
uint8_t  v,
void *  param 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

DEFINE_FIFO ( uint8_t  ,
uart_fifo   
)

Variable Documentation

avr_io_t _io
static
Initial value:
= {
.kind = "uart",
.reset = avr_uart_reset,
.ioctl = avr_uart_ioctl,
.irq_names = irq_names,
}
static int avr_uart_ioctl(struct avr_io_t *port, uint32_t ctl, void *io_param)
Definition: avr_uart.c:261
static const char * irq_names[UART_IRQ_COUNT]
Definition: avr_uart.c:283
void avr_uart_reset(struct avr_io_t *io)
Definition: avr_uart.c:241
const char* irq_names[UART_IRQ_COUNT]
static
Initial value:
= {
[UART_IRQ_INPUT] = "8<in",
[UART_IRQ_OUTPUT] = "8>out",
[UART_IRQ_OUT_XON] = ">xon",
[UART_IRQ_OUT_XOFF] = ">xoff",
}
signaled (continuously) when input fifo is not full
Definition: avr_uart.h:74
signaled when input fifo IS full
Definition: avr_uart.h:75
Definition: avr_uart.h:72
Definition: avr_uart.h:73