Library to control Silicon Labs SI570 10 MHZ TO 1.4 GHZ I2C PROGRAMMABLE XO/VCXO.

Dependencies:   mbed

Fork of SI570 by Gerrit Polder

Committer:
DL3LD
Date:
Sun Mar 27 06:55:59 2016 +0000
Revision:
1:1556bcaaf759
STM32F746NG SI570 VFO Test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DL3LD 1:1556bcaaf759 1 /**
DL3LD 1:1556bcaaf759 2 ******************************************************************************
DL3LD 1:1556bcaaf759 3 * @file stm32746g_discovery_lcd.h
DL3LD 1:1556bcaaf759 4 * @author MCD Application Team
DL3LD 1:1556bcaaf759 5 * @version V1.0.0
DL3LD 1:1556bcaaf759 6 * @date 25-June-2015
DL3LD 1:1556bcaaf759 7 * @brief This file contains the common defines and functions prototypes for
DL3LD 1:1556bcaaf759 8 * the stm32746g_discovery_lcd.c driver.
DL3LD 1:1556bcaaf759 9 ******************************************************************************
DL3LD 1:1556bcaaf759 10 * @attention
DL3LD 1:1556bcaaf759 11 *
DL3LD 1:1556bcaaf759 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
DL3LD 1:1556bcaaf759 13 *
DL3LD 1:1556bcaaf759 14 * Redistribution and use in source and binary forms, with or without modification,
DL3LD 1:1556bcaaf759 15 * are permitted provided that the following conditions are met:
DL3LD 1:1556bcaaf759 16 * 1. Redistributions of source code must retain the above copyright notice,
DL3LD 1:1556bcaaf759 17 * this list of conditions and the following disclaimer.
DL3LD 1:1556bcaaf759 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
DL3LD 1:1556bcaaf759 19 * this list of conditions and the following disclaimer in the documentation
DL3LD 1:1556bcaaf759 20 * and/or other materials provided with the distribution.
DL3LD 1:1556bcaaf759 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
DL3LD 1:1556bcaaf759 22 * may be used to endorse or promote products derived from this software
DL3LD 1:1556bcaaf759 23 * without specific prior written permission.
DL3LD 1:1556bcaaf759 24 *
DL3LD 1:1556bcaaf759 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
DL3LD 1:1556bcaaf759 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
DL3LD 1:1556bcaaf759 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DL3LD 1:1556bcaaf759 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
DL3LD 1:1556bcaaf759 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DL3LD 1:1556bcaaf759 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
DL3LD 1:1556bcaaf759 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
DL3LD 1:1556bcaaf759 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
DL3LD 1:1556bcaaf759 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
DL3LD 1:1556bcaaf759 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
DL3LD 1:1556bcaaf759 35 *
DL3LD 1:1556bcaaf759 36 ******************************************************************************
DL3LD 1:1556bcaaf759 37 */
DL3LD 1:1556bcaaf759 38
DL3LD 1:1556bcaaf759 39 /* Define to prevent recursive inclusion -------------------------------------*/
DL3LD 1:1556bcaaf759 40 #ifndef __STM32746G_DISCOVERY_LCD_H
DL3LD 1:1556bcaaf759 41 #define __STM32746G_DISCOVERY_LCD_H
DL3LD 1:1556bcaaf759 42
DL3LD 1:1556bcaaf759 43 #ifdef __cplusplus
DL3LD 1:1556bcaaf759 44 extern "C" {
DL3LD 1:1556bcaaf759 45 #endif
DL3LD 1:1556bcaaf759 46
DL3LD 1:1556bcaaf759 47 /* Includes ------------------------------------------------------------------*/
DL3LD 1:1556bcaaf759 48 /* Include LCD component Driver */
DL3LD 1:1556bcaaf759 49 /* LCD RK043FN48H-CT672B 4,3" 480x272 pixels */
DL3LD 1:1556bcaaf759 50 #include "rk043fn48h.h"
DL3LD 1:1556bcaaf759 51
DL3LD 1:1556bcaaf759 52 /* Include SDRAM Driver */
DL3LD 1:1556bcaaf759 53 #include "stm32746g_discovery_sdram.h"
DL3LD 1:1556bcaaf759 54
DL3LD 1:1556bcaaf759 55 #include "stm32746g_discovery.h"
DL3LD 1:1556bcaaf759 56 #include "fonts.h"
DL3LD 1:1556bcaaf759 57
DL3LD 1:1556bcaaf759 58 /** @addtogroup BSP
DL3LD 1:1556bcaaf759 59 * @{
DL3LD 1:1556bcaaf759 60 */
DL3LD 1:1556bcaaf759 61
DL3LD 1:1556bcaaf759 62 /** @addtogroup STM32746G_DISCOVERY
DL3LD 1:1556bcaaf759 63 * @{
DL3LD 1:1556bcaaf759 64 */
DL3LD 1:1556bcaaf759 65
DL3LD 1:1556bcaaf759 66 /** @addtogroup STM32746G_DISCOVERY_LCD
DL3LD 1:1556bcaaf759 67 * @{
DL3LD 1:1556bcaaf759 68 */
DL3LD 1:1556bcaaf759 69
DL3LD 1:1556bcaaf759 70 /** @defgroup STM32746G_DISCOVERY_LCD_Exported_Types STM32746G_DISCOVERY_LCD Exported Types
DL3LD 1:1556bcaaf759 71 * @{
DL3LD 1:1556bcaaf759 72 */
DL3LD 1:1556bcaaf759 73 typedef struct
DL3LD 1:1556bcaaf759 74 {
DL3LD 1:1556bcaaf759 75 uint32_t TextColor;
DL3LD 1:1556bcaaf759 76 uint32_t BackColor;
DL3LD 1:1556bcaaf759 77 sFONT *pFont;
DL3LD 1:1556bcaaf759 78 }LCD_DrawPropTypeDef;
DL3LD 1:1556bcaaf759 79
DL3LD 1:1556bcaaf759 80 typedef struct
DL3LD 1:1556bcaaf759 81 {
DL3LD 1:1556bcaaf759 82 int16_t X;
DL3LD 1:1556bcaaf759 83 int16_t Y;
DL3LD 1:1556bcaaf759 84 }Point, * pPoint;
DL3LD 1:1556bcaaf759 85
DL3LD 1:1556bcaaf759 86 /**
DL3LD 1:1556bcaaf759 87 * @brief Line mode structures definition
DL3LD 1:1556bcaaf759 88 */
DL3LD 1:1556bcaaf759 89 typedef enum
DL3LD 1:1556bcaaf759 90 {
DL3LD 1:1556bcaaf759 91 CENTER_MODE = 0x01, /* Center mode */
DL3LD 1:1556bcaaf759 92 RIGHT_MODE = 0x02, /* Right mode */
DL3LD 1:1556bcaaf759 93 LEFT_MODE = 0x03 /* Left mode */
DL3LD 1:1556bcaaf759 94 }Text_AlignModeTypdef;
DL3LD 1:1556bcaaf759 95
DL3LD 1:1556bcaaf759 96 /**
DL3LD 1:1556bcaaf759 97 * @}
DL3LD 1:1556bcaaf759 98 */
DL3LD 1:1556bcaaf759 99
DL3LD 1:1556bcaaf759 100 /** @defgroup STM32746G_DISCOVERY_LCD_Exported_Constants STM32746G_DISCOVERY_LCD Exported Constants
DL3LD 1:1556bcaaf759 101 * @{
DL3LD 1:1556bcaaf759 102 */
DL3LD 1:1556bcaaf759 103 #define MAX_LAYER_NUMBER ((uint32_t)2)
DL3LD 1:1556bcaaf759 104
DL3LD 1:1556bcaaf759 105 #define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef
DL3LD 1:1556bcaaf759 106
DL3LD 1:1556bcaaf759 107 #define LTDC_ACTIVE_LAYER ((uint32_t)1) /* Layer 1 */
DL3LD 1:1556bcaaf759 108 /**
DL3LD 1:1556bcaaf759 109 * @brief LCD status structure definition
DL3LD 1:1556bcaaf759 110 */
DL3LD 1:1556bcaaf759 111 #define LCD_OK ((uint8_t)0x00)
DL3LD 1:1556bcaaf759 112 #define LCD_ERROR ((uint8_t)0x01)
DL3LD 1:1556bcaaf759 113 #define LCD_TIMEOUT ((uint8_t)0x02)
DL3LD 1:1556bcaaf759 114
DL3LD 1:1556bcaaf759 115 /**
DL3LD 1:1556bcaaf759 116 * @brief LCD FB_StartAddress
DL3LD 1:1556bcaaf759 117 */
DL3LD 1:1556bcaaf759 118 #define LCD_FB_START_ADDRESS ((uint32_t)0xC0000000)
DL3LD 1:1556bcaaf759 119
DL3LD 1:1556bcaaf759 120 /**
DL3LD 1:1556bcaaf759 121 * @brief LCD color
DL3LD 1:1556bcaaf759 122 */
DL3LD 1:1556bcaaf759 123 #define LCD_COLOR_BLUE ((uint32_t)0xFF0000FF)
DL3LD 1:1556bcaaf759 124 #define LCD_COLOR_GREEN ((uint32_t)0xFF00FF00)
DL3LD 1:1556bcaaf759 125 #define LCD_COLOR_RED ((uint32_t)0xFFFF0000)
DL3LD 1:1556bcaaf759 126 #define LCD_COLOR_CYAN ((uint32_t)0xFF00FFFF)
DL3LD 1:1556bcaaf759 127 #define LCD_COLOR_MAGENTA ((uint32_t)0xFFFF00FF)
DL3LD 1:1556bcaaf759 128 #define LCD_COLOR_YELLOW ((uint32_t)0xFFFFFF00)
DL3LD 1:1556bcaaf759 129 #define LCD_COLOR_LIGHTBLUE ((uint32_t)0xFF8080FF)
DL3LD 1:1556bcaaf759 130 #define LCD_COLOR_LIGHTGREEN ((uint32_t)0xFF80FF80)
DL3LD 1:1556bcaaf759 131 #define LCD_COLOR_LIGHTRED ((uint32_t)0xFFFF8080)
DL3LD 1:1556bcaaf759 132 #define LCD_COLOR_LIGHTCYAN ((uint32_t)0xFF80FFFF)
DL3LD 1:1556bcaaf759 133 #define LCD_COLOR_LIGHTMAGENTA ((uint32_t)0xFFFF80FF)
DL3LD 1:1556bcaaf759 134 #define LCD_COLOR_LIGHTYELLOW ((uint32_t)0xFFFFFF80)
DL3LD 1:1556bcaaf759 135 #define LCD_COLOR_DARKBLUE ((uint32_t)0xFF000080)
DL3LD 1:1556bcaaf759 136 #define LCD_COLOR_DARKGREEN ((uint32_t)0xFF008000)
DL3LD 1:1556bcaaf759 137 #define LCD_COLOR_DARKRED ((uint32_t)0xFF800000)
DL3LD 1:1556bcaaf759 138 #define LCD_COLOR_DARKCYAN ((uint32_t)0xFF008080)
DL3LD 1:1556bcaaf759 139 #define LCD_COLOR_DARKMAGENTA ((uint32_t)0xFF800080)
DL3LD 1:1556bcaaf759 140 #define LCD_COLOR_DARKYELLOW ((uint32_t)0xFF808000)
DL3LD 1:1556bcaaf759 141 #define LCD_COLOR_WHITE ((uint32_t)0xFFFFFFFF)
DL3LD 1:1556bcaaf759 142 #define LCD_COLOR_LIGHTGRAY ((uint32_t)0xFFD3D3D3)
DL3LD 1:1556bcaaf759 143 #define LCD_COLOR_GRAY ((uint32_t)0xFF808080)
DL3LD 1:1556bcaaf759 144 #define LCD_COLOR_DARKGRAY ((uint32_t)0xFF404040)
DL3LD 1:1556bcaaf759 145 #define LCD_COLOR_BLACK ((uint32_t)0xFF000000)
DL3LD 1:1556bcaaf759 146 #define LCD_COLOR_BROWN ((uint32_t)0xFFA52A2A)
DL3LD 1:1556bcaaf759 147 #define LCD_COLOR_ORANGE ((uint32_t)0xFFFFA500)
DL3LD 1:1556bcaaf759 148 #define LCD_COLOR_TRANSPARENT ((uint32_t)0xFF000000)
DL3LD 1:1556bcaaf759 149
DL3LD 1:1556bcaaf759 150 /**
DL3LD 1:1556bcaaf759 151 * @brief LCD default font
DL3LD 1:1556bcaaf759 152 */
DL3LD 1:1556bcaaf759 153 #define LCD_DEFAULT_FONT Font24
DL3LD 1:1556bcaaf759 154
DL3LD 1:1556bcaaf759 155 /**
DL3LD 1:1556bcaaf759 156 * @brief LCD special pins
DL3LD 1:1556bcaaf759 157 */
DL3LD 1:1556bcaaf759 158 /* Display enable pin */
DL3LD 1:1556bcaaf759 159 #define LCD_DISP_PIN GPIO_PIN_12
DL3LD 1:1556bcaaf759 160 #define LCD_DISP_GPIO_PORT GPIOI
DL3LD 1:1556bcaaf759 161 #define LCD_DISP_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
DL3LD 1:1556bcaaf759 162 #define LCD_DISP_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
DL3LD 1:1556bcaaf759 163
DL3LD 1:1556bcaaf759 164 /* Backlight control pin */
DL3LD 1:1556bcaaf759 165 #define LCD_BL_CTRL_PIN GPIO_PIN_3
DL3LD 1:1556bcaaf759 166 #define LCD_BL_CTRL_GPIO_PORT GPIOK
DL3LD 1:1556bcaaf759 167 #define LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
DL3LD 1:1556bcaaf759 168 #define LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
DL3LD 1:1556bcaaf759 169
DL3LD 1:1556bcaaf759 170 /**
DL3LD 1:1556bcaaf759 171 * @}
DL3LD 1:1556bcaaf759 172 */
DL3LD 1:1556bcaaf759 173
DL3LD 1:1556bcaaf759 174 /** @addtogroup STM32746G_DISCOVERY_LCD_Exported_Functions
DL3LD 1:1556bcaaf759 175 * @{
DL3LD 1:1556bcaaf759 176 */
DL3LD 1:1556bcaaf759 177 uint8_t BSP_LCD_Init(void);
DL3LD 1:1556bcaaf759 178 uint8_t BSP_LCD_DeInit(void);
DL3LD 1:1556bcaaf759 179 uint32_t BSP_LCD_GetXSize(void);
DL3LD 1:1556bcaaf759 180 uint32_t BSP_LCD_GetYSize(void);
DL3LD 1:1556bcaaf759 181 void BSP_LCD_SetXSize(uint32_t imageWidthPixels);
DL3LD 1:1556bcaaf759 182 void BSP_LCD_SetYSize(uint32_t imageHeightPixels);
DL3LD 1:1556bcaaf759 183
DL3LD 1:1556bcaaf759 184 /* Functions using the LTDC controller */
DL3LD 1:1556bcaaf759 185 void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FrameBuffer);
DL3LD 1:1556bcaaf759 186 void BSP_LCD_LayerRgb565Init(uint16_t LayerIndex, uint32_t FB_Address);
DL3LD 1:1556bcaaf759 187 void BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency);
DL3LD 1:1556bcaaf759 188 void BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address);
DL3LD 1:1556bcaaf759 189 void BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue);
DL3LD 1:1556bcaaf759 190 void BSP_LCD_ResetColorKeying(uint32_t LayerIndex);
DL3LD 1:1556bcaaf759 191 void BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
DL3LD 1:1556bcaaf759 192
DL3LD 1:1556bcaaf759 193 void BSP_LCD_SelectLayer(uint32_t LayerIndex);
DL3LD 1:1556bcaaf759 194 void BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State);
DL3LD 1:1556bcaaf759 195
DL3LD 1:1556bcaaf759 196 void BSP_LCD_SetTextColor(uint32_t Color);
DL3LD 1:1556bcaaf759 197 uint32_t BSP_LCD_GetTextColor(void);
DL3LD 1:1556bcaaf759 198 void BSP_LCD_SetBackColor(uint32_t Color);
DL3LD 1:1556bcaaf759 199 uint32_t BSP_LCD_GetBackColor(void);
DL3LD 1:1556bcaaf759 200 void BSP_LCD_SetFont(sFONT *fonts);
DL3LD 1:1556bcaaf759 201 sFONT *BSP_LCD_GetFont(void);
DL3LD 1:1556bcaaf759 202
DL3LD 1:1556bcaaf759 203 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
DL3LD 1:1556bcaaf759 204 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel);
DL3LD 1:1556bcaaf759 205 void BSP_LCD_Clear(uint32_t Color);
DL3LD 1:1556bcaaf759 206 void BSP_LCD_ClearStringLine(uint32_t Line);
DL3LD 1:1556bcaaf759 207 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
DL3LD 1:1556bcaaf759 208 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode);
DL3LD 1:1556bcaaf759 209 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
DL3LD 1:1556bcaaf759 210
DL3LD 1:1556bcaaf759 211 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
DL3LD 1:1556bcaaf759 212 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
DL3LD 1:1556bcaaf759 213 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
DL3LD 1:1556bcaaf759 214 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
DL3LD 1:1556bcaaf759 215 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
DL3LD 1:1556bcaaf759 216 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
DL3LD 1:1556bcaaf759 217 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
DL3LD 1:1556bcaaf759 218 void BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp);
DL3LD 1:1556bcaaf759 219
DL3LD 1:1556bcaaf759 220 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
DL3LD 1:1556bcaaf759 221 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
DL3LD 1:1556bcaaf759 222 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
DL3LD 1:1556bcaaf759 223 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
DL3LD 1:1556bcaaf759 224
DL3LD 1:1556bcaaf759 225 void BSP_LCD_DisplayOff(void);
DL3LD 1:1556bcaaf759 226 void BSP_LCD_DisplayOn(void);
DL3LD 1:1556bcaaf759 227
DL3LD 1:1556bcaaf759 228 /* These functions can be modified in case the current settings
DL3LD 1:1556bcaaf759 229 need to be changed for specific application needs */
DL3LD 1:1556bcaaf759 230 void BSP_LCD_MspInit(LTDC_HandleTypeDef *hltdc, void *Params);
DL3LD 1:1556bcaaf759 231 void BSP_LCD_MspDeInit(LTDC_HandleTypeDef *hltdc, void *Params);
DL3LD 1:1556bcaaf759 232 void BSP_LCD_ClockConfig(LTDC_HandleTypeDef *hltdc, void *Params);
DL3LD 1:1556bcaaf759 233
DL3LD 1:1556bcaaf759 234 /**
DL3LD 1:1556bcaaf759 235 * @}
DL3LD 1:1556bcaaf759 236 */
DL3LD 1:1556bcaaf759 237
DL3LD 1:1556bcaaf759 238 /**
DL3LD 1:1556bcaaf759 239 * @}
DL3LD 1:1556bcaaf759 240 */
DL3LD 1:1556bcaaf759 241
DL3LD 1:1556bcaaf759 242 /**
DL3LD 1:1556bcaaf759 243 * @}
DL3LD 1:1556bcaaf759 244 */
DL3LD 1:1556bcaaf759 245
DL3LD 1:1556bcaaf759 246 /**
DL3LD 1:1556bcaaf759 247 * @}
DL3LD 1:1556bcaaf759 248 */
DL3LD 1:1556bcaaf759 249
DL3LD 1:1556bcaaf759 250 #ifdef __cplusplus
DL3LD 1:1556bcaaf759 251 }
DL3LD 1:1556bcaaf759 252 #endif
DL3LD 1:1556bcaaf759 253
DL3LD 1:1556bcaaf759 254 #endif /* __STM32746G_DISCOVERY_LCD_H */
DL3LD 1:1556bcaaf759 255
DL3LD 1:1556bcaaf759 256 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
DL3LD 1:1556bcaaf759 257