Blame | Last modification | View Log | Download | RSS feed
ifndef __stm8llcdinc ; avoid multiple inclusion__stm8llcdinc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File LCD.INC *;* *;* contains SFR and Bit Definitions for STM8L LCD Controller *;* *;* Source: DocID15226 Rev 14 / RM0031 *;* *;****************************************************************************__deflcd macro Base,NumSegs,NumRAM,HasCR4LCD_CR1 label Base+$00 ; LCD control register 1LCD_BLINK bfield LCD_CR1,6,2 ; Blink enableLCD_BLINKF bfield LCD_CR1,3,3 ; Blink frequencyLCD_DUTY bfield LCD_CR1,1,2 ; Duty ratio selectionLCD_B2 bit LCD_CR1,0 ; Bias selectorLCD_CR2 label Base+$01 ; LCD control register 2PON bfield LCD_CR2,5,3 ; Pulse ON durationHD bit LCD_CR2,4 ; High drive enableCC bfield LCD_CR2,1,3 ; Contrast controlVSEL bit LCD_CR2,0 ; LCD voltage sourceLCD_CR3 label Base+$02 ; LCD control register 3LCD_LCDEN bit LCD_CR3,6 ; LCD enableLCD_SOFIE bit LCD_CR3,5 ; Interrupt enableLCD_SOF bit LCD_CR3,4 ; Start of frame flagLCD_SOFC bit LCD_CR3,3 ; SOF flag clearLCD_DEAD bfield LCD_CR3,0,3 ; Dead time enableLCD_FRQ label Base+$03 ; LCD frequency selection registerLCD_PS bfield LCD_FRQ,4,4 ; CLK 16-bit prescalerLCD_DIV bfield LCD_FRQ,0,4 ; Divider from 16 to 31if HasCR4LCD_CR4 label $542f ; LCD control register 4LCD_PAGE_COM bit LCD_CR4,2 ; LCD_RAM page selectorLCD_DUTY8 bit LCD_CR4,1 ; 1/8 duty enableLCDB4 bit LCD_CR4,0 ; 1/4 bias enableendif__I set 0rept NumSegsif (__I&7)==0__decstr __NRS,__I/8LCD_PM{__NRS} label Base+$04+(__I/8) ; Port mask register nendif__dec02str __NS,__ILCD_SEG{__NS} bit LCD_PM{__NRS},__I&7 ; Port mask for SEG i__I set __I+1endm__N set 0rept NumRAM__decstr __NS,__NLCD_RAM{__NS} label Base+$0c+__N ; LCD display memory n__N set __N+1endmendmrestoreendif ; __stm8llcdinc