FreeCalypso > hg > fc-selenite
comparison src/cs/drivers/drv_app/r2d/lcds/c139/r2d_task_init_i.c @ 0:b6a5e36de839
src/cs: initial import from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 15 Jul 2018 04:39:26 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b6a5e36de839 |
---|---|
1 #include "r2d/lcds/c139/colors.h" | |
2 | |
3 #define R2D_MB_PRIM_SIZE 2000 | |
4 | |
5 extern void c139_lcd_ctrl_cmd(UINT8 cmd, UINT8 param); | |
6 extern void c139_set_lcd_addr_region(UINT8 xstart, UINT8 xend, | |
7 UINT8 ystart, UINT8 yend); | |
8 extern void c139_lcd_send_pix(UINT16 pixval); | |
9 | |
10 void uwire_init_lcd(void) | |
11 { | |
12 * ( UINT16 *) CNTL_RST &= ~(0x04); // releases reset_out | |
13 * ( UINT16 *) CNTL_RST |= (0x04); // set reset_out to 0 | |
14 rvf_delay(RVF_MS_TO_TICKS(5)); // waits for 5 ms | |
15 * ( UINT16 *) CNTL_RST &= ~(0x04); // releases reset_out | |
16 | |
17 * (volatile UINT16 *) SR1 = CS0_FRQ_FINT_2; | |
18 * (volatile UINT16 *) SR3 = SR3_CLK_EN; // enables the uwire clock | |
19 * (volatile UINT16 *) CSR = INDEX_CS0; // selects CS0 | |
20 } | |
21 | |
22 static void r2d_refresh_task_init(void) | |
23 { | |
24 UINT16 i; | |
25 | |
26 uwire_init_lcd(); | |
27 rvf_delay(RVF_MS_TO_TICKS(5)); // waits for 5 ms | |
28 | |
29 /* LCD controller init */ | |
30 c139_lcd_ctrl_cmd(0x3F, 0x01); | |
31 c139_lcd_ctrl_cmd(0x20, 0x03); | |
32 c139_lcd_ctrl_cmd(0x31, 0x03); | |
33 | |
34 /* initial hw framebuffer clearing */ | |
35 c139_set_lcd_addr_region(0, 95, 0, 63); | |
36 for (i = 0; i < 96 * 64; i++) | |
37 c139_lcd_send_pix(LCD16_COLOR_BORDER); | |
38 } | |
39 | |
40 static void r2d_refresh_task_kill(void) | |
41 { | |
42 } | |
43 | |
44 static void r2d_dithering_init(void) | |
45 { | |
46 R2D_MALLOC(r2d_mb_id,UINT32,sizeof(UINT32)*4,r2d_g_dithering_matrix); | |
47 r2d_g_dithering_matrix[0]=0; | |
48 r2d_g_dithering_matrix[1]=2; | |
49 r2d_g_dithering_matrix[2]=3; | |
50 r2d_g_dithering_matrix[3]=1; | |
51 } |