microSD Card control function for DISCO-F769NI based on BD_SD_DISCO_F746NG library by Roy Krikke
Dependencies: BD_SD_DISCO_F769NI BSP_DISCO_F769NI
Fork of DISCO-F746NG_BLOCK_DEVICE_WITH_FAT_FILESYSTEM_ON_SDCARD by
Please refer following my Notebook page.
/users/kenjiArai/notebook/sd-card-control-new/#
Diff: uart_as_stdio/uart_as_stdio.cpp
- Revision:
- 8:12621f1fcbbe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uart_as_stdio/uart_as_stdio.cpp Thu Jan 14 00:40:36 2021 +0000 @@ -0,0 +1,46 @@ +/* + * mbed Application program + * Redirect Standard Input/Output + * + * Copyright (c) 2021 Kenji Arai / JH1PJL + * http://www7b.biglobe.ne.jp/~kenjia/ + * https://os.mbed.com/users/kenjiArai/ + * Created: January 13th, 2021 + * Revised: January 14th, 2021 + */ + +// Include -------------------------------------------------------------------- +#include "mbed.h" + +// Definition ----------------------------------------------------------------- + +// Constructor ---------------------------------------------------------------- +static BufferedSerial pc(USBTX, USBRX, 115200); + +// RAM ------------------------------------------------------------------------ + +// ROM / Constant data -------------------------------------------------------- + +// Function prototypes -------------------------------------------------------- + +//------------------------------------------------------------------------------ +// Control Program +//------------------------------------------------------------------------------ +uint8_t readable() +{ + return pc.readable(); +} + +void putc(uint8_t c) +{ + char dt[4]; + dt[0] = (char)c; + pc.write(dt, 1); +} + +uint8_t getc() +{ + char dt[4]; + pc.read(dt, 1); + return (uint8_t)dt[0]; +}