Требуется программист в Зеленограде
- обработка данных с датчиков; ColdFire; 40 тыс. e-mail:jobsmp@pochta.ru |
//=== SCROLL settings ===
//------- P1,2 ------------
#define SAD1 0 //{0,65535}
//-------- P3 -------------
#define SL1 239 //{0,255}
//------- P4,5 ------------
#define SAD2 0x2580 //{0,65535}
//-------- P6 -------------
#define SL2 239 //{0,255}
//------- P7,8 ------------
#define SAD3 0 //{0,65535}
//------- P9,10 -----------
#define SAD4 0 //{0,65535}
//=== CSRFORM settings ===
//-------- P1 -------------
#define CRX 7 //{0,15} cursor X size
//-------- P2 -------------
#define CM 1 //{0,1} 0-underscore 1-block
#define CRY 15 //{0,15} cursor Y size
//=== CSRDIR settings ===
#define CD 0 //{0,3} 0-right 1-left 2-up 3-down
//=== OVLAY settings ===
//-------- P1 -------------
#define OV 0 //{0,1} 0- two-layer 1- three-layer composition in graphics mode
#define DM2 0 //{0,1} BLOCK2: 0-text 1-graphics
#define DM1 1 //{0,1} BLOCK1: 0-text 1-graphics
#define MX 0 //{0,3} 0-OR 1-Exclusive-OR 2-AND 3-Priority OR
//=== DISP ON/OFF settings ===
#define D 1 //{0,1} 0-display OFF 1-display ON
//-------- P1 -------------
#define FP1 1 //{0,3} 0-OFF 1-ON, No flashing 2-ON,2 Hz 3-ON,16 Hz
#define FP2 0 //{0,3} 0-OFF 1-ON, No flashing 2-ON,2 Hz 3-ON,16 Hz
#define FP3 0 //{0,3} 0-OFF 1-ON, No flashing 2-ON,2 Hz 3-ON,16 Hz
#define FC 0 //{0,3} 0-Cursor OFF, 1-ON, No flashing 2-ON,2 Hz 3-ON,16 Hz
//=== CGRAM ADR settings ===
//------- P1,2 ------------
#define SAGL 0xF000 //{0,65535}
void LCD_Init()
{
LCD_PORT_Init();
LCD_PORT_WriteCR(0x40); //SYSTEM SET command
LCD_PORT_WriteDR((IV<<5)|(1<<4)|(WS<<3)|(M2<<2)|(M1<<1)|(M0<<0));
LCD_PORT_WriteDR((WF<<7)|(FX<<0));
LCD_PORT_WriteDR(FY);
LCD_PORT_WriteDR(CR);
LCD_PORT_WriteDR(TCR);
LCD_PORT_WriteDR(LF);
LCD_PORT_WriteDR(AP%256);
LCD_PORT_WriteDR(AP/256);
LCD_PORT_WriteCR(0x44); //SCROLL command
LCD_PORT_WriteDR(SAD1%256);
LCD_PORT_WriteDR(SAD1/256);
LCD_PORT_WriteDR(SL1);
LCD_PORT_WriteDR(SAD2%256);
LCD_PORT_WriteDR(SAD2/256);
LCD_PORT_WriteDR(SL2);
LCD_PORT_WriteDR(SAD3%256);
LCD_PORT_WriteDR(SAD3/256);
LCD_PORT_WriteDR(SAD4%256);
LCD_PORT_WriteDR(SAD4/256);
LCD_PORT_WriteCR(0x5D); //CSRFORM command
LCD_PORT_WriteDR(CRX);
LCD_PORT_WriteDR((CM<<7)|(CRY<<0));
LCD_PORT_WriteCR(0x4C|CD); //CSRDIR command
LCD_PORT_WriteCR(0x5B); //OVLAY command
LCD_PORT_WriteDR((OV<<4)|(DM2<<3)|(DM1<<2)|(MX<<0));
LCD_PORT_WriteCR(0x59); //DISP ON/OFF
LCD_PORT_WriteDR((FP3<<6)|(FP2<<4)|(FP1<<2)|(FC<<0));
LCD_PORT_WriteCR(0x5C); //CGRAM ADR command
LCD_PORT_WriteDR(SAGL%256);
LCD_PORT_WriteDR(SAGL/256);
LCD_PORT_WriteCR(0x46); //CSRW
LCD_PORT_WriteDR(SAGL%256);
LCD_PORT_WriteDR(SAGL/256);
//WriteCR(0x42); for(i=0;i
}
Ответы