Mbed port of Stm32f4Cube LCD LOG for STM32F429I-DISCO

Dependents:   DISCO-F429ZI_ExportTemplate1

Usage example: DISCO-F429ZI_ExportTemplate1

/media/uploads/icis4/lcdlog1.png

Committer:
icis4
Date:
Sat Dec 26 09:53:21 2015 +0000
Revision:
1:b88758065c40
Parent:
0:098e992daf30
License update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
icis4 1:b88758065c40 1 /* Copyright (c) 2015 Ivaylo Iltchev www.iltchev.com, MIT License
icis4 0:098e992daf30 2 *
icis4 0:098e992daf30 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
icis4 0:098e992daf30 4 * and associated documentation files (the "Software"), to deal in the Software without
icis4 0:098e992daf30 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
icis4 0:098e992daf30 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
icis4 0:098e992daf30 7 * Software is furnished to do so, subject to the following conditions:
icis4 0:098e992daf30 8 *
icis4 0:098e992daf30 9 * The above copyright notice and this permission notice shall be included in all copies or
icis4 0:098e992daf30 10 * substantial portions of the Software.
icis4 0:098e992daf30 11 *
icis4 0:098e992daf30 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
icis4 0:098e992daf30 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
icis4 0:098e992daf30 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
icis4 0:098e992daf30 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
icis4 0:098e992daf30 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
icis4 0:098e992daf30 17 */
icis4 0:098e992daf30 18
icis4 0:098e992daf30 19 #include "mbed_interface.h"
icis4 0:098e992daf30 20 #include "LCD_LOG_DISCO.h"
icis4 0:098e992daf30 21
icis4 0:098e992daf30 22 extern "C" LCD_LOG_PUTCHAR;
icis4 0:098e992daf30 23
icis4 0:098e992daf30 24 LCDLog::LCDLog(const char* name):Stream(name)
icis4 0:098e992daf30 25 {
icis4 0:098e992daf30 26 }
icis4 0:098e992daf30 27
icis4 0:098e992daf30 28 void LCDLog::Init(FILE* fhandle, const char* header, const char* footer)
icis4 0:098e992daf30 29 {
icis4 0:098e992daf30 30 char path[64];
icis4 0:098e992daf30 31 LCD_LOG_Init();
icis4 0:098e992daf30 32 if (header)
icis4 0:098e992daf30 33 Header(header);
icis4 0:098e992daf30 34 if (footer)
icis4 0:098e992daf30 35 Footer(footer);
icis4 0:098e992daf30 36 sprintf(path, "/%s", getName());
icis4 0:098e992daf30 37 freopen(path, "w", fhandle);
icis4 0:098e992daf30 38 mbed::mbed_set_unbuffered_stream(fhandle);
icis4 0:098e992daf30 39 LCD_LineColor = LCD_COLOR_GRAY;
icis4 0:098e992daf30 40 }
icis4 0:098e992daf30 41
icis4 0:098e992daf30 42 int LCDLog::_getc()
icis4 0:098e992daf30 43 {
icis4 0:098e992daf30 44 return 0;
icis4 0:098e992daf30 45 }
icis4 0:098e992daf30 46
icis4 0:098e992daf30 47 int LCDLog::_putc(int c)
icis4 0:098e992daf30 48 {
icis4 0:098e992daf30 49 return lcd_log_putc(c);
icis4 0:098e992daf30 50 }
icis4 0:098e992daf30 51