Go to the documentation of this file.00001
00012 #include <7040S.H>
00013 #include "sci_ctrl.h"
00014 #include "imask_ctrl.h"
00015
00016 enum {
00017 CONSOLE_PORT = SCI_1,
00018 VDIP1_PORT = SCI_0,
00019 };
00020
00021
00022 int main(void) {
00023 int i;
00024
00025
00026 for (i = 0; i < 2; ++i) {
00027 sci_init(i, 4);
00028 }
00029 imask_set(0);
00030
00031
00032
00033 PFC.PEIOR.WORD |= 0x2000;
00034 PE.DR.WORD |= 0x2000;
00035
00036
00037
00038 PFC.PECR1.WORD &= ~0x3000;
00039 PFC.PEIOR.WORD |= 0x4000;
00040 #if 0
00041 PE.DR.WORD |= 0x4000;
00042 #elese
00043 PE.DR.WORD &= ~0x4000;
00044 #endif
00045
00046 while (1) {
00047 char ch = '\0';
00048
00049
00050 if (sci_readable(VDIP1_PORT) != 0) {
00051 sci_read(VDIP1_PORT, &ch, 1);
00052
00053 if ((ch == '\r') || (ch == '\n')) {
00054
00055 sci_write(CONSOLE_PORT, "\r\n", 2);
00056 } else {
00057 sci_write(CONSOLE_PORT, &ch, 1);
00058 }
00059 }
00060
00061
00062 if (sci_readable(CONSOLE_PORT) != 0) {
00063 sci_read(CONSOLE_PORT, &ch, 1);
00064
00065
00066
00067 if (ch == '\n') {
00068 ch = '\r';
00069 }
00070 sci_write(VDIP1_PORT, &ch, 1);
00071 }
00072 }
00073 }