50
50
51
51
static sunxi_spi_t sunxi_spi0_lcd = {
52
52
.base = SUNXI_R_SPI_BASE ,
53
+ .clk_reg = {
54
+ .ccu_base = SUNXI_R_PRCM_BASE ,
55
+ .spi_clk_reg_offest = SUNXI_S_SPI_CLK_REG ,
56
+ .spi_bgr_reg_offset = SUNXI_S_SPI_BGR_REG ,
57
+ },
53
58
.id = 0 ,
54
59
.clk_rate = 75 * 1000 * 1000 ,
55
60
.gpio_cs = {GPIO_PIN (GPIO_PORTL , 10 ), GPIO_PERIPH_MUX6 },
56
61
.gpio_sck = {GPIO_PIN (GPIO_PORTL , 11 ), GPIO_PERIPH_MUX6 },
57
62
.gpio_mosi = {GPIO_PIN (GPIO_PORTL , 12 ), GPIO_PERIPH_MUX6 },
58
- .clk_reg = {
59
- .ccu_base = SUNXI_R_PRCM_BASE ,
60
- .spi_clk_reg_offest = SUNXI_S_SPI_CLK_REG ,
61
- .spi_bgr_reg_offset = SUNXI_S_SPI_BGR_REG ,
62
- }};
63
+ };
63
64
64
65
static gpio_mux_t lcd_dc_pins = {
65
66
.pin = GPIO_PIN (GPIO_PORTL , 13 ),
@@ -131,7 +132,7 @@ static void LCD_Open_BLK() {
131
132
132
133
static void LCD_Fill_All (uint16_t color ) {
133
134
uint16_t i , j ;
134
- LCD_Address_Set (0 , 0 , LCD_W - 1 , LCD_H - 1 );// 设置显示范围
135
+ LCD_Address_Set (0 , 0 , LCD_W - 1 , LCD_H - 1 );
135
136
uint16_t * video_mem = smalloc (LCD_W * LCD_H );
136
137
137
138
for (uint32_t i = 0 ; i < LCD_W * LCD_H ; i ++ ) {
@@ -154,7 +155,7 @@ static void LCD_Init(void) {
154
155
printk (LOG_LEVEL_ERROR , "SPI: init failed\n" );
155
156
}
156
157
157
- LCD_Set_RES (0 );//复位
158
+ LCD_Set_RES (0 );
158
159
mdelay (100 );
159
160
LCD_Set_RES (1 );
160
161
mdelay (100 );
@@ -245,7 +246,7 @@ static void LCD_Init(void) {
245
246
246
247
static void LCD_Show_Splash (uint8_t * splash_dest ) {
247
248
uint16_t i , j , k = 0 ;
248
- LCD_Address_Set (SPLASH_START_X , SPLASH_START_Y , SPLASH_START_X + SPLASH_W - 1 , SPLASH_START_Y + SPLASH_H - 1 );// 设置显示范围
249
+ LCD_Address_Set (SPLASH_START_X , SPLASH_START_Y , SPLASH_START_X + SPLASH_W - 1 , SPLASH_START_Y + SPLASH_H - 1 );
249
250
250
251
uint16_t * video_mem = smalloc (SPLASH_W * SPLASH_H );
251
252
@@ -383,7 +384,7 @@ void LCD_ShowChar(uint16_t x, uint16_t y, uint8_t num, uint16_t fc, uint16_t bc,
383
384
}
384
385
}
385
386
386
- void LCD_ShowString (uint16_t x , uint16_t y , const uint8_t * p , uint16_t fc , uint16_t bc , uint8_t sizey ) {
387
+ static void LCD_ShowString (uint16_t x , uint16_t y , const uint8_t * p , uint16_t fc , uint16_t bc , uint8_t sizey ) {
387
388
printk (LOG_LEVEL_DEBUG , "LCD: Show String: \"%s\"\n" , p );
388
389
while (* p != '\0' ) {
389
390
LCD_ShowChar (x , y , * p , fc , bc , sizey );
0 commit comments