亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stm32l1xx_lcd.c

?? VS1003_MP3_SPI_SDHC_FAT32
?? C
?? 第 1 頁 / 共 2 頁
字號:
/**
  ******************************************************************************
  * @file    stm32l1xx_lcd.c
  * @author  MCD Application Team
  * @version V1.1.0
  * @date    24-January-2012
  * @brief   This file provides firmware functions to manage the following 
  *          functionalities of the LCD controller (LCD) peripheral:
  *           + Initialization and configuration
  *           + LCD RAM memory write
  *           + Interrupts and flags management
  *           
  *  @verbatim
  
 ===============================================================================
                            ##### LCD Clock #####
 ===============================================================================
    [..] LCDCLK is the same as RTCCLK. 
    [..] To configure the RTCCLK/LCDCLK, proceed as follows:
         (+) Enable the Power Controller (PWR) APB1 interface clock using the
             RCC_APB1PeriphClockCmd() function.
         (+) Enable access to RTC domain using the PWR_RTCAccessCmd() function.
         (+) Select the RTC clock source using the RCC_RTCCLKConfig() function.
  
    [..] The frequency generator allows you to achieve various LCD frame rates
         starting from an LCD input clock frequency (LCDCLK) which can vary 
         from 32 kHz up to 1 MHz.
  
                      ##### LCD and low power modes #####
 ===============================================================================
    [..] The LCD still active during STOP mode.
  
                      ##### How to use this driver #####
 ===============================================================================
    [..]
        (#) Enable LCD clock using 
            RCC_APB1PeriphClockCmd(RCC_APB1Periph_LCD, ENABLE) function.
        (#) Configure the LCD prescaler, divider, duty, bias and voltage source
            using LCD_Init() function.
        (#) Optionally you can enable/configure:
            (++) LCD High Drive using the LCD_HighDriveCmd() function.
            (++) LCD COM/SEG Mux using the LCD_MuxSegmentCmd() function.
            (++) LCD Pulse ON Duration using the LCD_PulseOnDurationConfig() function.
            (++) LCD Dead Time using the LCD_DeadTimeConfig() function  
            (++) The LCD Blink mode and frequency using the LCD_BlinkConfig() function.
            (++) The LCD Contrast using the LCD_ContrastConfig() function.
        (#) Call the LCD_WaitForSynchro() function to wait for LCD_FCR register
            synchronization.
        (#) Call the LCD_Cmd() to enable the LCD controller.
        (#) Wait until the LCD Controller status is enabled and the step-up
            converter is ready using the LCD_GetFlagStatus() and
            LCD_FLAG_ENS and LCD_FLAG_RDY flags.
        (#) Write to the LCD RAM memory using the LCD_Write() function.
        (#) Request an update display using the LCD_UpdateDisplayRequest()
            function.
        (#) Wait until the update display is finished by checking the UDD
            flag status using the LCD_GetFlagStatus(LCD_FLAG_UDD).
  
    @endverbatim
  
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * FOR MORE INFORMATION PLEASE READ CAREFULLY THE LICENSE AGREEMENT FILE
  * LOCATED IN THE ROOT DIRECTORY OF THIS FIRMWARE PACKAGE.
  *
  * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2>
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/
#include "stm32l1xx_lcd.h"
#include "stm32l1xx_rcc.h"

/** @addtogroup STM32L1xx_StdPeriph_Driver
  * @{
  */

/** @defgroup LCD 
  * @brief LCD driver modules
  * @{
  */

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* ------------ LCD registers bit address in the alias region --------------- */
#define LCD_OFFSET                   (LCD_BASE - PERIPH_BASE)

/* --- CR Register ---*/

/* Alias word address of LCDEN bit */
#define CR_OFFSET                    (LCD_OFFSET + 0x00)
#define LCDEN_BitNumber              0x00
#define CR_LCDEN_BB                  (PERIPH_BB_BASE + (CR_OFFSET * 32) + (LCDEN_BitNumber * 4))

/* Alias word address of MUX_SEG bit */
#define MUX_SEG_BitNumber            0x07
#define CR_MUX_SEG_BB                (PERIPH_BB_BASE + (CR_OFFSET * 32) + (MUX_SEG_BitNumber * 4))


/* --- FCR Register ---*/

/* Alias word address of HD bit */
#define FCR_OFFSET                   (LCD_OFFSET + 0x04)
#define HD_BitNumber                 0x00
#define FCR_HD_BB                    (PERIPH_BB_BASE + (FCR_OFFSET * 32) + (HD_BitNumber * 4))

/* --- SR Register ---*/

/* Alias word address of UDR bit */
#define SR_OFFSET                    (LCD_OFFSET + 0x08)
#define UDR_BitNumber                0x02
#define SR_UDR_BB                    (PERIPH_BB_BASE + (SR_OFFSET * 32) + (UDR_BitNumber * 4))

#define FCR_MASK                     ((uint32_t)0xFC03FFFF)  /* LCD FCR Mask */
#define CR_MASK                      ((uint32_t)0xFFFFFF81)  /* LCD CR Mask */
#define PON_MASK                     ((uint32_t)0xFFFFFF8F)  /* LCD PON Mask */
#define DEAD_MASK                    ((uint32_t)0xFFFFFC7F)  /* LCD DEAD Mask */
#define BLINK_MASK                   ((uint32_t)0xFFFC1FFF)  /* LCD BLINK Mask */
#define CONTRAST_MASK                ((uint32_t)0xFFFFE3FF)  /* LCD CONTRAST Mask */

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/** @defgroup LCD_Private_Functions
  * @{
  */

/** @defgroup LCD_Group1 Initialization and Configuration functions
 *  @brief   Initialization and Configuration functions 
 *
@verbatim
 ===============================================================================
            ##### Initialization and Configuration functions #####
 ===============================================================================

@endverbatim
  * @{
  */

/**
  * @brief  Deinitializes the LCD peripheral registers to their default reset
  *         values.
  * @param  None
  * @retval None
  */
void LCD_DeInit(void)
{
  /* Enable LCD reset state */
  RCC_APB1PeriphResetCmd(RCC_APB1Periph_LCD, ENABLE);
  /* Release LCD from reset state */
  RCC_APB1PeriphResetCmd(RCC_APB1Periph_LCD, DISABLE);
}

/**
  * @brief  Initializes the LCD peripheral according to the specified parameters
  *         in the LCD_InitStruct.
  * @note   This function can be used only when the LCD is disabled.
  * @param  LCD_InitStruct: pointer to a LCD_InitTypeDef structure that contains
  *         the configuration information for the specified LCD peripheral.
  * @retval None
  */
void LCD_Init(LCD_InitTypeDef* LCD_InitStruct)
{
  /* Check function parameters */
  assert_param(IS_LCD_PRESCALER(LCD_InitStruct->LCD_Prescaler));
  assert_param(IS_LCD_DIVIDER(LCD_InitStruct->LCD_Divider));
  assert_param(IS_LCD_DUTY(LCD_InitStruct->LCD_Duty));
  assert_param(IS_LCD_BIAS(LCD_InitStruct->LCD_Bias));
  assert_param(IS_LCD_VOLTAGE_SOURCE(LCD_InitStruct->LCD_VoltageSource));

  LCD->FCR &= (uint32_t)FCR_MASK;
  LCD->FCR |= (uint32_t)(LCD_InitStruct->LCD_Prescaler | LCD_InitStruct->LCD_Divider);

  LCD_WaitForSynchro();

  LCD->CR &= (uint32_t)CR_MASK;
  LCD->CR |= (uint32_t)(LCD_InitStruct->LCD_Duty | LCD_InitStruct->LCD_Bias | \
                        LCD_InitStruct->LCD_VoltageSource);

}

/**
  * @brief  Fills each LCD_InitStruct member with its default value.
  * @param  LCD_InitStruct: pointer to a LCD_InitTypeDef structure which will
  *         be initialized.
  * @retval None
  */
void LCD_StructInit(LCD_InitTypeDef* LCD_InitStruct)
{
/*--------------- Reset LCD init structure parameters values -----------------*/
  LCD_InitStruct->LCD_Prescaler = LCD_Prescaler_1; /*!< Initialize the LCD_Prescaler member */
  
  LCD_InitStruct->LCD_Divider = LCD_Divider_16; /*!< Initialize the LCD_Divider member */
  
  LCD_InitStruct->LCD_Duty = LCD_Duty_Static; /*!< Initialize the LCD_Duty member */
  
  LCD_InitStruct->LCD_Bias = LCD_Bias_1_4; /*!< Initialize the LCD_Bias member */
  
  LCD_InitStruct->LCD_VoltageSource = LCD_VoltageSource_Internal; /*!< Initialize the LCD_VoltageSource member */
}

/**
  * @brief  Enables or disables the LCD Controller.
  * @param  NewState: new state of the LCD peripheral.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void LCD_Cmd(FunctionalState NewState)
{
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  *(__IO uint32_t *) CR_LCDEN_BB = (uint32_t)NewState;
}

/**
  * @brief  Waits until the LCD FCR register is synchronized in the LCDCLK domain.
  *   This function must be called after any write operation to LCD_FCR register.
  * @param  None
  * @retval None
  */
void LCD_WaitForSynchro(void)
{
  /* Loop until FCRSF flag is set */
  while ((LCD->SR & LCD_FLAG_FCRSF) == (uint32_t)RESET)
  {
  }
}

/**
  * @brief  Enables or disables the low resistance divider. Displays with high
  *         internal resistance may need a longer drive time to achieve
  *         satisfactory contrast. This function is useful in this case if some
  *         additional power consumption can be tolerated.
  * @note   When this mode is enabled, the PulseOn Duration (PON) have to be 
  *         programmed to 1/CK_PS (LCD_PulseOnDuration_1).
  * @param  NewState: new state of the low resistance divider.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void LCD_HighDriveCmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  *(__IO uint32_t *) FCR_HD_BB = (uint32_t)NewState;
}

/**
  * @brief  Enables or disables the Mux Segment.
  * @note   This function can be used only when the LCD is disabled.
  * @param  NewState: new state of the Mux Segment.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void LCD_MuxSegmentCmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  *(__IO uint32_t *) CR_MUX_SEG_BB = (uint32_t)NewState;
}

/**
  * @brief  Configures the LCD pulses on duration.
  * @param  LCD_PulseOnDuration: specifies the LCD pulse on duration in terms of
  *         CK_PS (prescaled LCD clock period) pulses.
  *   This parameter can be one of the following values:
  *     @arg LCD_PulseOnDuration_0: 0 pulse
  *     @arg LCD_PulseOnDuration_1: Pulse ON duration = 1/CK_PS
  *     @arg LCD_PulseOnDuration_2: Pulse ON duration = 2/CK_PS
  *     @arg LCD_PulseOnDuration_3: Pulse ON duration = 3/CK_PS
  *     @arg LCD_PulseOnDuration_4: Pulse ON duration = 4/CK_PS
  *     @arg LCD_PulseOnDuration_5: Pulse ON duration = 5/CK_PS
  *     @arg LCD_PulseOnDuration_6: Pulse ON duration = 6/CK_PS
  *     @arg LCD_PulseOnDuration_7: Pulse ON duration = 7/CK_PS
  * @retval None
  */
void LCD_PulseOnDurationConfig(uint32_t LCD_PulseOnDuration)
{
  /* Check the parameters */
  assert_param(IS_LCD_PULSE_ON_DURATION(LCD_PulseOnDuration));

  LCD->FCR &= (uint32_t)PON_MASK;
  LCD->FCR |= (uint32_t)(LCD_PulseOnDuration);
}

