2015-03-04 2 views
0

Ищем некоторую помощь, чтобы сделать работу LCD HY32D на Beagle Bone Black.Overlay LCD TFT 3,2 дюйма HY32D сделать это работает на Beagle Bone Black

Я подключил этот LCD под названием HY32D на следующий PIN ГЭБ:

"P8.45", // lcd: lcd_data0 
    "P8.46", // lcd: lcd_data1 
    "P8.43", // lcd: lcd_data2 
    "P8.44", // lcd: lcd_data3 
    "P8.41", // lcd: lcd_data4 
    "P8.42", // lcd: lcd_data5 
    "P8.39", // lcd: lcd_data6 
    "P8.40", // lcd: lcd_data7 
    "P8.37", // lcd: lcd_data8 
    "P8.38", // lcd: lcd_data9 
    "P8.36", // lcd: lcd_data10 
    "P8.34", // lcd: lcd_data11 
    "P8.35", // lcd: lcd_data12 
    "P8.33", // lcd: lcd_data13 
    "P8.31", // lcd: lcd_data14 
    "P8.32", // lcd: lcd_data15 

    "P9.12", // lcd RS: gpio1_28 
    "P9.42A", // lcd RD: gpio0_7 
    "P8.14", // lcd WR: gpio0_26 
    "P8.16", // lcd RESET: gpio1_14 

Тогда я нашел накладку под названием cape-bone-lcd3-00A0.dts, и я стараюсь, чтобы изменить его, чтобы приспособиться к LCD HY32D,

здесь модифицированный DTS: http://support.rfberrypi.com/download/BB-LCD-HY32D-00A0.dts

, но у меня нет большого опыта в написании накладки и часть, что мой главный вопрос я s Как я могу перенаправить вывод видео на этот оверлей?

ответ

0

Я решил решить проблему с драйвером для ЖК-дисплея. Сначала я написал накладку:

/dts-v1/; 
/plugin/; 

/{ 
     compatible = "ti,beaglebone", "ti,beaglebone-black"; 
     part-number = "lcd_my_try"; 
     version = "00A0"; 

     [email protected] { 
      target = <&am33xx_pinmux>; 

      __overlay__ { 
        pinctrl_test: lcd_my_try_Pins { 
      pinctrl-single,pins = < 

        0xa0 0x2f /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xa4 0x2f /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xa8 0x2f /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xac 0x2f /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xb0 0x2f /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xb4 0x2f /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xb8 0x2f /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xbc 0x2f /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xc0 0x2f /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xc4 0x2f /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xc8 0x2f /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xcc 0x2f /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xd0 0x2f /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xd4 0x2f /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xd8 0x2f /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 
        0xdc 0x2f /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ 

        0x78 0x2f // lcd_rs.lcd_rs, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT 
        0x164 0x2f // lcd_rd.lcd_rd, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT 
        0x28 0x2f // lcd_wr.lcd_wr, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT 
        0x38 0x2f // lcd_reset.lcd_reset, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT 
        0x30 0x2f // lcd_cs.lcd_cs, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT 

        0xec 0x07 // lcd_ac_bias_en.gpio2_25 OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT 

        //touch panel ADS7843 = XPT2046 
        0x34 0x2f // touch_cs.gpio1_13, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT (chip select) 
        0x7c 0x2f // touch_sck.gpio1_29, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT (clock) 
        0x3c 0x2f // touch_si.gpio1_15, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT (serial data in) 

        0x8c 0x2f // touch_irq.gpio2_1, OMAP_MUX_MODE0 | AM33XX_PIN_INPUT (interrupt on touch) 
        0x2c 0x2f // touch_so.gpio0_27, OMAP_MUX_MODE0 | AM33XX_PIN_INPUT (serial data output) 


      >; 
      }; 
      }; 
     }; 

     [email protected] { 
     target = <&ocp>; 
     __overlay__ { 
      test_helper: helper { 
       compatible = "bone-pinmux-helper"; 
       pinctrl-names = "default"; 
       pinctrl-0 = <&pinctrl_test>; 
       status = "okay"; 
      }; 
     }; 
    }; 
}; 

Я назвал его:

lcd_my_try.dts

Я составил его на ГЭБ с этой командой:

Dtc -O dtb -o lcd_my_try-00A0.dtbo -b 0 - @ lcd_my_try.dts

Тогда я загрузил его:

сП lcd_my_try-00A0.dtbo/Lib/прошивки эхо lcd_my_try>/системы/устройства/bone_capemgr */слотов

Я нагруженные название GPIO используется с bash со следующим содержимым:

#!/bin/bash 

echo "Loading GPIO into /sys/class/gpio/export" 

echo "Setting UP LCD_DATA_0" 
echo 70 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio70/direction 

echo "Setting UP LCD_DATA_1" 
echo 71 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio71/direction 

echo "Setting UP LCD_DATA_2" 
echo 72 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio72/direction 

echo "Setting UP LCD_DATA_3" 
echo 73 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio73/direction 

echo "Setting UP LCD_DATA_4" 
echo 74 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio74/direction 

echo "Setting UP LCD_DATA_5" 
echo 75 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio75/direction 

echo "Setting UP LCD_DATA_6" 
echo 76 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio76/direction 

echo "Setting UP LCD_DATA_7" 
echo 77 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio77/direction 

echo "Setting UP LCD_DATA_8" 
echo 78 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio78/direction 

echo "Setting UP LCD_DATA_9" 
echo 79 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio79/direction 

echo "Setting UP LCD_DATA_10" 
echo 80 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio80/direction 

echo "Setting UP LCD_DATA_11" 
echo 81 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio81/direction 

echo "Setting UP LCD_DATA_12" 
echo 8 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio8/direction 

echo "Setting UP LCD_DATA_13" 
echo 9 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio9/direction 

echo "Setting UP LCD_DATA_14" 
echo 10 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio10/direction 

echo "Setting UP LCD_DATA_15" 
echo 11 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio11/direction 

echo "Setting UP LCD_RS" 
echo 60 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio60/direction 

echo "Setting UP LCD_RD" 
echo 7 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio7/direction 

echo "Setting UP LCD_WR" 
echo 26 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio26/direction 

echo "Setting UP LCD_RESET" 
echo 46 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio46/direction 

echo "Setting UP LCD_CS" 
echo 44 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio44/direction 

echo "Setting UP LCD_BLVDD" 
echo 89 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio89/direction 

echo "----TOUCH PANEL----" 
echo "Setting UP TOUCH_CS" 
echo 45 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio45/direction 

echo "Setting UP TOUCH_SCK" 
echo 61 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio61/direction 

echo "Setting UP TOUCH_SI" 
echo 47 > /sys/class/gpio/export 
echo "out" > /sys/devices/virtual/gpio/gpio47/direction 

echo "Setting UP TOUCH_IRQ" 
echo 65 > /sys/class/gpio/export 
echo "in" > /sys/devices/virtual/gpio/gpio65/direction 

echo "Setting UP TOUCH_SO" 
echo 27 > /sys/class/gpio/export 
echo "in" > /sys/devices/virtual/gpio/gpio27/direction 

Наконец-то я был готов написать на ЖК-дисплее!