⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stm8l15x_lcd.h

📁 STM8L的tim4定时器使用
💻 H
📖 第 1 页 / 共 2 页
字号:
    ((DURATION) == LCD_PulseOnDuration_6) || \
    ((DURATION) == LCD_PulseOnDuration_7))
    
/**
  * @}
  */
  
/** @defgroup LCD_Dead_Time
  * @brief element values correspond to the bits position
  * @{
  */
typedef enum {
  LCD_DeadTime_0 = (uint8_t)0x00, /*!< No dead Time  */
  LCD_DeadTime_1 = (uint8_t)0x01, /*!< One Phase between different couple of Frame   */
  LCD_DeadTime_2 = (uint8_t)0x02, /*!< Two Phase between different couple of Frame   */
  LCD_DeadTime_3 = (uint8_t)0x03, /*!< Tree Phase between different couple of Frame  */
  LCD_DeadTime_4 = (uint8_t)0x04, /*!< Four Phase between different couple of Frame  */
  LCD_DeadTime_5 = (uint8_t)0x05, /*!< Five Phase between different couple of Frame  */
  LCD_DeadTime_6 = (uint8_t)0x06, /*!< Six Phase between different couple of Frame   */
  LCD_DeadTime_7 = (uint8_t)0x07  /*!< Seven Phase between different couple of Frame */
} LCD_DeadTime_TypeDef;

#define IS_LCD_DEAD_TIME(TIME) (((TIME) == LCD_DeadTime_0) || \
                                ((TIME) == LCD_DeadTime_1) || \
                                ((TIME) == LCD_DeadTime_2) || \
                                ((TIME) == LCD_DeadTime_3) || \
                                ((TIME) == LCD_DeadTime_4) || \
                                ((TIME) == LCD_DeadTime_5) || \
                                ((TIME) == LCD_DeadTime_6) || \
                                ((TIME) == LCD_DeadTime_7))
                                
/**
  * @}
  */
  
/** @defgroup LCD_BlinkMode 
  * @{
  */
typedef enum {
  LCD_BlinkMode_Off           = (uint8_t)0x00, /*!< Blink inactive            */
  LCD_BlinkMode_SEG0_COM0     = (uint8_t)0x40, /*!< SEG0 on COM0 blink        */
  LCD_BlinkMode_SEG0_AllCOM   = (uint8_t)0x80, /*!< SEG0 on All COM blink     */
  LCD_BlinkMode_AllSEG_AllCOM = (uint8_t)0xC0  /*!< All SEG on All COm Blink  */
} LCD_BlinkMode_TypeDef;

#define IS_LCD_BLINK_MODE(BLINK) (((BLINK) == LCD_BlinkMode_Off) || \
                                  ((BLINK) == LCD_BlinkMode_SEG0_COM0) || \
                                  ((BLINK) == LCD_BlinkMode_SEG0_AllCOM) || \
                                  ((BLINK) == LCD_BlinkMode_AllSEG_AllCOM))
                                  
/**
  * @}
  */
  
/** @defgroup LCD_Blink_Frequency
  * @brief element values correspond to the bits position
  * @{
  */
typedef enum {
  LCD_BlinkFrequency_Div8    = (uint8_t)0x00, /*!< The Blink frequency = fLcd/8    */
  LCD_BlinkFrequency_Div16   = (uint8_t)0x08, /*!< The Blink frequency = fLcd/16   */
  LCD_BlinkFrequency_Div32   = (uint8_t)0x10, /*!< The Blink frequency = fLcd/32   */
  LCD_BlinkFrequency_Div64   = (uint8_t)0x18, /*!< The Blink frequency = fLcd/64   */
  LCD_BlinkFrequency_Div128  = (uint8_t)0x20, /*!< The Blink frequency = fLcd/128  */
  LCD_BlinkFrequency_Div256  = (uint8_t)0x28, /*!< The Blink frequency = fLcd/256  */
  LCD_BlinkFrequency_Div512  = (uint8_t)0x30, /*!< The Blink frequency = fLcd/512  */
  LCD_BlinkFrequency_Div1024 = (uint8_t)0x38  /*!< The Blink frequency = fLcd/1024 */
} LCD_BlinkFrequency_TypeDef;

#define IS_LCD_BLINK_FREQUENCY(BLINKF) (((BLINKF) == LCD_BlinkFrequency_Div8) || \
                                        ((BLINKF) == LCD_BlinkFrequency_Div16) || \
                                        ((BLINKF) == LCD_BlinkFrequency_Div32) || \
                                        ((BLINKF) == LCD_BlinkFrequency_Div64) || \
                                        ((BLINKF) == LCD_BlinkFrequency_Div128) || \
                                        ((BLINKF) == LCD_BlinkFrequency_Div256) || \
                                        ((BLINKF) == LCD_BlinkFrequency_Div512) || \
                                        ((BLINKF) == LCD_BlinkFrequency_Div1024))