/**
  * @brief  Configures the LCD dead time.
  * @param  LCD_DeadTime: specifies the LCD dead time.
  *   This parameter can be one of the following values:
  *     @arg LCD_DeadTime_0: No dead Time
  *     @arg LCD_DeadTime_1: One Phase between different couple of Frame
  *     @arg LCD_DeadTime_2: Two Phase between different couple of Frame
  *     @arg LCD_DeadTime_3: Three Phase between different couple of Frame
  *     @arg LCD_DeadTime_4: Four Phase between different couple of Frame
  *     @arg LCD_DeadTime_5: Five Phase between different couple of Frame
  *     @arg LCD_DeadTime_6: Six Phase between different couple of Frame 
  *     @arg LCD_DeadTime_7: Seven Phase between different couple of Frame
  * @retval None
  */
void LCD_DeadTimeConfig(uint32_t LCD_DeadTime)
{
  /* Check the parameters */
  assert_param(IS_LCD_DEAD_TIME(LCD_DeadTime));

  LCD->FCR &= (uint32_t)DEAD_MASK;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产69精品一区二区亚洲孕妇| 狠狠色狠狠色综合| 粉嫩一区二区三区在线看| 欧美又粗又大又爽| 国产日韩欧美综合在线| 亚洲sss视频在线视频| 成人美女在线视频| 精品人在线二区三区| 亚洲一区二区三区四区的 | 精品福利一二区| 亚洲va欧美va人人爽午夜| 99热精品国产| 国产亚洲一区二区三区在线观看| 天堂资源在线中文精品| 91视频.com| 国产精品久久久久久久久动漫| 激情综合色播五月| 欧美一区二区在线看| 亚洲精品伦理在线| 成人国产在线观看| 久久精品亚洲精品国产欧美| 裸体健美xxxx欧美裸体表演| 精品视频一区三区九区| 亚洲精品大片www| av成人老司机| 国产精品乱码人人做人人爱| 国产精品自拍在线| 亚洲精品一区二区三区蜜桃下载 | 国产精品色一区二区三区| 国产资源精品在线观看| 日韩三级av在线播放| 日本不卡一二三区黄网| 欧美久久一区二区| 亚洲1区2区3区视频| 欧美四级电影网| 亚洲午夜一二三区视频| 在线免费亚洲电影| 伊人色综合久久天天人手人婷| 91麻豆精品秘密| 日韩一区欧美一区| 色偷偷成人一区二区三区91| 国产精品久久久久久久久免费相片 | 中文一区二区在线观看| 国产高清视频一区| 国产精品丝袜久久久久久app| 国产成人午夜电影网| 亚洲国产电影在线观看| 成人国产精品免费网站| 亚洲天堂2014| 在线看不卡av| 午夜欧美电影在线观看| 欧美美女直播网站| 免费成人小视频| 26uuu亚洲综合色| 丁香婷婷综合五月| 亚洲色图.com| 精品视频一区 二区 三区| 婷婷久久综合九色综合绿巨人| 91精品国产色综合久久不卡电影 | 日本欧美久久久久免费播放网| 欧美一区二区三区视频免费 | 亚洲三级理论片| av一区二区三区四区| 久久成人久久鬼色| 在线视频一区二区三| 首页欧美精品中文字幕| 欧美tickling挠脚心丨vk| 国产精品一区三区| 国产精品日日摸夜夜摸av| 色综合色狠狠综合色| 日日夜夜一区二区| www亚洲一区| 91亚洲精品久久久蜜桃网站 | 欧美一级二级在线观看| 国产一区二区三区| 亚洲日本在线a| 欧美日韩dvd在线观看| 久久99国产精品免费| 国产精品网站在线| 欧美日韩视频在线观看一区二区三区| 日韩精品成人一区二区在线| 国产日韩欧美亚洲| 91福利在线观看| 久久99久久99| 亚洲免费成人av| 日韩女同互慰一区二区| 99国产精品国产精品毛片| 亚洲成人精品一区| 国产亚洲欧美日韩日本| 色噜噜久久综合| 久久66热re国产| 尤物在线观看一区| 精品国产露脸精彩对白| 色天使色偷偷av一区二区 | 最新高清无码专区| 91精品中文字幕一区二区三区| 久久精品久久99精品久久| 亚洲人成小说网站色在线| 欧美一区二区三区在线观看视频 | 青青国产91久久久久久| 国产精品―色哟哟| 日韩小视频在线观看专区| 99在线视频精品| 精品一区二区三区久久| 一区二区欧美国产| 久久精品人人做人人爽人人| 欧美日韩一区三区| 成人黄色大片在线观看| 久久成人精品无人区| 一二三四区精品视频| 中文乱码免费一区二区| 日韩三级在线观看| 欧美天堂亚洲电影院在线播放| 成人中文字幕在线| 麻豆传媒一区二区三区| 亚洲宅男天堂在线观看无病毒| 久久久精品国产99久久精品芒果 | 丁香六月久久综合狠狠色| 日本中文字幕一区| 一区二区三区日韩欧美精品| 日本一区二区免费在线观看视频 | 91蜜桃网址入口| 国产一区二区福利视频| 日本91福利区| 亚洲国产欧美日韩另类综合| 国产精品对白交换视频| 久久精品亚洲一区二区三区浴池| 欧美精品18+| 91福利视频在线| 91在线播放网址| 成人听书哪个软件好| 国产一区二区调教| 久久激情综合网| 日本va欧美va瓶| 五月天网站亚洲| 亚洲福利一区二区三区| 亚洲欧美日韩人成在线播放| 国产欧美日韩不卡免费| 久久久噜噜噜久久人人看| 日韩欧美一级片| 日韩色在线观看| 欧美一区二区三区四区五区 | 成人av网站在线观看免费| 国产一区二区导航在线播放| 久久精品国产在热久久| 免费在线观看一区二区三区| 日韩精品一级二级| 日韩精品午夜视频| 亚洲成av人片一区二区梦乃| 亚洲一区欧美一区| 亚洲永久免费av| 亚洲第一搞黄网站| 午夜视频在线观看一区二区| 亚洲成av人在线观看| 午夜成人免费视频| 青青国产91久久久久久| 蜜桃av噜噜一区二区三区小说| 免费成人结看片| 激情欧美一区二区| 国产一区二区调教| 国产成人综合精品三级| 成人性色生活片免费看爆迷你毛片| 国产精品一级在线| 成人丝袜18视频在线观看| 成年人网站91| 色www精品视频在线观看| 欧美在线不卡视频| 555夜色666亚洲国产免| 欧美一区二区精美| 精品少妇一区二区三区在线播放| 欧美www视频| 久久精品一区二区三区av| 国产精品沙发午睡系列990531| 中文字幕亚洲不卡| 亚洲国产精品影院| 免费精品视频在线| 国产在线精品免费av| 粉嫩av亚洲一区二区图片| 99国产精品久| 欧美猛男超大videosgay| 日韩三级精品电影久久久| 久久久精品中文字幕麻豆发布| 国产精品久久久久桃色tv| 亚洲综合精品久久| 另类成人小视频在线| 国产乱码精品一区二区三区av | 国产精品亚洲人在线观看| 99久久婷婷国产| 欧美三级乱人伦电影| 欧美大片在线观看| 中文字幕一区在线| 丝袜亚洲另类丝袜在线| 国产在线精品一区二区夜色| 成人av在线播放网址| 欧美日韩一级二级三级| 久久一区二区三区国产精品| 亚洲欧洲日本在线| 日韩成人午夜精品| 成人黄色综合网站| 欧美在线播放高清精品|