wiki:SvnDisplayL4M320T
Last modified 4 years ago Last modified on 05/18/13 21:08:48

disclaimer / info

THIS IS EXPERIMENTAL SOFTWARE AND HARDWARE. USE AT YOUR OWN RISK. THE MAINTAINER(S) OF THESE PAGES AND THE DEVELOPER(S) OF SOFTWARE AND HARDWARE PRESENTED ON THESE PAGES CAN NOT BE HELD LIABLE UNDER ANY CIRCUMSTANCES FOR DAMAGE TO HARDWARE OR SOFTWARE, LOST DATA, OR OTHER DIRECT OR INDIRECT DAMAGE RESULTING FROM THE USE OF THIS SOFTWARE OR HARDWARE. IF YOU DO NOT AGREE TO THESE CONDITIONS, YOU ARE NOT PERMITTED TO USE OR FURTHER DISTRIBUTE THIS SOFTWARE OR TO USE ANY TEMPLATES FOR BUILDING HARDWARE PRESENTED HERE.

  • this page deals with connecting a linux4media L4M320T display module to an usb port and drive it using serdisplib.
  • i'm not responsible for the content of external web pages
  • english is not my native language. please keep that in mind (corrections of english grammar and formulations are very welcome!)
  • use the most recent SVN trunk revision to test this driver

description

L4M320T is a colour display module with a touchscreen and optional support for IR-decoding of certain remote controls and is developed by linux4media.

specifications

resolution 240x320
colours 64k (16bit)
controller display: Himax HX8347-D(T) + Cypress CY8C24894 USB microcontroller
adjustable contrast yes
name in serdisplib "L4M320T" (example: serdisp_open(sdcd, "L4M320T", "");)
availability SVN trunk (2.x): yes
SVN 1.98.x branch: yes
SVN 1.97.x branch: no

connecting the L4M320T display module

intro

the controller board is not claimed by any standard kernel module and no kernel module providing ioctl is existing yet. thus only libusb is supported at the moment.

important

  • this driver supports two different categories of firmwares: one without and one with support for IR-controls.
  • firmware versions w/o support for IR have USB productID ee20, firmware versions with support for IR have productID ee21.
  • libusb needs to be installed on the system for serdisplib to be able to support this display module! (libusb will be dynamically loaded by serdisplib via dlopen()).

