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

📄 hdrv_bankfunctions.msa

📁 MP3 整个 SDK
💻 MSA
字号:
#include "display.h"
#include "Drv_S6B33B0A.h"
#include "Hdrv_S6B33B0A.h"

        module  Hdrv_BankFunctions

        //public Hdrv_Invert
        public Hdrv_Vscroll
        public Hdrv_SetCont
        public Hdrv_SetBrightness
        extern Hdrv_LightOnOff
        public Hdrv_StandbyScr

        extern Write_Command
        extern Write_Parameter
        extern Delay_10us
        extern StoreCE
        extern ReStoreCE
        extern CEPort_Sav
        extern Write_Display_Ram
        extern Store_R0
        rseg   BBC_HFUN


////*******************************************************************************/
///* void Hdrv_VscrollSet (BYTE startline, BYTE endline);
//** FUNCTION:     Hdrv_VscrollSet
//**
//** Description:  设置滚屏参数
//**
//**  input
//**    BYTE startline :区域开始
//**    BYTE endline :区域结束
//**
//**  output
//**      none
//********************************************************************************/
Hdrv_VscrollSet:
	//请在这填入你的代码

	ret




////*******************************************************************************/
//**  void Hdrv_Vscroll_sub (BYTE scrllstartline);
//** FUNCTION:     Hdrv_Vscroll_sub
//**
//** Description:  纵向滚屏
//**
//**  input
//**        BYTE scrllstartline: 开始行
//**
//**  output
//**        none
//********************************************************************************/
Hdrv_Vscroll_sub:
            /*ld c, 5ah
            call Write_Command
            ld a, 113
            sub e
            ld c, a
            call Write_Command*/
            ret
//********************************************************************************/


////*******************************************************************************/
///*  Hdrv_Vscroll(region_t *Vsregion, signed int Vstep);
//**  void Hdrv_Vscroll_sub (BYTE scrllstartline);
//** FUNCTION:     Hdrv_Vscroll
//**
//** Description:  纵向滚屏
//**
//**  input
//**        region_t *Vsregion: 滚屏的区域
//**        signed int Vstep  : 滚动的行数 "+" 表示向上,"-" 表示向下
//**
//**  output
//**      none
//********************************************************************************/
Hdrv_Vscroll:
//s6b33b0a 暂不支持这个功能
//            call StoreCE
//            push ix
//            push bc
//
//            push de
//            pop ix      // de->ix
//
//            ld  e,(ix+1) //y轴首行
//            ld  a,(ix+3) //高度
//            push af      //暂存高度的值
//            add a,e      //y轴未行
//            push bc     //保护bc下面用
//            ld  c,a
//            call lwrd Hdrv_VscrollSet//设置滚屏区
//
//            pop de// bc -> de 滚动的行数
//
//            pop hl//区域的高度 af->hl
//
//            bit 7,d
//            jr  z,positive
//            //为负值-----
//            add hl,de
//            ex de,hl
//
//positive:   //为正值------
//            // e中的内容
//            ld a,(ix+1)
//            add a,e
//            ld e,a
//            call lwrd Hdrv_Vscroll_sub//滚动
//
//            /*
//            //for test
//            ld  e,(ix+1)
//            ld  a,(ix+3)
//            add a,e
//            ld  a,c
//            call lwrd Hdrv_VscrollSet//设置滚屏区
//            ld e,(ix+1)
//            call lwrd Hdrv_Vscroll_sub//滚动
//            //for test
//            */
//
//            pop ix
//            call ReStoreCE
            ret


////*******************************************************************************/
///* void Hdrv_Invert(region_t *invregion); //反白
//** FUNCTION:     Hdrv_Invert
//**
//** Description:  把指定区域内容作反白处理
//**
//**  input
//**      region_t *invregion :反白的区域
//**
//**  output
//**      none
//********************************************************************************/
Hdrv_Invert:
            //请在这填入你的代码
            /*ld a, e
            or  d
            jr z, No_action
            call StoreCE
            call Store_R0
            ld    c,0a7h
            call Write_Command
            call ReStoreCE*/
No_action:
            ret
//********************************************************************************/

////*******************************************************************************/
///*  void Hdrv_SetCont(char ContrastValue);
//** FUNCTION:     Hdrv_SetCont
//**
//** Description:  设置对比度
//**
//**  input
//**     char ContrastValue: 要设置的对比度的值
//**
//**  output
//**     none
//********************************************************************************/
Hdrv_SetCont:
		ret
            //请在这填入你的代码
	    push	bc
	    push	de
        call StoreCE

        ld c, 87h
        call Write_Command                //normal mode contrast control
        ld	a,e
        and	0x0f
        ld 	c, a
        call Write_Command

        call ReStoreCE
        pop	de
        pop	bc
        ret






