[mips]
- libsys multitarget - apps multitarget git-svn-id: http://moon:8086/svn/mips@67 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "../../uart.h"
|
||||
#include "../../console.h"
|
||||
|
||||
extern uart_if_t uart_if[];
|
||||
|
||||
#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||
|
||||
const con_if_entry_t con_if_entry[5] =
|
||||
{
|
||||
{"UART-0", &uart_if[0], NULL, NULL, UART_readchar, UART_writechar},
|
||||
{"UART-1", &uart_if[1], NULL, NULL, UART_readchar, UART_writechar}
|
||||
};
|
||||
|
||||
con_if_t con_if =
|
||||
{
|
||||
con_if_entry, ARRAYSIZE(con_if_entry)
|
||||
};
|
||||
@@ -93,6 +93,29 @@
|
||||
#define SYS_UART1_STAT (SYS_IO_BASE + 0x10104)
|
||||
#define SYS_UART1_BAUD (SYS_IO_BASE + 0x10108)
|
||||
|
||||
// SPI
|
||||
#define SYS_SPI_STAT (SYS_IO_BASE + 0x20000)
|
||||
// Read
|
||||
#define SPI_STAT_CMDRDY (0x01)
|
||||
#define SPI_STAT_DINRDY (0x02)
|
||||
#define SPI_STAT_DOUTRDY (0x04)
|
||||
#define SPI_STAT_CMD_FIFO_FULL (0x0100)
|
||||
#define SPI_STAT_CMD_FIFO_EMPTY (0x0200)
|
||||
#define SPI_STAT_WRITE_FIFO_FULL (0x0400)
|
||||
#define SPI_STAT_WRITE_FIFO_EMPTY (0x0800)
|
||||
#define SPI_STAT_READ_FIFO_FULL (0x1000)
|
||||
#define SPI_STAT_READ_FIFO_EMPTY (0x2000)
|
||||
#define SPI_STAT_RX_VALID (0x4000)
|
||||
#define SPI_STAT_SPI_HOLD (0x8000)
|
||||
|
||||
// Write
|
||||
#define SPI_STAT_COMMIT (1)
|
||||
|
||||
#define SYS_SPI_XFER_SIZE (SYS_IO_BASE + 0x20004)
|
||||
#define SYS_SPI_DATA_SIZE (SYS_IO_BASE + 0x20008)
|
||||
#define SYS_SPI_DATA (SYS_IO_BASE + 0x2000C)
|
||||
#define SYS_SPI_CTRL (SYS_IO_BASE + 0x20010)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "../../mips_ps2.h"
|
||||
#include "../../screen.h"
|
||||
#include "../../uart.h"
|
||||
#include "../../console.h"
|
||||
|
||||
extern uart_if_t uart_if[];
|
||||
extern ps2_if_t ps2_if[];
|
||||
extern vga_if_t vga_if;
|
||||
|
||||
#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||
|
||||
static const con_if_entry_t con_if_entry[5] =
|
||||
{
|
||||
{"UART-0", &uart_if[0], NULL, NULL, UART_readchar, UART_writechar},
|
||||
{"UART-1", &uart_if[1], NULL, NULL, UART_readchar, UART_writechar},
|
||||
{"PS2-0", &ps2_if[0], PS2_open, PS2_close, PS2_readchar, NULL},
|
||||
{"PS2-1", &ps2_if[1], PS2_open, PS2_close, PS2_readchar, NULL},
|
||||
{"VGA-0", &vga_if, cg_open, cg_close, NULL, cg_writechar}
|
||||
};
|
||||
|
||||
con_if_t con_if =
|
||||
{
|
||||
con_if_entry, ARRAYSIZE(con_if_entry)
|
||||
};
|
||||
Reference in New Issue
Block a user