最近做了sep4020 下的spi总线,对于spi下面的挂载ads7846触摸屏控制器,最近在做spi总线控制器实现触摸屏,不是原来的模拟的,做过程中发现问题很多,行才是不出数据,后来用逻辑分析仪抓数据,才发现很多的问题,现在算是实现了,但还有bug,继续调试,发帖纪念:
(具体的配置以后贴出来)
调试代码:
按屏后的dbg信息:
<7>spi_bitbang: bitbang_work: before in chipselect
<7>4020: ads7846_pendown_state: penflags = :0x0
<7>ADS7846: ads7846_irq: enter the ads7846_irq
<7>4020: ads7846_pendown_state: penflags = :0x0
<7>ADS7846: ads7846_irq: we are the end of ads7846_irq
<7>ADS7846: ads7846_irq: enter the ads7846_irq
<7>4020: ads7846_pendown_state: penflags = :0x1
<7>ADS7846: ads7846_irq: before hrtimer_start
<7>ADS7846: ads7846_irq: we are the end of ads7846_irq
<7>4020: ads7846_pendown_state: penflags = :0x1
<7>ads7846 spi0.0: txrx: tx c1c3f033, rx 00000000, len 1
<7>ads7846 spi0.0: txrx: tx 00000000, rx c1c3f03e, len 3
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>ADS7846: ads7846_rx_val: val=8c1
<7>spi_bitbang: bitbang_work: before in chipselect
<7>ads7846 spi0.0: txrx: tx c1c3f033, rx 00000000, len 1
<7>ads7846 spi0.0: txrx: tx 00000000, rx c1c3f03e, len 3
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>ADS7846: ads7846_rx_val: val=8c6
<7>spi_bitbang: bitbang_work: before in chipselect
<7>ads7846 spi0.0: txrx: tx c1c3f032, rx 00000000, len 1
<7>ads7846 spi0.0: txrx: tx 00000000, rx c1c3f03c, len 3
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>ADS7846: ads7846_rx_val: val=2a3
<7>spi_bitbang: bitbang_work: before in chipselect
<7>ads7846 spi0.0: txrx: tx c1c3f032, rx 00000000, len 1
<7>ads7846 spi0.0: txrx: tx 00000000, rx c1c3f03c, len 3
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>ADS7846: ads7846_rx_val: val=29f
<7>spi_bitbang: bitbang_work: before in chipselect
<7>ads7846 spi0.0: txrx: tx c1c3f034, rx 00000000, len 1
<7>ads7846 spi0.0: txrx: tx 00000000, rx c1c3f040, len 2
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>ADS7846: ads7846_rx_val: val=1c
<7>spi_bitbang: bitbang_work: before in chipselect
<7>ads7846 spi0.0: txrx: tx c1c3f034, rx 00000000, len 1
<7>ads7846 spi0.0: txrx: tx 00000000, rx c1c3f040, len 2
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>ADS7846: ads7846_rx_val: val=1c
<7>spi_bitbang: bitbang_work: before in chipselect
<7>ads7846 spi0.0: txrx: tx c1c3f035, rx 00000000, len 1
<7>ads7846 spi0.0: txrx: tx 00000000, rx c1c3f042, len 2
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>ADS7846: ads7846_rx_val: val=fe0
<7>spi_bitbang: bitbang_work: before in chipselect
<7>ads7846 spi0.0: txrx: tx c1c3f035, rx 00000000, len 1
<7>ads7846 spi0.0: txrx: tx 00000000, rx c1c3f042, len 2
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>ADS7846: ads7846_rx_val: val=fe0
<7>spi_bitbang: bitbang_work: before in chipselect
<7>ads7846 spi0.0: txrx: tx c1c3f036, rx 00000000, len 1
<7>ads7846 spi0.0: txrx: tx 00000000, rx c1c3f038, len 2
<7>spi_sep4020: sep4020_spi_txrx:
<7>spi_sep4020: sep4020_spi_txrx:
<7>ADS7846: ads7846_rx: we are in ads7846_rx!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<7>ADS7846: ads7846_rx: x is 0x:29f
<7>ADS7846: ads7846_rx: y is 0x:8f8
<7>ADS7846: ads7846_rx: z1 is 0x:1c
<7>ADS7846: ads7846_rx: z2 is 0xfe0
<7>ADS7846: ads7846_rx: ----------1-------------
<7>ADS7846: ads7846_rx: likely(x && z1) is 1
<7>ADS7846: ads7846_rx: ----------2-------------
<7>ADS7846: ads7846_rx: Rt is 17710
<7>ADS7846: ads7846_rx: ----------9------------
<7>ADS7846: ads7846_rx: value of ts->pendown is 1
<7>evbug.c: Event. Dev: input0, Type: 3, Code: 0, Value: 671
<7>evbug.c: Event. Dev: input0, Type: 3, Code: 1, Value: 2296
<7>evbug.c: Event. Dev: input0, Type: 3, Code: 24, Value: 17710
<7>evbug.c: Event. Dev: input0, Type: 0, Code: 0, Value: 0
<7>ADS7846: ads7846_rx: 671/2296/17710
<7>spi_bitbang: bitbang_work: before in chipselect
<7>4020: ads7846_pendown_state: penflags = :0x0
<7>ADS7846: ads7846_irq: enter the ads7846_irq
<7>4020: ads7846_pendown_state: penflags = :0x0
<7>ADS7846: ads7846_irq: we are the end of ads7846_irq