OpenCores
URL https://opencores.org/ocsvn/mips32r1/mips32r1/trunk

Subversion Repositories mips32r1

[/] [mips32r1/] [trunk/] [Software/] [demos/] [XD3_I2C/] [src/] [drivers/] [uart.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ayersg
#include "uart.h"
2
 
3
void UART_disableBoot(void)
4
{
5
        volatile uint32_t *uart = (volatile uint32_t *)UART_ADDRESS;
6
        uint32_t data;
7
 
8
        data = 0x00000100;
9
 
10
        *uart = data;
11
}
12
 
13
uint8_t UART_readByte(void)
14
{
15
        volatile uint32_t *uart = (volatile uint32_t *)UART_ADDRESS;
16
        uint32_t data;
17
 
18
        data = *uart;
19
 
20
        return (uint8_t)data;
21
}
22
 
23
uint32_t UART_readMessage(void)
24
{
25
        volatile uint32_t *uart = (volatile uint32_t *)UART_ADDRESS;
26
 
27
        return *uart;
28
}
29
 
30
void UART_writeByte(uint8_t byte)
31
{
32
        volatile uint32_t *uart = (volatile uint32_t *)UART_ADDRESS;
33
        uint32_t data;
34
 
35
        data = (uint32_t)byte;
36
        *uart = data;
37
}
38
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.