//********************************************************************************/

////*******************************************************************************/
///*  void Hdrv_LightOnOff(bool OnOff);
//** FUNCTION:     Hdrv_LightOnOff
//**
//** Description:  开关背景灯  打开 LCM 升压
//**
//**  input
//**     bool OnOff: true:ON ; false:OFF
//**
//**  output
//**     none
//********************************************************************************/
/*Hdrv_LightOnOff:
    push    de
    ld a,e
    or a
    jr z,Light_OFF
Light_ON:
        //in a, (0xf2)
        //and 0dfh
        //out (0xf2),a

        in a, (0xf2)
        or 10h
        out (0xf2),a

        jr  Light_ONOFF

Light_OFF:
        //in a, (0xf2)
        //or 20h
        //out (0xf2),a

        in a, (0xf2)
        and 0efh
        out (0xf2),a


Light_ONOFF:

        //in a, (0xf2)
        //or 20h
        //out (0xf2),a

        pop    de
        ret  */


////*******************************************************************************/
///*  void Hdrv_SetBrightness(char BrightnessVale);
//** FUNCTION:     Hdrv_SetBrightness
//**
//** Description:  设置亮度
//**
//**  input
//**     char BrightnessVale 要设置的亮度的值
//**
//**  output
//**     none
//********************************************************************************/

Hdrv_SetBrightness:
            //请在这填入你的代码
            //call StoreCE

            //ld c, 87h
            //call Write_Command
            //ld	a,e
            //and	0x0f
            //ld	c,a
            //call Write_Command
            ret

////*******************************************************************************/
///*    void Hdrv_StandbyScr(bool bStandby);
//**
//** FUNCTION:     Hdrv_StandbyScr
//**
//** Description:  进入或退出 standby
//**
//**  input
//**     bool bStandby:  True: 退出Standby;  False: 进入 Standby
//**
//**  output
//**     none
//********************************************************************************/
Hdrv_StandbyScr:
        //请在这里填入你的代码

        call    StoreCE
        ld  a,e
        or  a
        jr  nz,StandbyScr_OFF
StandbyScr_ON:
		//进入STNADBY
		ld    c, 06h                //deng 2005-8-23 09:54上午
		call   Write_Command          //display off
		ld        c, 0x85;
		call      Write_Parameter

		ld     c, 01h                //deng 2005-10-19 03:07下午
		call   Write_Command         //display sleep
		ld      c, 0x00;
		call   Write_Parameter
		//ld e,0
		//call lwrd Hdrv_LightOnOff
		jr Hdrv_StandbyScr_ret
StandbyScr_OFF:
		//退出STNADBY
//		ld e,1
//		call lwrd Hdrv_LightOnOff
//		call lwrd Delay
//		call lwrd Delay
//		call lwrd Delay

		ld      c, 06h           //deng 2005-8-23 09:54上午
		call    Write_Command                //display on
		ld       c, 0xc5
		call     Write_Parameter

		ld     c, 01h                //deng 2005-10-19 03:07下午
		call   Write_Command         //display normal
		ld      c, 0x02;
		call   Write_Parameter
Hdrv_StandbyScr_ret:
        call ReStoreCE
        ret

//Delay:        //Delay time:=0.137*255=2.8ms
//        push    bc
//        ld      b,0xff
//Delay1:
//        push    bc
//        ld      b,0xff
//Delay2:
//        djnz    Delay2
//        pop     bc
//        djnz    Delay1
//        pop     bc
//        ret

/*********************************************/
Delay:
    push bc
    ld b, 200   
delay_loop:
    nop
    nop
    nop
    djnz delay_loop
    pop bc
    ret
    
    
Delay_1ms:
    push af
    push bc
    push de
    push hl

    ld b,04h
contiune_delay213:
    push bc  
    ld b,0ffh
contiune_delay31:
    ld hl,4567h             
    djnz contiune_delay31   
    pop bc
    djnz contiune_delay213  

    pop hl
    pop de
    pop bc
    pop af
           
    RET


Delay_ams://0~254ms delay
    push af
    push bc
    push de
    push hl

    ld  b,a
    jr Delay_ams_while
Delay_ams_continue:
    push  bc
    call  lwrd Delay_1ms
    pop   bc
Delay_ams_while:       
    djnz  Delay_ams_continue

    pop hl
    pop de
    pop bc
    pop af
                 
    RET

Delay_60us:
        call Delay_10us
        call Delay_10us
        call Delay_10us
        call Delay_10us
        call Delay_10us
        call Delay_10us
        ret


/************************************************************/
/*  function:STB_LCD_Set                                        */
/*  input:               output:                            */
/*  process:  1,stable the power 2,start-up on-chip DC-DC   */
/************************************************************/

        end

⌨️ 快捷键说明

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