libusb

  • the vendor/production IDs for display modules w/o IR-support are: 4243/ee20 (hex)
  • the vendor/production IDs for display modules with IR-support are: 4243/ee21 (hex) or for newer controllers: 23ae'/ee21 (hex)
  • the device-string for accessing the dislay is: 'USB:4243/ee20', 'USB:4243/ee21', or 'USB:23ae/ee21''''respectivaly.
  • the following examples will contain vendor ID 4243. replace with 23ae if required.
  • the following examples will contain production ID ee21. replace with ee20 if required.
  • default device (valid for trunk (serdisplib version 2.x)): 'USB:4243/ee21'

examples

  • configuration in lcd4linux
     Display SerDispLib {
       Driver 'serdisplib'
       Port 'USB:4243/ee21'
       Model 'L4M320T'
     } 
    
  • configuration in graphlcd
     [serdisp]
     Driver=serdisp
     Device=USB:4243/ee21
     Controller=l4m320t
    
  • calling test program testserdisp
      testserdisp -n l4m320t -p 'USB:4243/ee21'
      testserdisp -n l4m320t -p 'USB:4243/ee21' -o 'BRIGHTNESS=50;ROTATE=90'
    

passing options through serdisp_init():

intro

using the third parameter of serdisp_init(), driver specific options can be set.
common information about passing options can be found in a separate document.

examples:

  serdisp_init(sdcd, "L4M320T", "INVERT=YES;ROTATE=90");
  serdisp_init(sdcd, "L4M320T", "BRIGHTNESS=80");

additional options

identifier short remark default
CONTRAST set display contrast 5
ALARMHOUR ALHOUR alarm hour 0
ALARMMINUTE ALMIN alarm minute 0
ALARMDAYS ALDAY alarm days (bitmask: %X6543210: bit 6: saturday, bit 5: friday, ..., bit 0: sunday) 0
TOUCHSKIP skip a defined amount of initial touch events (improves accuracy) 4
BRIGHTNESS sets brightness of display (by dimming current contrast level) 100
ALARMMODE when to set alarm (right at the beginning or when quitting the driver) 0

ranges, aliases

identifier range aliases
CONTRAST 0, 10
ALARMHOUR 0 - 23
ALARMMINUTE 0 - 59
ALARMDAYS 0 - 0x7F OFF=0,ALL=127
TOUCHSKIP 0 - 10 OFF=0,DEFAULT=4
BRIGHTNESS 0 - 100
ALARMMODE 0 - 3 POST=0,IMMEDIATE=1,POSTDELAY=2,IMMEDDELAY=3

examples for alarm:

"alhour=23;almin=30;alday=0x71" alarm at 23:30; 0x71 = %01110001 => alarm at saturday, friday, thursday, and sunday
"alhour=23;almin=30;alday=all" alarm at 23:30; all= all days
"alhour=23;almin=30;alday=0" alarm de-activated (because of alday=0)

tools

l4m320t_tool

this small utility is automatically compiled if serdisplib is configured with support for l4m320t-modules. it supports the following features:

  • firmware update
  • calibrate touchscreen
  • changing the boot logo(s)
  • setting alarm

the utility can be found in tools/ after compiling the library.

nota bene

some options only work with recent firmware versions!

usage

  l4m320t_tool [<options>]

  Options: (default values in squared brackets)
    -p dev|port      output device or port, default: 'USB:4243/ee21'
    -i               print firmware version information and serial number
    -B id        [0] show a stored bootlogo; id=[0, 2]
    -c value     [5] contrast / brightness; value=[0, 10]
    -a "HH:MM"       set alarm time
    -d "%6543210"    set alarm days (bit field, to be entered as hexadecimal or decimal)
                       bit 6: saturday   bit 5: friday
                       bit 4: thursday   bit 3: wednesday
                       bit 2: tuesday    bit 1: monday
                       bit 0: sunday
                     examples:
                       -d 0x7F: %1111111 -> all days
                       -d 0x41: %1000001 -> saturday and sunday
                       -d 0:    de-activate alarm
    -f imagefile(s)  change up to three bootlogos (240x320, readable by libgd)
    -u firmwarefile  update firmware (.hex or .bin)
    -C               calibrate touchscreen
    -y               enforce certain actions (e.g. overwrite newer firmware version with older one
    -1               display module with firmware version < '90D'
    -v               verbose (-v repeated: <= 2: log to syslog, >= 3: log to stderr, >= 5: log to stdout)
    -V               version information
  • image files for boot logos must meet the following requirements:
    • l4m320t has been compiled with libgd-support
    • Resolution: 240x320
    • processable by libgd

examples

  l4m320t_tool                                  # show default (= first) bootlogo
  l4m320t_tool -B 1                             # show second bootlogo
  l4m320t_tool -i                               # print firmware version and calibration information
  l4m320t_tool -p "USB:4243/ee21" -i            # same, but set custom device path
  l4m320t_tool -1                               # add -1 for firmware version without IR-support (prodID ee20)
  l4m320t_tool -C                               # calibrate touchscreen
  l4m320t_tool -u firmware.hex                  # flash new firmware (.hex or .bin, .bin additionally requires option -y)
  l4m320t_tool -y                               # force an action refused by the tool (eg. downgrading firmware)
  l4m320t_tool -f bootlogo.png                  # change first bootlogo
  l4m320t_tool -f bl0.png bl1.png bl2.png       # change all three bootlogos
  l4m320t_tool -a "23:30" -d 0x41               # set alarm at 23:30, saturday (bit6) and sunday (bit0)
  l4m320t_tool -a "23:30" -d 0x7F               # set alarm at 23:30, all days
  l4m320c_tool -a "23:30" -d all                # set alarm at 23:30, all days (all = alias for '0x7F')
  l4m320c_tool -d 0                             # de-activate alarm

some images

http://serdisplib.sourceforge.net/ser/images/l4m320t_custombootlogo.jpg http://serdisplib.sourceforge.net/ser/images/l4m320t_calibration.jpg

  • first image: custom bootlogo, uploaded with l4m320t_tool
  • second image: calibrating the touchscreen

history

  • 2010-10-17: first release of documentation