//LCD 2x16 Driver func #include "stm32f3_discovery.h" //Interno IME PORT PIN Discovery #define LCD_D7 GPIOB, GPIO_Pin_15 //PB15 #define LCD_D6 GPIOB, GPIO_Pin_13 //PB13 #define LCD_D5 GPIOB, GPIO_Pin_11 //PB11 #define LCD_D4 GPIOE, GPIO_Pin_15 //PE15 #define LCD_E GPIOE, GPIO_Pin_13 //PE13 #define LCD_RW GPIOE, GPIO_Pin_11 //PE11 #define LCD_RS GPIOE, GPIO_Pin_9 //PE9 //navesti ovde zavisno koji se portovi iskoriste za konekciju #define LCD_PORT_USE_A 0 #define LCD_PORT_USE_B 1 #define LCD_PORT_USE_C 0 #define LCD_PORT_USE_D 0 #define LCD_PORT_USE_E 1 #define LCD_PORT_USE_F 0 #define LCD_PORT_USE_G 0 #define LCD_PORT_USE_H 0 //baza za delay funkciju od 1us //56 je osnovna vrednost (bez ostalih interapt rutina) #define LCD_DELAY_BASE 56 //definicija da li se koristi provera busy linije (D0) ili raditi sa delay funkcijama #define LCD_USES_BUSY_FLAG 0 //shirina DRAM-a (jedne linije) od LCD #define LCD_DRAM_WIDTH 40 #define IO_Write(pin, value) GPIO_WriteBit(pin, value) #define IO_Read(pin) GPIO_ReadInputDataBit(pin) void LCD_Init_pins (void); void LCD_Display_init (void); void LCD_wait_busy_flag (void); void LCD_send_nibble( unsigned char n ); void LCD_send_byte( unsigned char address, unsigned char n ); void LCD_send_string (volatile char *s); void LCD_goto_home (void); void LCD_clear_all (void); void LCD_cursor_control (int cursor_on_off, int blinking_on_off); void LCD_cursor_left(int no); void LCD_cursor_right(int no); void LCD_goto_home_line1 (void); void LCD_goto_home_line2 (void); void lcd_gotoxy(unsigned char x, unsigned char y);