ecspi cspi spi imx53qsb expansion slot J13

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ecspi cspi spi imx53qsb expansion slot J13

1,568 Views
kurt1z
Contributor I

Hi,

I like to connect a DA converter on one of the spi port on the expansion slot.

Where can a find a example to make  /dev/spi ... visible in the device list.

Or how can I control it from userspace (bitbang)

I see in /sys/class/spi_master and /sys/class/spi_dev.

thanks.

greetz

Labels (1)
Tags (3)
0 Kudos
5 Replies

826 Views
jimmychan
NXP TechSupport
NXP TechSupport

826 Views
kurt1z
Contributor I

Hi Jimmy,

are these instructions all for mx53_loco.c file ?

gr.

Kurt

0 Kudos

826 Views
jimmychan
NXP TechSupport
NXP TechSupport

I think you can try those in the mx53_loco.c.

0 Kudos

826 Views
kurt1z
Contributor I

I have changed the code, and works fine now for 8bit data.

But when I'm trying to use a 16bit word, the last byte is always wrong.

struct spi_ioc_transfer tr[2];

unsigned char tx0[12];

tx0[0] = 0x01;

tx0[1] = 0x00;

tx0[2] = 0x02;

tx0[3] = 0x00;

tx0[4] = 0x03;

tx0[5] = 0x00;

tx0[6] = 0x04;

tx0[7] = 0x00;

unsigned char rx0[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0};

tr[0].tx_buf = (__u64) &tx0[0];//Data2Transmit;//tx[0];//(__u64) Data2Transmit;

tr[0].rx_buf = (__u64) rx0;//Data2Receive;//rx[0];

tr[0].len=4;

tr[0].cs_change=false;

ret = ioctl(fd,SPI_IOC_MESSAGE(1),&tr[0]);

0 Kudos

826 Views
jimmychan
NXP TechSupport
NXP TechSupport

There is a spi test(mxc_spi_test) in imx-test package.

./ltib -p imx-test -m prep   (extract the sourece code from /opt/freescale/pkgs/ to ltib/rpm/BUILD/)

then you can modify the code.

./ltib -p imx-test -m scbuild   (build the source code again if you modified it)

./ltib -p imx-test -m scdeploy  (install the package to rootfs again after built)

The test code is testing the different bit length. Please try it.

0 Kudos