Kenji Arai
/
LPC1114_SPI_LCD_ST7565family_test
Controller chip is ST7565
Embed:
(wiki syntax)
Show/hide line numbers
uart_as_stdio.cpp
00001 /* 00002 * mbed Application program 00003 * Redirect Standard Input/Output 00004 * 00005 * Copyright (c) 2021 Kenji Arai / JH1PJL 00006 * http://www7b.biglobe.ne.jp/~kenjia/ 00007 * https://os.mbed.com/users/kenjiArai/ 00008 * Created: January 13th, 2021 00009 * Revised: January 14th, 2021 00010 */ 00011 00012 // Include -------------------------------------------------------------------- 00013 #include "mbed.h" 00014 00015 // Definition ----------------------------------------------------------------- 00016 00017 // Constructor ---------------------------------------------------------------- 00018 static BufferedSerial pc(USBTX, USBRX, 115200); 00019 00020 // RAM ------------------------------------------------------------------------ 00021 00022 // ROM / Constant data -------------------------------------------------------- 00023 00024 // Function prototypes -------------------------------------------------------- 00025 00026 //------------------------------------------------------------------------------ 00027 // Control Program 00028 //------------------------------------------------------------------------------ 00029 uint8_t readable() 00030 { 00031 return pc.readable(); 00032 } 00033 00034 void putc(uint8_t c) 00035 { 00036 char dt[4]; 00037 dt[0] = (char)c; 00038 pc.write(dt, 1); 00039 } 00040 00041 uint8_t getc() 00042 { 00043 char dt[4]; 00044 pc.read(dt, 1); 00045 return (uint8_t)dt[0]; 00046 }
Generated on Sat Jul 16 2022 19:23:09 by 1.7.2