SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Macros | Functions | Variables
spi_lcd.c File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <config.h>
#include <log.h>
#include <timer.h>
#include <common.h>
#include <jmp.h>
#include <mmu.h>
#include <smalloc.h>
#include <sstdlib.h>
#include <string.h>
#include <cli.h>
#include <cli_shell.h>
#include <cli_termesc.h>
#include <reg-ncat.h>
#include <sys-clk.h>
#include <sys-dram.h>
#include <sys-i2c.h>
#include <sys-rtc.h>
#include <sys-sdcard.h>
#include <sys-sid.h>
#include <sys-spi.h>
#include <pmu/axp.h>
#include <fdt_wrapper.h>
#include <ff.h>
#include <sys-sdhci.h>
#include <uart.h>
Include dependency graph for spi_lcd.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SPI_LCD_COLOR_WHITE   0xFFFF
 
#define SPI_LCD_COLOR_BLACK   0x0000
 
#define SPI_LCD_COLOR_BLUE   0x001F
 
#define SPI_LCD_COLOR_BRED   0XF81F
 
#define SPI_LCD_COLOR_GRED   0XFFE0
 
#define SPI_LCD_COLOR_GBLUE   0X07FF
 
#define SPI_LCD_COLOR_RED   0xF800
 
#define SPI_LCD_COLOR_MAGENTA   0xF81F
 
#define SPI_LCD_COLOR_GREEN   0x07E0
 
#define SPI_LCD_COLOR_CYAN   0x7FFF
 
#define SPI_LCD_COLOR_YELLOW   0xFFE0
 
#define LCD_W   240
 
#define LCD_H   135
 
#define SPLASH_START_X   52
 
#define SPLASH_START_Y   43
 
#define SPLASH_W   135
 
#define SPLASH_H   48
 

Functions

static void LCD_Set_DC (uint8_t val)
 
static void LCD_Set_RES (uint8_t val)
 
static void LCD_Write_Bus (uint8_t dat)
 
static void LCD_Write_Data_Bus (void *dat, uint32_t len)
 
static void LCD_WR_DATA (uint16_t dat)
 
static void LCD_WR_DATA8 (uint8_t dat)
 
static void LCD_WR_REG (uint8_t dat)
 
static void LCD_Address_Set (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
 
static void LCD_Open_BLK ()
 
static void LCD_Fill_All (uint16_t color)
 
static void LCD_Init (void)
 
static void LCD_Show_Splash (uint8_t *splash_dest)
 
static void LCD_ShowChar (uint16_t x, uint16_t y, uint8_t num, uint16_t fc, uint16_t bc, uint8_t sizey)
 
static void LCD_ShowString (uint16_t x, uint16_t y, const uint8_t *p, uint16_t fc, uint16_t bc, uint8_t sizey)
 

Variables

sunxi_dma_t sunxi_dma
 
static sunxi_spi_t sunxi_spi0_lcd
 
static gpio_mux_t lcd_dc_pins
 
static gpio_mux_t lcd_res_pins
 
static gpio_mux_t lcd_blk_pins
 
static const unsigned char ascii_1206 [][12]
 

Macro Definition Documentation

◆ LCD_H

#define LCD_H   135

◆ LCD_W

#define LCD_W   240

◆ SPI_LCD_COLOR_BLACK

#define SPI_LCD_COLOR_BLACK   0x0000

◆ SPI_LCD_COLOR_BLUE

#define SPI_LCD_COLOR_BLUE   0x001F

◆ SPI_LCD_COLOR_BRED

#define SPI_LCD_COLOR_BRED   0XF81F

◆ SPI_LCD_COLOR_CYAN

#define SPI_LCD_COLOR_CYAN   0x7FFF

◆ SPI_LCD_COLOR_GBLUE

#define SPI_LCD_COLOR_GBLUE   0X07FF

◆ SPI_LCD_COLOR_GRED

#define SPI_LCD_COLOR_GRED   0XFFE0

◆ SPI_LCD_COLOR_GREEN

#define SPI_LCD_COLOR_GREEN   0x07E0

◆ SPI_LCD_COLOR_MAGENTA

#define SPI_LCD_COLOR_MAGENTA   0xF81F

◆ SPI_LCD_COLOR_RED

#define SPI_LCD_COLOR_RED   0xF800

◆ SPI_LCD_COLOR_WHITE

#define SPI_LCD_COLOR_WHITE   0xFFFF

◆ SPI_LCD_COLOR_YELLOW

#define SPI_LCD_COLOR_YELLOW   0xFFE0

◆ SPLASH_H

#define SPLASH_H   48

◆ SPLASH_START_X

#define SPLASH_START_X   52

◆ SPLASH_START_Y

#define SPLASH_START_Y   43

◆ SPLASH_W

#define SPLASH_W   135

Function Documentation

◆ LCD_Address_Set()

static void LCD_Address_Set ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2 
)
static

◆ LCD_Fill_All()

static void LCD_Fill_All ( uint16_t  color)
static

◆ LCD_Init()

static void LCD_Init ( void  )
static

◆ LCD_Open_BLK()

static void LCD_Open_BLK ( )
static

◆ LCD_Set_DC()

static void LCD_Set_DC ( uint8_t  val)
static

◆ LCD_Set_RES()

static void LCD_Set_RES ( uint8_t  val)
static

◆ LCD_Show_Splash()

static void LCD_Show_Splash ( uint8_t splash_dest)
static

◆ LCD_ShowChar()

static void LCD_ShowChar ( uint16_t  x,
uint16_t  y,
uint8_t  num,
uint16_t  fc,
uint16_t  bc,
uint8_t  sizey 
)
static

◆ LCD_ShowString()

static void LCD_ShowString ( uint16_t  x,
uint16_t  y,
const uint8_t p,
uint16_t  fc,
uint16_t  bc,
uint8_t  sizey 
)
static

◆ LCD_WR_DATA()

static void LCD_WR_DATA ( uint16_t  dat)
static

◆ LCD_WR_DATA8()

static void LCD_WR_DATA8 ( uint8_t  dat)
static

◆ LCD_WR_REG()

static void LCD_WR_REG ( uint8_t  dat)
static

◆ LCD_Write_Bus()

static void LCD_Write_Bus ( uint8_t  dat)
static

◆ LCD_Write_Data_Bus()

static void LCD_Write_Data_Bus ( void *  dat,
uint32_t  len 
)
static

Variable Documentation

◆ ascii_1206

const unsigned char ascii_1206[][12]
static

◆ lcd_blk_pins

gpio_mux_t lcd_blk_pins
static
Initial value:
= {
.pin = GPIO_PIN(GPIO_PORTL, 8),
.mux = GPIO_OUTPUT,
}
@ GPIO_PORTL
Definition sys-gpio.h:50
@ GPIO_OUTPUT
Definition sys-gpio.h:21
#define GPIO_PIN(x, y)
Definition sys-gpio.h:66

◆ lcd_dc_pins

gpio_mux_t lcd_dc_pins
static
Initial value:
= {
.pin = GPIO_PIN(GPIO_PORTL, 13),
.mux = GPIO_OUTPUT,
}

◆ lcd_res_pins

gpio_mux_t lcd_res_pins
static
Initial value:
= {
.pin = GPIO_PIN(GPIO_PORTL, 9),
.mux = GPIO_OUTPUT,
}

◆ sunxi_dma

sunxi_dma_t sunxi_dma
extern

◆ sunxi_spi0_lcd

sunxi_spi_t sunxi_spi0_lcd
static
Initial value:
= {
.id = 0,
.clk_rate = 75 * 1000 * 1000,
.gpio =
{
.gpio_cs = {GPIO_PIN(GPIO_PORTL, 10), GPIO_PERIPH_MUX6},
.gpio_sck = {GPIO_PIN(GPIO_PORTL, 11), GPIO_PERIPH_MUX6},
.gpio_mosi = {GPIO_PIN(GPIO_PORTL, 12), GPIO_PERIPH_MUX6},
},
.spi_clk =
{
.spi_clock_cfg_base = SUNXI_R_PRCM_BASE + SUNXI_S_SPI_CLK_REG,
.spi_clock_factor_n_offset = SPI_CLK_SEL_FACTOR_N_OFF,
.spi_clock_source = SPI_CLK_SEL_PERIPH_300M,
},
.parent_clk_reg =
{
.rst_reg_offset = SPI_DEFAULT_CLK_RST_OFFSET(0),
.gate_reg_offset = SPI_DEFAULT_CLK_GATE_OFFSET(0),
.parent_clk = 300000000,
},
.dma_handle = &sunxi_dma,
}
#define SUNXI_R_PRCM_BASE
Definition reg-ncat.h:63
#define SUNXI_S_SPI_CLK_REG
Definition reg-ncat.h:247
#define SUNXI_R_SPI_BASE
Definition reg-ncat.h:123
#define SUNXI_S_SPI_BGR_REG
Definition reg-ncat.h:248
sunxi_dma_t sunxi_dma
Definition board.c:45
@ GPIO_PERIPH_MUX6
Definition sys-gpio.h:26
#define SPI_CLK_SEL_PERIPH_300M
Selects the SPI peripheral clock to 300 MHz.
Definition sys-spi.h:103
#define SPI_CLK_SEL_FACTOR_N_OFF
Offset for the SPI clock select factor is 8.
Definition sys-spi.h:105
#define SPI_DEFAULT_CLK_GATE_OFFSET(x)
Returns the default clock gate offset, based on the SPI module number (x).
Definition sys-spi.h:107
#define SPI_DEFAULT_CLK_RST_OFFSET(x)
Returns the default clock reset offset, based on the SPI module number (x).
Definition sys-spi.h:106