/**
  * @}
  */
  
/** @defgroup LCD_RAMRegister 
  * @{
  */
typedef enum {
  LCD_RAMRegister_0   = (uint8_t)0x00,  /*!< RAM Register 0  */
  LCD_RAMRegister_1   = (uint8_t)0x01,  /*!< RAM Register 1  */
  LCD_RAMRegister_2   = (uint8_t)0x02,  /*!< RAM Register 2  */
  LCD_RAMRegister_3   = (uint8_t)0x03,  /*!< RAM Register 3  */
  LCD_RAMRegister_4   = (uint8_t)0x04,  /*!< RAM Register 4  */
  LCD_RAMRegister_5   = (uint8_t)0x05,  /*!< RAM Register 5  */
  LCD_RAMRegister_6   = (uint8_t)0x06,  /*!< RAM Register 6  */
  LCD_RAMRegister_7   = (uint8_t)0x07,  /*!< RAM Register 7  */
  LCD_RAMRegister_8   = (uint8_t)0x08,  /*!< RAM Register 8  */
  LCD_RAMRegister_9   = (uint8_t)0x09,  /*!< RAM Register 9  */
  LCD_RAMRegister_10  = (uint8_t)0x0A,  /*!< RAM Register 10 */
  LCD_RAMRegister_11  = (uint8_t)0x0B,  /*!< RAM Register 11 */
  LCD_RAMRegister_12  = (uint8_t)0x0C,  /*!< RAM Register 12 */
  LCD_RAMRegister_13  = (uint8_t)0x0D,  /*!< RAM Register 13 */
  LCD_RAMRegister_14  = (uint8_t)0x0E,  /*!< RAM Register 14 */
  LCD_RAMRegister_15  = (uint8_t)0x0F,  /*!< RAM Register 15 */
  LCD_RAMRegister_16  = (uint8_t)0x10,  /*!< RAM Register 16 */
  LCD_RAMRegister_17  = (uint8_t)0x11,  /*!< RAM Register 17 */
  LCD_RAMRegister_18  = (uint8_t)0x12,  /*!< RAM Register 18 */
  LCD_RAMRegister_19  = (uint8_t)0x13,  /*!< RAM Register 19 */
  LCD_RAMRegister_20  = (uint8_t)0x14,  /*!< RAM Register 20 */
  LCD_RAMRegister_21  = (uint8_t)0x15   /*!< RAM Register 21 */
} LCD_RAMRegister_TypeDef;

#define IS_LCD_RAM_REGISTER(REGISTER) (((REGISTER) == LCD_RAMRegister_0) || \
                                       ((REGISTER) == LCD_RAMRegister_1) || \
                                       ((REGISTER) == LCD_RAMRegister_2) || \
                                       ((REGISTER) == LCD_RAMRegister_3) || \
                                       ((REGISTER) == LCD_RAMRegister_4) || \
                                       ((REGISTER) == LCD_RAMRegister_5) || \
                                       ((REGISTER) == LCD_RAMRegister_6) || \
                                       ((REGISTER) == LCD_RAMRegister_7) || \
                                       ((REGISTER) == LCD_RAMRegister_8) || \
                                       ((REGISTER) == LCD_RAMRegister_9) || \
                                       ((REGISTER) == LCD_RAMRegister_10) || \
                                       ((REGISTER) == LCD_RAMRegister_11) || \
                                       ((REGISTER) == LCD_RAMRegister_12) || \
                                       ((REGISTER) == LCD_RAMRegister_13) || \
                                       ((REGISTER) == LCD_RAMRegister_14) || \
                                       ((REGISTER) == LCD_RAMRegister_15) || \
                                       ((REGISTER) == LCD_RAMRegister_16) || \
                                       ((REGISTER) == LCD_RAMRegister_17) || \
                                       ((REGISTER) == LCD_RAMRegister_18) || \
                                       ((REGISTER) == LCD_RAMRegister_19) || \
                                       ((REGISTER) == LCD_RAMRegister_20) || \
                                       ((REGISTER) == LCD_RAMRegister_21))
                                       
/**
  * @}
  */
  
/** @defgroup LCD_Port_Mask_Register
  * @{
  */
