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:
Fri Dec 25 23:14:18 2015 +0000
Revision:
0:098e992daf30
Initial

Who changed what in which revision?

UserRevisionLine numberNew contents of line
icis4 0:098e992daf30 1 /**
icis4 0:098e992daf30 2 ******************************************************************************
icis4 0:098e992daf30 3 * @file lcd_log.h
icis4 0:098e992daf30 4 * @author MCD Application Team
icis4 0:098e992daf30 5 * @version V1.0.0
icis4 0:098e992daf30 6 * @date 18-February-2014
icis4 0:098e992daf30 7 * @brief header for the lcd_log.c file
icis4 0:098e992daf30 8 ******************************************************************************
icis4 0:098e992daf30 9 * @attention
icis4 0:098e992daf30 10 *
icis4 0:098e992daf30 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
icis4 0:098e992daf30 12 *
icis4 0:098e992daf30 13 * Redistribution and use in source and binary forms, with or without modification,
icis4 0:098e992daf30 14 * are permitted provided that the following conditions are met:
icis4 0:098e992daf30 15 * 1. Redistributions of source code must retain the above copyright notice,
icis4 0:098e992daf30 16 * this list of conditions and the following disclaimer.
icis4 0:098e992daf30 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
icis4 0:098e992daf30 18 * this list of conditions and the following disclaimer in the documentation
icis4 0:098e992daf30 19 * and/or other materials provided with the distribution.
icis4 0:098e992daf30 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
icis4 0:098e992daf30 21 * may be used to endorse or promote products derived from this software
icis4 0:098e992daf30 22 * without specific prior written permission.
icis4 0:098e992daf30 23 *
icis4 0:098e992daf30 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
icis4 0:098e992daf30 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
icis4 0:098e992daf30 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
icis4 0:098e992daf30 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
icis4 0:098e992daf30 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
icis4 0:098e992daf30 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
icis4 0:098e992daf30 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
icis4 0:098e992daf30 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
icis4 0:098e992daf30 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
icis4 0:098e992daf30 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
icis4 0:098e992daf30 34 *
icis4 0:098e992daf30 35 ******************************************************************************
icis4 0:098e992daf30 36 */
icis4 0:098e992daf30 37
icis4 0:098e992daf30 38 /* Define to prevent recursive inclusion -------------------------------------*/
icis4 0:098e992daf30 39 #ifndef __LCD_LOG_H__
icis4 0:098e992daf30 40 #define __LCD_LOG_H__
icis4 0:098e992daf30 41
icis4 0:098e992daf30 42 /* Includes ------------------------------------------------------------------*/
icis4 0:098e992daf30 43
icis4 0:098e992daf30 44 #ifdef TARGET_DISCO_F429ZI
icis4 0:098e992daf30 45 #include "lcd_log_conf_stm32f429i_discovery.h"
icis4 0:098e992daf30 46 #else
icis4 0:098e992daf30 47 #error "Unsupported target"
icis4 0:098e992daf30 48 #endif
icis4 0:098e992daf30 49
icis4 0:098e992daf30 50 /** @addtogroup Utilities
icis4 0:098e992daf30 51 * @{
icis4 0:098e992daf30 52 */
icis4 0:098e992daf30 53
icis4 0:098e992daf30 54 /** @addtogroup STM32_EVAL
icis4 0:098e992daf30 55 * @{
icis4 0:098e992daf30 56 */
icis4 0:098e992daf30 57
icis4 0:098e992daf30 58 /** @addtogroup Common
icis4 0:098e992daf30 59 * @{
icis4 0:098e992daf30 60 */
icis4 0:098e992daf30 61
icis4 0:098e992daf30 62 /** @addtogroup LCD_LOG
icis4 0:098e992daf30 63 * @{
icis4 0:098e992daf30 64 */
icis4 0:098e992daf30 65
icis4 0:098e992daf30 66 /** @defgroup LCD_LOG
icis4 0:098e992daf30 67 * @brief
icis4 0:098e992daf30 68 * @{
icis4 0:098e992daf30 69 */
icis4 0:098e992daf30 70
icis4 0:098e992daf30 71
icis4 0:098e992daf30 72 /** @defgroup LCD_LOG_Exported_Defines
icis4 0:098e992daf30 73 * @{
icis4 0:098e992daf30 74 */
icis4 0:098e992daf30 75
icis4 0:098e992daf30 76 #if (LCD_SCROLL_ENABLED == 1)
icis4 0:098e992daf30 77 #define LCD_CACHE_DEPTH (YWINDOW_SIZE + CACHE_SIZE)
icis4 0:098e992daf30 78 #else
icis4 0:098e992daf30 79 #define LCD_CACHE_DEPTH YWINDOW_SIZE
icis4 0:098e992daf30 80 #endif
icis4 0:098e992daf30 81 /**
icis4 0:098e992daf30 82 * @}
icis4 0:098e992daf30 83 */
icis4 0:098e992daf30 84
icis4 0:098e992daf30 85 /** @defgroup LCD_LOG_Exported_Types
icis4 0:098e992daf30 86 * @{
icis4 0:098e992daf30 87 */
icis4 0:098e992daf30 88 typedef struct _LCD_LOG_line
icis4 0:098e992daf30 89 {
icis4 0:098e992daf30 90 uint8_t line[128];
icis4 0:098e992daf30 91 uint32_t color;
icis4 0:098e992daf30 92
icis4 0:098e992daf30 93 } LCD_LOG_line;
icis4 0:098e992daf30 94
icis4 0:098e992daf30 95 /**
icis4 0:098e992daf30 96 * @}
icis4 0:098e992daf30 97 */
icis4 0:098e992daf30 98
icis4 0:098e992daf30 99 /** @defgroup LCD_LOG_Exported_Macros
icis4 0:098e992daf30 100 * @{
icis4 0:098e992daf30 101 */
icis4 0:098e992daf30 102 #define LCD_ErrLog(...) LCD_LineColor = LCD_COLOR_RED;\
icis4 0:098e992daf30 103 printf("ERROR: ") ;\
icis4 0:098e992daf30 104 printf(__VA_ARGS__);\
icis4 0:098e992daf30 105 LCD_LineColor = LCD_LOG_DEFAULT_COLOR
icis4 0:098e992daf30 106
icis4 0:098e992daf30 107 #define LCD_UsrLog(...) LCD_LineColor = LCD_LOG_TEXT_COLOR;\
icis4 0:098e992daf30 108 printf(__VA_ARGS__);\
icis4 0:098e992daf30 109
icis4 0:098e992daf30 110
icis4 0:098e992daf30 111 #define LCD_DbgLog(...) LCD_LineColor = LCD_COLOR_CYAN;\
icis4 0:098e992daf30 112 printf(__VA_ARGS__);\
icis4 0:098e992daf30 113 LCD_LineColor = LCD_LOG_DEFAULT_COLOR
icis4 0:098e992daf30 114 /**
icis4 0:098e992daf30 115 * @}
icis4 0:098e992daf30 116 */
icis4 0:098e992daf30 117
icis4 0:098e992daf30 118 /** @defgroup LCD_LOG_Exported_Variables
icis4 0:098e992daf30 119 * @{
icis4 0:098e992daf30 120 */
icis4 0:098e992daf30 121 extern uint32_t LCD_LineColor;
icis4 0:098e992daf30 122
icis4 0:098e992daf30 123 /**
icis4 0:098e992daf30 124 * @}
icis4 0:098e992daf30 125 */
icis4 0:098e992daf30 126
icis4 0:098e992daf30 127 /** @defgroup LCD_LOG_Exported_FunctionsPrototype
icis4 0:098e992daf30 128 * @{
icis4 0:098e992daf30 129 */
icis4 0:098e992daf30 130 #ifdef __cplusplus
icis4 0:098e992daf30 131 extern "C" {
icis4 0:098e992daf30 132 #endif
icis4 0:098e992daf30 133 void LCD_LOG_Init(void);
icis4 0:098e992daf30 134 void LCD_LOG_DeInit(void);
icis4 0:098e992daf30 135 void LCD_LOG_SetHeader(uint8_t *Title);
icis4 0:098e992daf30 136 void LCD_LOG_SetFooter(uint8_t *Status);
icis4 0:098e992daf30 137 void LCD_LOG_ClearTextZone(void);
icis4 0:098e992daf30 138 void LCD_LOG_UpdateDisplay (void);
icis4 0:098e992daf30 139 #ifdef __cplusplus
icis4 0:098e992daf30 140 }
icis4 0:098e992daf30 141 #endif
icis4 0:098e992daf30 142 #if (LCD_SCROLL_ENABLED == 1)
icis4 0:098e992daf30 143 ErrorStatus LCD_LOG_ScrollBack(void);
icis4 0:098e992daf30 144 ErrorStatus LCD_LOG_ScrollForward(void);
icis4 0:098e992daf30 145 #endif
icis4 0:098e992daf30 146 /**
icis4 0:098e992daf30 147 * @}
icis4 0:098e992daf30 148 */
icis4 0:098e992daf30 149
icis4 0:098e992daf30 150
icis4 0:098e992daf30 151 #endif /* __LCD_LOG_H__ */
icis4 0:098e992daf30 152
icis4 0:098e992daf30 153 /**
icis4 0:098e992daf30 154 * @}
icis4 0:098e992daf30 155 */
icis4 0:098e992daf30 156
icis4 0:098e992daf30 157 /**
icis4 0:098e992daf30 158 * @}
icis4 0:098e992daf30 159 */
icis4 0:098e992daf30 160
icis4 0:098e992daf30 161 /**
icis4 0:098e992daf30 162 * @}
icis4 0:098e992daf30 163 */
icis4 0:098e992daf30 164
icis4 0:098e992daf30 165 /**
icis4 0:098e992daf30 166 * @}
icis4 0:098e992daf30 167 */
icis4 0:098e992daf30 168
icis4 0:098e992daf30 169 /**
icis4 0:098e992daf30 170 * @}
icis4 0:098e992daf30 171 */
icis4 0:098e992daf30 172
icis4 0:098e992daf30 173 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
icis4 0:098e992daf30 174
icis4 0:098e992daf30 175