cv22 enable adc(iio) @ 071's blog :: 隨意窩 Xuite日誌
    1. 沒有新回應!
  • 201812280922cv22 enable adc(iio)

    //至下列目錄執行make menuconfig,打開相關功能後, 再make
    workspace\cv22\cv22_linux_sdk\ambarella\boards\cv22_walnut
    make menuconfig
    make

    //執行 make menuconfig_public_linux 修改內容會在 cv22_linux_sdk\ambarella\out\cv22_walnut\kernel\linux-4.14_emmc\.config
    //請手動修改到 cv22_linux_sdk\ambarella\boards\cv22_walnut\config\kernel\cv22_walnut_emmc_kernel_config
    //再到最外層去執行 make
    make menuconfig_public_linux


    // iio/adc driver 's source code location
    cv22_linux_sdk\ambarella\kernel\linux-4.14\drivers\iio\adc
    //產生的driver 位於
    cv22_linux_sdk\ambarella\out\cv22_walnut\kernel\linux-4.14_emmc\drivers\iio\adc\ambarella_adc.ko
    //pwd燒錄至camera之後所在的位置
    /lib/modules/4.14.28/kernel/drivers/iio/adc

    //原本 lsiio 不會列出任何東西
    // 且 /sys/bus/iio/devices 也沒有長出任何東西
    //須修改下面這個檔案, 再重新做版本
    cv22_linux_sdk\ambarella\kernel\linux-4.14\arch\arm64\boot\dts\ambarella\ambarella-cv22.dtsi
    找到 adc@e4003000
    status = "disabled"; 改成 status = "ok";

    // cv22_walnut.dts 是針對 cv22_walnut driver的設定
    cv22_linux_sdk\ambarella\boards\cv22_walnut\bsp\cv22_walnut.dts


    cd /lib/modules/4.14.28/kernel/drivers/iio/adc
    wget ftp://nexcom:broadwin@10.50.1.36/workspace/cv22/cv22_linux_sdk/ambarella/out/cv22_walnut/kernel/linux-4.14_emmc/drivers/iio/adc/ambarella_adc.ko;chmod 664 ambarella_adc.ko

     

    modinfo ambarella_adc.ko
    modprobe -r ambarella_adc
    modprobe ambarella_adc

    echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage1_en
    echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage3_en

    cd /sys/bus/iio/devices/iio:device0
    //按公版上的上下左右鍵, 此時去讀值應該會有變化
    cat in_voltage1_raw


    iio_generic_buffer -n e4003000.adc
    iio_event_monitor e4003000.adc

    ALSA audio library (CV22)|日誌首頁|cv22 ambausb (no GUI)上一篇ALSA audio library (CV22)下一篇cv22 ambausb (no GUI)
    回應