typedef enum {
  LCD_PortMaskRegister_0 = (uint8_t)0x00,  /*!< PortMask Register 0  */
  LCD_PortMaskRegister_1 = (uint8_t)0x01,  /*!< PortMask Register 1  */
  LCD_PortMaskRegister_2 = (uint8_t)0x02,  /*!< PortMask Register 2  */
  LCD_PortMaskRegister_3 = (uint8_t)0x03,  /*!< PortMask Register 3  */
  LCD_PortMaskRegister_4 = (uint8_t)0x04,  /*!< PortMask Register 4  */
  LCD_PortMaskRegister_5 = (uint8_t)0x05   /*!< PortMask Register 5  */
} LCD_PortMaskRegister_TypeDef;

#define IS_LCD_PORT_MASK(MASK) (((MASK) == LCD_PortMaskRegister_0) || \
                                ((MASK) == LCD_PortMaskRegister_1) || \
                                ((MASK) == LCD_PortMaskRegister_2) || \
                                ((MASK) == LCD_PortMaskRegister_3) || \
                                ((MASK) == LCD_PortMaskRegister_4) || \
                                ((MASK) == LCD_PortMaskRegister_5))
                                
/**
  * @}
  */
  
/** @defgroup LCD_Page_Selection
  * @{
  */
typedef enum {
  LCD_PageSelection_FirstPage  = (uint8_t)0x00,  /*!< The LCD RAM is selected as the first page  */
  LCD_PageSelection_SecondPage = (uint8_t)0x04   /*!< The LCD RAM is selected as the second page */
} LCD_PageSelection_TypeDef;

#define IS_LCD_PAGE_SELECT(PAGE) (((PAGE) == LCD_PageSelection_FirstPage) || \
                                  ((PAGE) == LCD_PageSelection_SecondPage))
/**
  * @}
  */
  
/**
  * @}
  */

/* Private define ------------------------------------------------------------*/
/* LCD Legacy defines */
/** @defgroup LCD_Private_Define
  * @ brief LCD Legacy defines
  * @{
  */
#define LCD_Contrast_2V6   ((uint8_t)LCD_Contrast_Level_0)
#define LCD_Contrast_2V7   ((uint8_t)LCD_Contrast_Level_1)
#define LCD_Contrast_2V8   ((uint8_t)LCD_Contrast_Level_2)
#define LCD_Contrast_2V9   ((uint8_t)LCD_Contrast_Level_3)
#define LCD_Contrast_3V0   ((uint8_t)LCD_Contrast_Level_4)
#define LCD_Contrast_3V1   ((uint8_t)LCD_Contrast_Level_5)
#define LCD_Contrast_3V2   ((uint8_t)LCD_Contrast_Level_6)
#define LCD_Contrast_3V3   ((uint8_t)LCD_Contrast_Level_7) 
/**
  * @}
  */
/* Private macros ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

/*  Function used to set the LCD configuration to the default reset state *****/
void LCD_DeInit(void);

/* Initialization and Configuration functions *********************************/
void LCD_Init(LCD_Prescaler_TypeDef LCD_Prescaler, LCD_Divider_TypeDef LCD_Divider,
              LCD_Duty_TypeDef LCD_Duty, LCD_Bias_TypeDef LCD_Bias, LCD_VoltageSource_TypeDef LCD_VoltageSource);
void LCD_PortMaskConfig(LCD_PortMaskRegister_TypeDef LCD_PortMaskRegister, uint8_t LCD_Mask);
void LCD_Cmd(FunctionalState NewState);
void LCD_HighDriveCmd(FunctionalState NewState);
void LCD_PulseOnDurationConfig(LCD_PulseOnDuration_TypeDef LCD_PulseOnDuration);
void LCD_DeadTimeConfig(LCD_DeadTime_TypeDef LCD_DeadTime);
void LCD_BlinkConfig(LCD_BlinkMode_TypeDef LCD_BlinkMode, LCD_BlinkFrequency_TypeDef LCD_BlinkFrequency);
void LCD_ContrastConfig(LCD_Contrast_TypeDef LCD_Contrast);

/* LCD RAM memory write functions *********************************************/
void LCD_WriteRAM(LCD_RAMRegister_TypeDef LCD_RAMRegister, uint8_t LCD_Data);
void LCD_PageSelect(LCD_PageSelection_TypeDef LCD_PageSelection);

/* Interrupts and flags management functions **********************************/
void LCD_ITConfig(FunctionalState NewState);
FlagStatus LCD_GetFlagStatus(void);
void LCD_ClearFlag(void);
ITStatus LCD_GetITStatus(void);
void LCD_ClearITPendingBit(void);

#endif /* __STM8L15x_LCD_H */

/**
  * @}
  */

/**
  * @}
  */

/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -