Skip to content
Snippets Groups Projects
Commit 0aef1470 authored by Yongrok Oh's avatar Yongrok Oh
Browse files

update lcd

parent 822cfced
No related branches found
No related tags found
No related merge requests found
#ifndef LED_H
#define LED_H
#define GPIO_BASE_ADDR 0x3F200000
#define BSC1_BASE_ADDR 0x3F804000
#define I2CADDR 0x3f
#define I2C_CLOCK_DIVIDER 2500
#define CONTROL 0x00
#define SLADDR 0xC0
#define BSC_C 0x00
#define BSC_S 0x04
#define BSC_DLEN 0x08
#define BSC_A 0x0C //master slave address
#define BSC_FIFO 0x10
#define BSC_DIV 0x14
#define BSC_DEL 0x18
#define BSC_CLKT 0x1C
#define RW 0b00000010
#define EN 0b00000100
#define LCD_BACKLIGHT 0b00001000
#define LCD_LINE_1 0x80
#define BSC_C_I2CEN 0x00008000
#define BSC_C_ST 0x00000080
#define BSC_S_TXD 0x00000010
#define BSC_S_CLKT 0x00000200
#define BSC_S_ERR 0x00000100
#define BSC_S_DONE 0x00000002
#define BSC_C_CLEAR_1 0x00000020
#define BSC_I2C_REASON_ERROR_NACK 0x01
#define BSC_I2C_REASON_ERROR_CLKT 0x02
#define BSC_I2C_REASON_ERROR_DATA 0x04
#define GPFSEL0 0x00
#define GPSET0 0x1C
#define GPCLR0 0x28
static void __iomem *gpio_base;
static void __iomem *bsc1_base;
volatile unsigned int *gpsel0;
volatile unsigned int *gpsel1;
volatile unsigned int *gpsel2;
volatile unsigned int *gpset0;
volatile unsigned int *bsc_a;
volatile unsigned int *bsc_clk;
volatile unsigned int *bsc_dlen;
volatile unsigned int *bsc_fifo;
volatile unsigned int *bsc_status;
volatile unsigned int *bsc_control;
void lcd_send_byte(const unsigned char byte, const unsigned char mode);
void i2c_write(const char* buf, unsigned int len);
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment