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 #ifndef __LCD_LOG_DISCO_H
icis4 0:098e992daf30 20 #define __LCD_LOG_DISCO_H
icis4 0:098e992daf30 21
icis4 0:098e992daf30 22 #ifdef TARGET_DISCO_F429ZI
icis4 0:098e992daf30 23
icis4 0:098e992daf30 24 #include <string>
icis4 0:098e992daf30 25 #include <Stream.h>
icis4 0:098e992daf30 26 #include "lcd_log.h"
icis4 0:098e992daf30 27
icis4 0:098e992daf30 28 class LCDLog : public mbed::Stream {
icis4 0:098e992daf30 29
icis4 0:098e992daf30 30 public:
icis4 0:098e992daf30 31 LCDLog(const char *name=NULL);
icis4 0:098e992daf30 32
icis4 0:098e992daf30 33 void Init(FILE* fhandle, const char* header = NULL, const char* footer = NULL);
icis4 0:098e992daf30 34
icis4 0:098e992daf30 35 inline void Header(const char* text) { LCD_LOG_SetHeader((uint8_t*)text); }
icis4 0:098e992daf30 36 inline void Footer(const char* text) { LCD_LOG_SetFooter((uint8_t*)text); }
icis4 0:098e992daf30 37 inline void UpdateDisplay(void) { LCD_LOG_UpdateDisplay(); }
icis4 0:098e992daf30 38
icis4 0:098e992daf30 39 protected:
icis4 0:098e992daf30 40 virtual int _getc();
icis4 0:098e992daf30 41 virtual int _putc(int c);
icis4 0:098e992daf30 42 };
icis4 0:098e992daf30 43
icis4 0:098e992daf30 44 #else
icis4 0:098e992daf30 45 #error "Only DISCO_F429ZI board for now."
icis4 0:098e992daf30 46 #endif // TARGET_DISCO_F429ZI
icis4 0:098e992daf30 47
icis4 0:098e992daf30 48 #endif // __LCD_LOG_DISCO_H
icis4 0:098e992daf30 49