Ivaylo Iltchev / LCD_LOG_DISCO

Dependents:   DISCO-F429ZI_ExportTemplate1

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LCD_LOG_DISCO.h Source File

LCD_LOG_DISCO.h

00001 /* Copyright (c) 2015 Ivaylo Iltchev www.iltchev.com, MIT License
00002 *
00003 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
00004 * and associated documentation files (the "Software"), to deal in the Software without
00005 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
00006 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
00007 * Software is furnished to do so, subject to the following conditions:
00008 *
00009 * The above copyright notice and this permission notice shall be included in all copies or
00010 * substantial portions of the Software.
00011 *
00012 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
00013 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00014 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
00015 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00016 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00017 */
00018 
00019 #ifndef __LCD_LOG_DISCO_H
00020 #define __LCD_LOG_DISCO_H
00021 
00022 #ifdef TARGET_DISCO_F429ZI
00023 
00024 #include <string>
00025 #include <Stream.h>
00026 #include "lcd_log.h"
00027 
00028 class LCDLog : public mbed::Stream {
00029 
00030 public:
00031     LCDLog(const char *name=NULL);
00032 
00033     void Init(FILE* fhandle, const char* header = NULL, const char* footer = NULL);
00034 
00035     inline void Header(const char* text) { LCD_LOG_SetHeader((uint8_t*)text); }
00036     inline void Footer(const char* text) { LCD_LOG_SetFooter((uint8_t*)text); }
00037     inline void UpdateDisplay(void) { LCD_LOG_UpdateDisplay(); }
00038 
00039 protected:
00040     virtual int _getc();
00041     virtual int _putc(int c);
00042 };
00043 
00044 #else
00045 #error "Only DISCO_F429ZI board for now."
00046 #endif // TARGET_DISCO_F429ZI
00047 
00048 #endif // __LCD_LOG_DISCO_H
00049