1268˹עӡ

⣺ETA105ģ

˧Ӵߣ
TPCK
С  1¥ | Ϣ | | | ҳ


Ӻ
ȼ·
ETA105ģ   Post By2019-8-23 17:17:00 [ֻ]

ͨSPIȡETA105ģһֱ-1Ҳ˵úģʾ


  | | ظ ص
˧Ӵߣ
hzc
С  2¥ | Ϣ | | | ҳ


Ӻ Ա
ȼְҵ
   Post By2019-8-23 17:36:00 [ֻ]

ãʹõͺʲôϵͳLinuxWinCEأ


  | | ظ ص
С  3¥


   Post By2019-8-26 9:36:00 [ֻ]

ESM6800 V4.1ϵͳLinux


  | | ظ ص
С  4¥


   Post By2019-8-26 14:09:00 [ֻ]

    unsigned char mode = 1;

    unsigned char bits = 16;

    unsigned int  speed = 1000000;

    int fd = open("/dev/spidev1.0",O_RDWR);

    if(fd<0)

    {

        perror("can't open device");

        return fd;

    }

    int ret = ioctl(fd,SPI_IOC_WR_MODE,&mode);

    if(ret == -1)

    {

        perror("can't set spi mode");

        close(fd);

        return ret;

    }

    ret = ioctl(fd,SPI_IOC_WR_BITS_PER_WORD,&bits);

    if(ret == -1)

    {

        perror("can't set spi bits");

        close(fd);

        return ret;

    }

    ret = ioctl(fd,SPI_IOC_WR_MAX_SPEED_HZ,&speed);

    if(ret == -1)

    {

        perror("can't set spi speed");

        close(fd);

        return ret;

    }

    char data[16] = {0};

    struct spi_ioc_transfer tr;

        //short temp[128] = {0};

    tr.tx_buf = NULL;

    tr.rx_buf = (unsigned long)data;

    tr.len = 16;

    tr.delay_usecs = 0;

    tr.speed_hz = 1000000;

    tr.bits_per_word = 16;

    int len = ioctl(spi, SPI_IOC_MESSAGE(1), tr);    //return -1

ҵĴ룬Թ޸ģʽٶȵֵЧ



  | | ظ ص
С  5¥


   Post By2019-8-26 14:13:00 [ֻ]

˵ioctl(spi, SPI_IOC_MESSAGE(1), tr);еspiʵǰfdֻڲͬĺԲһ


  | | ظ ص
˧Ӵߣ
hzc
С  6¥ | Ϣ | | | ҳ


Ӻ Ա
ȼְҵ
   Post By2019-8-27 10:30:00 [ֻ]

,Ļһ,ǻETA105̷㡣


  | | ظ ص
С  7¥


   Post By2019-8-27 13:17:00 [ֻ]


  | | ظ ص
˧Ӵߣ
hzc
С  8¥ | Ϣ | | | ҳ


Ӻ Ա
ȼְҵ
   Post By2019-8-27 14:04:00 [ֻ]

ãѾͣա


  | | ظ ص

ذб

ETA105ģ

û          
ݣ
               ǩ
 
友情链接: 218vfk.space    ft725.space