Mbed port of Stm32f4Cube LCD LOG for STM32F429I-DISCO

Dependents:   DISCO-F429ZI_ExportTemplate1

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lcd_log.h Source File

lcd_log.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    lcd_log.h
00004   * @author  MCD Application Team
00005   * @version V1.0.0
00006   * @date    18-February-2014
00007   * @brief   header for the lcd_log.c file
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
00012   *
00013   * Redistribution and use in source and binary forms, with or without modification,
00014   * are permitted provided that the following conditions are met:
00015   *   1. Redistributions of source code must retain the above copyright notice,
00016   *      this list of conditions and the following disclaimer.
00017   *   2. Redistributions in binary form must reproduce the above copyright notice,
00018   *      this list of conditions and the following disclaimer in the documentation
00019   *      and/or other materials provided with the distribution.
00020   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00021   *      may be used to endorse or promote products derived from this software
00022   *      without specific prior written permission.
00023   *
00024   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00025   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00026   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00028   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00029   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00030   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034   *
00035   ******************************************************************************
00036   */
00037 
00038 /* Define to prevent recursive inclusion -------------------------------------*/
00039 #ifndef  __LCD_LOG_H__
00040 #define  __LCD_LOG_H__
00041 
00042 /* Includes ------------------------------------------------------------------*/
00043 
00044 #ifdef TARGET_DISCO_F429ZI
00045 #include "lcd_log_conf_stm32f429i_discovery.h"
00046 #else
00047 #error "Unsupported target"
00048 #endif
00049 
00050 /** @addtogroup Utilities
00051   * @{
00052   */
00053 
00054 /** @addtogroup STM32_EVAL
00055   * @{
00056   */
00057 
00058 /** @addtogroup Common
00059   * @{
00060   */
00061 
00062 /** @addtogroup LCD_LOG
00063   * @{
00064   */
00065 
00066 /** @defgroup LCD_LOG
00067   * @brief
00068   * @{
00069   */
00070 
00071 
00072 /** @defgroup LCD_LOG_Exported_Defines
00073   * @{
00074   */
00075 
00076 #if (LCD_SCROLL_ENABLED == 1)
00077  #define     LCD_CACHE_DEPTH     (YWINDOW_SIZE + CACHE_SIZE)
00078 #else
00079  #define     LCD_CACHE_DEPTH     YWINDOW_SIZE
00080 #endif
00081 /**
00082   * @}
00083   */
00084 
00085 /** @defgroup LCD_LOG_Exported_Types
00086   * @{
00087   */
00088 typedef struct _LCD_LOG_line
00089 {
00090   uint8_t  line[128];
00091   uint32_t color;
00092 
00093 } LCD_LOG_line;
00094 
00095 /**
00096   * @}
00097   */
00098 
00099 /** @defgroup LCD_LOG_Exported_Macros
00100   * @{
00101   */
00102 #define  LCD_ErrLog(...)    LCD_LineColor = LCD_COLOR_RED;\
00103                             printf("ERROR: ") ;\
00104                             printf(__VA_ARGS__);\
00105                             LCD_LineColor = LCD_LOG_DEFAULT_COLOR
00106 
00107 #define  LCD_UsrLog(...)    LCD_LineColor = LCD_LOG_TEXT_COLOR;\
00108                             printf(__VA_ARGS__);\
00109 
00110 
00111 #define  LCD_DbgLog(...)    LCD_LineColor = LCD_COLOR_CYAN;\
00112                             printf(__VA_ARGS__);\
00113                             LCD_LineColor = LCD_LOG_DEFAULT_COLOR
00114 /**
00115   * @}
00116   */
00117 
00118 /** @defgroup LCD_LOG_Exported_Variables
00119   * @{
00120   */
00121 extern uint32_t LCD_LineColor;
00122 
00123 /**
00124   * @}
00125   */
00126 
00127 /** @defgroup LCD_LOG_Exported_FunctionsPrototype
00128   * @{
00129   */
00130 #ifdef __cplusplus
00131 extern "C" {
00132 #endif
00133     void LCD_LOG_Init(void);
00134     void LCD_LOG_DeInit(void);
00135     void LCD_LOG_SetHeader(uint8_t *Title);
00136     void LCD_LOG_SetFooter(uint8_t *Status);
00137     void LCD_LOG_ClearTextZone(void);
00138     void LCD_LOG_UpdateDisplay (void);
00139 #ifdef __cplusplus
00140 }
00141 #endif
00142 #if (LCD_SCROLL_ENABLED == 1)
00143  ErrorStatus LCD_LOG_ScrollBack(void);
00144  ErrorStatus LCD_LOG_ScrollForward(void);
00145 #endif
00146 /**
00147   * @}
00148   */
00149 
00150 
00151 #endif /* __LCD_LOG_H__ */
00152 
00153 /**
00154   * @}
00155   */
00156 
00157 /**
00158   * @}
00159   */
00160 
00161 /**
00162   * @}
00163   */
00164 
00165 /**
00166   * @}
00167   */
00168 
00169 /**
00170   * @}
00171   */
00172 
00173 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00174 
00175