📄 hdrv_bankfunctions-01.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
public Hdrv_LightOnOff
public Hdrv_StandbyScr
extern Write_Command
extern Delay_10us
extern Store_R0
extern StoreCE
extern ReStoreCE
extern CEPort_Sav
extern Write_Display_Ram
rseg BBC_HFUN
////*******************************************************************************/
///* void Hdrv_VscrollSet (BYTE startline, BYTE endline);
//** FUNCTION: Hdrv_VscrollSet
//**
//** Description: 设置滚屏参数
//**
//** input
//** BYTE startline :区域开始
//** BYTE endline :区域结束
//**
//** output
//** none
//********************************************************************************/
Hdrv_VscrollSet:
//请在这填入你的代码
// StoreCE
// ld c,59h
// call Write_Command
// StoreCE
// ld c,00h
// call Write_Command
//
// StoreCE
// ld c,startline
// call Write_Command
// StoreCE
// ld c,endline
// call Write_Command
// StoreCE
// ld c,00h
// call Write_Command
//
ret
////*******************************************************************************/
//** void Hdrv_Vscroll_sub (BYTE scrllstartline);
//** FUNCTION: Hdrv_Vscroll_sub
//**
//** Description: 纵向滚屏
//**
//** input
//** BYTE scrllstartline: 开始行
//**
//** output
//** none
//********************************************************************************/
Hdrv_Vscroll_sub:
// StoreCE
// ld c, 5ah
// call Write_Command
// StoreCE
// ld c, scrllstartline
// 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
// 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:
//请在这填入你的代码
push bc
push de
// call StoreCE
// call Store_R0
// ld c, 2ah
// call Write_Command //normal mode contrast control
//
// call Store_R0
// 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 0x10
//and 0xef //B4 open Backlight
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:
call Store_R0
ld c, 50h
call Write_Command //display off
call lwrd Delay //lzd added
call lwrd Delay //lzd added
call lwrd Delay //lzd added
ld e,0
call lwrd Hdrv_LightOnOff //关掉升压 电路
jr Hdrv_StandbyScr_ret
StandbyScr_OFF:
//退出STNADBY
//ld c, 0b0h
//call Write_Command
//ld c,0
//call Write_Command
ld e,1
call lwrd Hdrv_LightOnOff
call lwrd Delay
call lwrd Delay
call lwrd Delay
call Store_R0
ld c, 51h
call Write_Command //display on
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
/************************************************************/
/* 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 + -