⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blackfin_twi_lcd_hd44780_based_driver.html

📁 ADI 公司blackfin系列的用户使用文挡。
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head>  <title></title>  <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />  <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />  <link rel="stylesheet" media="print" type="text/css" href="./print.css" />  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="level1"><div class="li"><span class="li"><a href="#general_description" class="toc">GENERAL DESCRIPTION</a></span></div></li><li class="level1"><div class="li"><span class="li"><a href="#kernel_configuration_for_twi_i2c_support" class="toc">Kernel Configuration for TWI/I2C support</a></span></div><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#i2c_hardware_bus_support" class="toc">I2C Hardware Bus support</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#for_bf533_or_bf561" class="toc">For BF533 or BF561</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#for_bf534_bf536_or_bf537" class="toc">For BF534, BF536 or BF537</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#device_drivers" class="toc">Device Drivers</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#blackfin_test_programs" class="toc">Blackfin test programs</a></span></div></li></ul></li></ul></li><li class="level1"><div class="li"><span class="li"><a href="#using_the_driver_in_applications" class="toc">Using the Driver in Applications</a></span></div><ul class="toc"><li class="clear"><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#supported_driver_access_methods" class="toc">Supported driver access methods</a></span></div></li></ul></li><li class="level2"><div class="li"><span class="li"><a href="#driver_usage_example" class="toc">Driver usage example</a></span></div></li></ul></li></ul></div></div><h1><a name="general_description" id="general_description">GENERAL DESCRIPTION</a></h1><div class="level1"><p> <a href="media/lcd_display_lr.jpg" class="media" target="_blank" title="lcd_display_lr.jpg"><img src="media/lcd_display_lr.jpg" class="media" alt="" /></a></p></div><!-- SECTION [1-61] --><h1><a name="kernel_configuration_for_twi_i2c_support" id="kernel_configuration_for_twi_i2c_support">Kernel Configuration for TWI/I2C support</a></h1><div class="level1"><pre class="code">&lt;*&gt; I2C support&lt;*&gt;   I2C device interface      I2C Algorithms  ---&gt;      I2C Hardware Bus support  ---&gt;      Miscellaneous I2C Chip support  ---&gt;[ ]   I2C Core debugging messages[ ]   I2C Algorithm debugging messages[ ]   I2C Bus debugging messages[ ]   I2C Chip debugging messages</pre></div><!-- SECTION [62-422] --><h2><a name="i2c_hardware_bus_support" id="i2c_hardware_bus_support">I2C Hardware Bus support</a></h2><div class="level2"></div><!-- SECTION [423-460] --><h2><a name="for_bf533_or_bf561" id="for_bf533_or_bf561">For BF533 or BF561</a></h2><div class="level2"><pre class="code">&lt;*&gt; Generic Blackfin and HHBF533/561 development board I2C support    BFIN I2C SDA/SCL Selection  ---&gt;</pre></div><!-- SECTION [461-611] --><h2><a name="for_bf534_bf536_or_bf537" id="for_bf534_bf536_or_bf537">For BF534, BF536 or BF537</a></h2><div class="level2"><pre class="code">&lt;*&gt; Blackfin TWI I2C support(50)  TWI clock (kHZ)&lt; &gt; Parallel port adapter (light)&lt; &gt; I2C/SMBus Test Stub&lt; &gt; PCA9564 on an ISA bus</pre></div><!-- SECTION [612-801] --><h2><a name="device_drivers" id="device_drivers">Device Drivers</a></h2><div class="level2"></div><h4><a name="character_devices" id="character_devices">Character devices</a></h4><div class="level4"><pre class="code"> [*] TWI/I2C LCD support for HD44780 based LCD modules (34)  I2C Slave Address (NEW)</pre></div><!-- SECTION [802-962] --><h3><a name="blackfin_test_programs" id="blackfin_test_programs">Blackfin test programs</a></h3><div class="level3"><pre class="code"> [ ] PPI test program [*] TWI LCD test program [ ] TWI KEYPAD test program [ ] Sqlite test program</pre><p><strong>Help:</strong></p><pre class="code">root:~&gt; twilcd_test -h TWI LCD Test ApplicationUsage: twilcd_test [-h?v] [-c] [-d CONTROLLER] [-p POSITION] [Message String]        -h?            this help        -v             print version info        -c             Clear Display        -d Number      use 1,2,3 for CONTROLLER 1,2,BOTH        -p Char POS    Position where to put the stringExample: twilcd_test -p 0 &quot;Hello World !&quot;root:~&gt;</pre></div><h5><a name="application_example_system_monitoring_uptime" id="application_example_system_monitoring_uptime">Application Example System Monitoring 'Uptime'</a></h5><div class="level5"><pre class="code">root:~&gt; twilcd_test  -p 0 &quot;`uptime`&quot; TWI LCD Test Application Position               : 0 Message                :  07:31:29 up 2 min, load average: 0.00, 0.00, 0.00root:~&gt;</pre></div><h5><a name="application_example_system_monitoring_date" id="application_example_system_monitoring_date">Application Example System Monitoring 'Date'</a></h5><div class="level5"><pre class="code">root:~&gt;root:~&gt; twilcd_test  -p 4 &quot;`date`&quot; TWI LCD Test Application Position               : 4 Message                : Thu Jan  1 07:31:43 UTC 1970</pre></div><h5><a name="application_example_system_monitoring_reading_proc_entries" id="application_example_system_monitoring_reading_proc_entries">Application Example System Monitoring reading /proc entries</a></h5><div class="level5"><pre class="code">root:~&gt; twilcd_test &quot;`cat /proc/interrupts | grep BFIN_UART_TX`&quot; TWI LCD Test Application Message                :  19:        186   BFIN_UART_TXroot:~&gt;  </pre></div><!-- SECTION [963-2258] --><h1><a name="using_the_driver_in_applications" id="using_the_driver_in_applications">Using the Driver in Applications</a></h1><div class="level1"></div><!-- SECTION [2259-2307] --><h3><a name="supported_driver_access_methods" id="supported_driver_access_methods">Supported driver access methods</a></h3><div class="level3"><p> <strong><code>int open(const char *path, int flags [, mode_t mode])</code></strong><br/> Open opens the file path for reading and/or writing, as specified by the flags argument and returns a descriptor for that file.</p><p><strong><code>ssize_t write(int d, const void *buf, size_t nbytes)</code></strong><br/> Write attempts to write nbytes of data to the object referenced by the descriptor d from the buffer pointed to by buf.</p><p><strong><code>int ioctl(int d, int request, void *argp)</code></strong><br/> Ioctl  performs a variety of functions on open descriptors. In particular, many operating characteristics of character special files (device driver) can be controlled with ioctl requests.</p><p><strong><code>int close(int d)</code></strong><br/> The close call deletes a descriptor from the per-process object reference table. If this is the last reference to the underlying object, then it will be deactivated.</p></div><h4><a name="supported_ioctl_function_calls" id="supported_ioctl_function_calls">Supported IOCTL function calls</a></h4><div class="level4"><pre class="code c"><span class="coMULTI">/* * Function command codes for io_ctl. */</span><span class="co2">#define LCD_On			1</span><span class="co2">#define LCD_Off			2</span><span class="co2">#define LCD_Clear		3</span><span class="co2">#define LCD_Reset		4</span><span class="co2">#define LCD_Cursor_Left		5</span><span class="co2">#define LCD_Cursor_Right	6</span><span class="co2">#define LCD_Disp_Left		7</span><span class="co2">#define LCD_Disp_Right		8</span><span class="co2">#define LCD_Set_Cursor		10</span><span class="co2">#define LCD_Home		11</span><span class="co2">#define LCD_Curr_Controller	12</span><span class="co2">#define LCD_Cursor_Off		14</span><span class="co2">#define LCD_Cursor_On		15</span><span class="co2">#define LCD_Set_Cursor_Pos	17</span><span class="co2">#define LCD_Blink_Off           18</span><span class="co2">#define LCD_Contr           19</span></pre></div><!-- SECTION [2308-3677] --><h2><a name="driver_usage_example" id="driver_usage_example">Driver usage example</a></h2><div class="level2"><p> Following User Space example application shows how to open and close the device for write access. Several ioctls are used to configure the LCD device - for more details see 鈥

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -