|
在 ouravr 上有很多 HD44780 的驱动程序,我再上传一份,不知可否用到?
这个程序是网上的开源程序,我在电路上做了实验,可以良好运行,在 BSD/Windows 里都可以正常编译。
这个驱动库大概有这些函数:
/**
* @name Functions
*/
/**
@brief Initialize display and select type of cursor
@param dispAttr \b LCD_DISP_OFF display off\n
\b LCD_DISP_ON display on, cursor off\n
\b LCD_DISP_ON_CURSOR display on, cursor on\n
\b LCD_DISP_ON_CURSOR_BLINK display on, cursor on flashing
@return none
*/
extern void lcd_init(uint8_t dispAttr);
/**
@brief Clear display and set cursor to home position
@param void
@return none
*/
extern void lcd_clrscr(void);
/**
@brief Set cursor to home position
@param void
@return none
*/
extern void lcd_home(void);
/**
@brief Set cursor to specified position
@param x horizontal position\n (0: left most position)
@param y vertical position\n (0: first line)
@return none
*/
extern void lcd_gotoxy(uint8_t x, uint8_t y);
/**
@brief Display character at current cursor position
@param c character to be displayed
@return none
*/
extern void lcd_putc(char c);
/**
@brief Display string without auto linefeed
@param s string to be displayed
@return none
*/
extern void lcd_puts(const char *s);
/**
@brief Display string from program memory without auto linefeed
@param s string from program memory be be displayed
@return none
@see lcd_puts_P
*/
extern void lcd_puts_p(const char *progmem_s);
/**
@brief Send LCD controller instruction command
@param cmd instruction to send to LCD controller, see HD44780 data sheet
@return none
*/
extern void lcd_command(uint8_t cmd);
// mtmt new function:
#ifdef LCD_SCROLL_FUNCTION
/**
@brief Scroll LCD up
@param none
@return none
*/
extern void lcd_scrollup(void);
#endif
// mtmt exported for debugging
extern uint8_t lcd_waitbusy(void);
点击此处下载ourdev_183454.rar(文件大小:9K)
压缩包内是 connect.txt, lcd.h 和 lcd.c
压缩包里支持的 LCD 是4x20,如果要让它支持16x2,需要对 lcd.h 进行设置,文件中有详细说明。 |
阿莫论坛20周年了!感谢大家的支持与爱护!!
一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。
|