📄 hdrv_s6b33b0a.msa
字号:
Hdrv_InvBuffDataTrans:
call StoreCE
call Write_Display_Ram
lopfortransdata:
ld a,(de)
cpl
ld (8000h),a
inc de
ld a,(de)
cpl
ld (8000h),a
inc de
dec bc
ld a,b
or c
jr nz,lopfortransdata
call ReStoreCE
ret
//=====================================================
////*******************************************************************************/
///* COLORREF Hdrv_RGB(BYTE red, BYTE green, BYTE blue );
//** FUNCTION: Hdrv_RGB
//**
//** Description: 把用分量表示的颜色值转为系统颜色值 COLORREF
//**
//** input
//** BYTE red : 红色灰度级
//** BYTE green :绿色灰度级
//** BYTE blue :蓝色灰度级
//**
//** output
//** COLORREF : 系统的颜色值
//********************************************************************************/
//请在这填入你的代码
// ret
//********************************************************************************/
////*******************************************************************************/
///* void Hdrv_SetDrawMode (BYTE mode );
//** FUNCTION: Hdrv_SetDrawMode
//**
//** Description: 设置作图模式(横向还是纵向)
//**
//** input
//** BYTE mode:
//** DrawModeH_def //横向优先
//** DrawModeV_def //纵向优先
//**
//** output
//** none
//********************************************************************************/
Hdrv_SetDrawMode:
;set the draw window again after call this function
; //请在这填入你的代码
call StoreCE
//ld c, 0a0h
//call Write_Command
ld a,e
ld (DrawMode),a
cp DrawModeV_def
jr z,IsModeV
jr c,IsModeH
cp DrawModeHPic_def
jr z,lsModeHPic
lsModeVPic:
ld c, 17h
call Write_Command
ld c, 08h
call Write_Parameter
jr Hdrv_SetDrawMode_ret
lsModeHPic:
ld c, 17h
call Write_Command
ld c, 04h
call Write_Parameter
jr Hdrv_SetDrawMode_ret
IsModeH:
ld c, 17h
call Write_Command
ld c, 00h
call Write_Parameter
jr Hdrv_SetDrawMode_ret
IsModeV:
ld c, 17h
call Write_Command
ld c, 01h
call Write_Parameter
Hdrv_SetDrawMode_ret:
call ReStoreCE
ret
//********************************************************************************/
////*******************************************************************************/
///* void Hdrv_LightOnOff(bool OnOff);
//** FUNCTION: Hdrv_LightOnOff
//**
//** Description: 开关背景灯
//**
//** input
//** bool OnOff: true:ON ; false:OFF
//**
//** output
//** none
//********************************************************************************/
Hdrv_LightOnOff:
xor a
or e
jr z,Light_OFF
Light_ON:
in a, (LCMBL_GIO_DATA_REG) //set GPIO_B2(Oled_BackLightPower) to 0
and LCMBL_CLR_BIT
out (LCMBL_GIO_DATA_REG),a
jr Light_ONOFF
Light_OFF:
in a, (LCMBL_GIO_DATA_REG) //set GPIO_B2 to 0
or LCMBL_SET_BIT
out (LCMBL_GIO_DATA_REG),a
Light_ONOFF:
ret
/************************************************************/
/* function:Write_Command */
/* input:register address to C register */
/* process 1,set RS to 0; 2,write to (8000h) */
/************************************************************/
Write_Command:
in a, (LCMA0_GIO_DATA_REG)
and LCMA0_CLR_BIT //RS signal set to 0
out (LCMA0_GIO_DATA_REG), a
xor a
ld (8000h),a
ld a, c
ld (8000h),a
ret
Write_Parameter:
push af
in a,(LCMA0_GIO_DATA_REG)
or LCMA0_SET_BIT
out (LCMA0_GIO_DATA_REG),a
ld a, c
ld (8000h),a
pop af
ret
Store_R0:
push af
in a, (LCMA0_GIO_DATA_REG)
and LCMA0_CLR_BIT //RS signal set to 0
and LCMA0_CLR_BIT
out (LCMA0_GIO_DATA_REG), a
nop
nop
nop
nop
nop
pop af
ret
//Restore_R0:
// push af
// in a, (LCMA0_GIO_DATA_REG)
// or LCMA0_SET_BIT
// or LCMA0_SET_BIT //RS signal set to 1
// out (LCMA0_GIO_DATA_REG), a
//
// nop
// nop
// nop
// nop
// nop
// pop af
// ret
/************************
* void DmaDriver(char *Tab)
* DmaDriver
*
*************************/
//DmaDriver:
// push bc
//
// ex de,hl
// ld bc,0e06h
//lopforout:
// outi
// inc c
// xor a
// or b
// jr nz,lopforout
//
// pop bc
//
//
//
//DmaDriveL:
// in a,(13h)
// bit 0,a
// jr nz,DmaDriveL
// ret
/************************************************************/
/* function: delay 10us */
/* input: */
/* process */
/************************************************************/
Delay:
push bc
ld b, 200
delay_loop:
nop
nop
nop
djnz delay_loop
pop bc
ret
Delay_10us:
push bc
ld a, 255
delaycontinue:
ld b,255
loop1us: djnz loop1us
dec a
jr nz, delaycontinue
pop bc
ret
/************************************************************/
/* function: delay 10us */
/* input: */
/* process */
/************************************************************/
//StoreCE:
// di
// ld hl,37h
// inc (hl)
// in a,(0x02)
// cp 10h
// jr z,StoreCE_end
// ld (CEPort_Sav),a
// or 0x10 //ce2-
// and 0xd7
// out (0x02),a
//StoreCE_end:
// ret
StoreCE:
// di
// ld hl,37h
// inc (hl)
// in a,(LCMCE_GIO_DATA_REG)
// cp 20h
// jr z,StoreCE_end
// ld (CEPort_Sav),a
//// or 0x20 //ce2-
ld a,(LCMCE_GIO_DATA_REG)
and LCMCE_CLR_BIT
out (LCMCE_GIO_DATA_REG),a
StoreCE_end:
ret
/************************************************************/
/* function: delay 10us */
/* input: */
/* process */
/************************************************************/
//ReStoreCE:
// ld a,(CEPort_Sav)
// out (0x02),a
// ld hl,37h
// dec (hl)
// jr nz,NotEI
// ei
//NotEI:
// ret
ReStoreCE:
// ld a,(CEPort_Sav)
ld a,(LCMCE_GIO_DATA_REG)
or LCMCE_SET_BIT
out (LCMCE_GIO_DATA_REG),a
// ld hl,37h
// dec (hl)
// jr nz,NotEI
// ei
//NotEI:
ret
DrawMode defb 0
Save_eeReg defb 0
Reg00_buf defb 0
//Dsc_Lcd_Dma_Out_Table
// //源地址设置
// defw 0000h //源地址 L|H 格式 (a0-a15)
// defb 00h //源地址 (a16-a23)
// defb 40h //源地址在哪段空间及地址(a24-a28)
// defb 07h //源地址在 zram 中的哪一页
//
// //目标地址设置
// defw 8000h //目标地址 L|H 格式 (a0-a15)
// defb 00h //目标地址 (a16-a23)
// defb 0cch //目标地址在哪段空间及地址(a24-a28)
// defb 00h //目标地址在 zram 中的哪一页
//
// //传送数据的 byte 数
// defb 0ffh,01h //传送数据的数量
//
// //传送模式及wait state 设置
// defb 40h //3 wait state
//
// //启动传送
// defb 01h
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -