📄 hdrv_s6b33b0a.msa
字号:
/*
********************************************************************************
* ACTOS
* driver demo
*
* (c) Copyright 2002-2003, Actions Co,Ld.
* All Right Reserved
*
* File : Hdrv_S6B33B0A.msa
* By :
* Version: 1> v1.00 first version date
********************************************************************************
*/
#include "display.h"
#include "Drv_S6B33B0A.h"
#include "Hdrv_S6B33B0A.h"
module Hdrv_S6B33B0A
public Hdrv_SetWindow
// public Hdrv_UpdateScr
public Hdrv_BuffDataTrans
public Hdrv_PixelDataTrans
public Hdrv_PixelNullTrans
public Hdrv_GetBuffData
public Hdrv_SetDrawMode
public Hdrv_InvBuffDataTrans
public Write_Display_Ram
public Hdrv_LightOnOff
public Store_R0
public Write_Command
public Write_Parameter
public Delay_10us
public StoreCE
public ReStoreCE
extern dc
extern CEPort_Sav
extern TranMode
rseg UI_RCODE
/*
硬件驱动接口函数表
void Hdrv_SetWindow(region_t *region);
void Hdrv_UpdateScr(const region_t *region);
void Hdrv_BuffDataTrans ( char *buff , int datacnt);
void Hdrv_PixelDataTrans( void );
void Hdrv_PixelNullTrans( void );//送一个空数据,表示这个点不变
void Hdrv_GetBuffData( char *buff , int datacnt );
long Hdrv_GetPixelData(void);
long Hdrv_RGB(BYTE red, BYTE green, BYTE blue );
void Hdrv_SetDrawMode (BYTE mode );
void Hdrv_Invert(region_t *invregion); //反白
void Hdrv_SetBrightness(char BrightnessVale);
*/
////*******************************************************************************/
///* void Hdrv_SetWindow(region_t *region);
//** FUNCTION: Hdrv_SetWindow
//**
//** Description: 设置输出的窗口
//**
//** input
//** region_t *region: 要设置的输出窗口的范围
//**
//** output
//** none
//********************************************************************************/
Hdrv_SetWindow: //设定 要填入数据的 起始地址 和 结束地址
//请在这填入你的代码
call StoreCE //片选
push ix
push de
push de
pop ix
// //设置内存区的起始地址
ld c,18h
call Write_Command
ld a,(ix+00h)
ld c,a
call Write_Parameter
ld c,19h
call Write_Command
ld a,(ix+01h)
ld c,a
call Write_Parameter
ld c,09h
call Write_Command
ld a,(ix+00h)
ld c,a
call Write_Parameter
ld c,11h
call Write_Command
ld a,(ix+00h)
ld c,(ix+02h)
add a,c
dec a
ld c,a
call Write_Parameter
ld c,10h
call Write_Command
ld a,(ix+01h)
ld c,a
call Write_Parameter
ld c,12h
call Write_Command
ld a,(ix+01h)
ld c,(ix+03h)
add a,c
dec a
ld c,a
call Write_Parameter
pop de
pop ix
call ReStoreCE
ret
//********************************************************************************/
////*******************************************************************************/
///* void Hdrv_UpdateScr(const region_t *region);
//** FUNCTION: Hdrv_UpdateScr
//**
//** Description: 按指定区域更新屏幕
//**
//** input
//** const region_t *region :要更新的屏幕的区域
//**
//** output
//** none
//********************************************************************************/
//请在这填入你的代码
// ret
//********************************************************************************/
////*******************************************************************************/
///* void Hdrv_BuffDataTrans ( char *buff , int datacnt);
//** FUNCTION: Hdrv_BuffDataTrans
//**
//** Description: 把指定 buff ,指定长度的数据送到 LCM 中
//**
//** input
//** char *buff :数据 buffer 的首址 (de)
//** int datacnt:传送数据的个数 (bc)
//**
//** output
//** none
//********************************************************************************/
Hdrv_BuffDataTrans: //这里只管 填入数据,不管地方,因为在这之前已经设定好了起始位置地点
//请在这填入你的代码
//ret //for test 2006-2-23 16:59
call StoreCE
call Write_Display_Ram
//ld a,(TranMode)
//or a
//jr nz, DMATranMod
//用普通模式传送数据
ex de,hl
ld de,8000h
ldir
jr Hdrv_BuffDataTrans_ret
DMATranMod:
//用DMA模式传送数据
// ld (Dsc_Lcd_Dma_Out_Table),de
// dec bc
// ld (Dsc_Lcd_Dma_Out_Table+0ah),bc
// ld de,Dsc_Lcd_Dma_Out_Table
// // add by zxs
// in a,(0x70)
// or 1
// out (0x70),a
// call DmaDriver
// in a,(0x70)
// and 0xfe
// out (0x70),a
Hdrv_BuffDataTrans_ret:
call ReStoreCE
ret
/************************************************************/
/* function:Write_Display_Ram */
/* input: put display data to register d */
/* process 1,select RS; 2,access to LCD memory */
/************************************************************/
Write_Display_Ram:
push af
in a, (LCMA0_GIO_DATA_REG)
or LCMA0_SET_BIT //DI set to 1
out (LCMA0_GIO_DATA_REG), a
pop af
ret
//********************************************************************************/
////*******************************************************************************/
///* void Hdrv_PixelDataTrans( void );
//** FUNCTION: Hdrv_PixelDataTrans
//**
//** Description: 把当前画笔的值输出一个象素到屏幕上
//**
//** input
//** none
//**
//** output
//** none
//********************************************************************************/
Hdrv_PixelDataTrans:
// ret //for test 2006-2-23 17:00
call StoreCE
//请在这填入你的代码
call Write_Display_Ram
ld hl,(dc)
ld a, h
ld (8000h),a
ld a, l
ld (8000h),a
call ReStoreCE
ret
//********************************************************************************/
////*******************************************************************************/
///* void Hdrv_PixelNullTrans( void );//
//** FUNCTION: Hdrv_PixelNullTrans
//**
//** Description: 送一个空数据,表示这个点不变
//**
//** input
//** none
//**
//** output
//** none
//********************************************************************************/
Hdrv_PixelNullTrans:
//请在这填入你的代码
ret
//********************************************************************************/
////*******************************************************************************/
///* non_banked void Hdrv_GetBuffData ( char *buff , int pixelcnt);
//** FUNCTION: Hdrv_GetBuffData
//**
//** Description: 把LCM上从当前位置开始的 datacnt 个象素的数据读出到指定的Buff中。
//**
//** input
//** char *buff :输出缓冲区的首址;(de)
//** int datacnt :要输出的像素个数;(bc)
//**
//** output
//** none
//********************************************************************************/
Hdrv_GetBuffData:
//请在这填入你的代码
call StoreCE
call Write_Display_Ram
ld a,(8000h)//先空读一次,这是无用的数据(LCM特性)
ld a,(8000h)
//bc * 2
sla c
rl b
ld hl,8000h
ldir
call ReStoreCE
ret
//********************************************************************************/
////*******************************************************************************/
///* COLORREF Hdrv_GetPixelData (void);
//** FUNCTION: Hdrv_GetPixelData
//**
//** Description: 把LCM上当前的象素的值读出。
//**
//** input
//** void
//**
//** output
//** COLORREF : 返回当前象素的系统颜色值
//********************************************************************************/
//请在这填入你的代码
// ret
//********************************************************************************/
//=====================================================
// void Hdrv_InvBuffDataTrans(char *buf, int pixelcnt);
//直接传递的参数
// int pixelcnt: 要反相的象素个数(bc)
// *buf: 显示缓冲区(de)
//
//功能
// 把显示Buffer中的 pixelcnt 个象素的数据反色输出到LCM。
//
//说明:
//
//-----------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -