using SPI2 with imx6ullevk user space

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

using SPI2 with imx6ullevk user space

772 次查看
fabio_poiatti
Contributor III

I would like to use SPI2 connected to accelerometer LSM6DSL.

I modified the DTS file including

&ecspi2 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 22 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2_1 &pinctrl_ecspi2_cs_1>;
status = "okay";

spidev2@0x00 {
compatible = "spidev";
spi-max-frequency = <5000000>;
reg = <0>;
};
};

pinctrl_ecspi2_cs_1: ecspi2_cs_grp-1 {
fsl,pins = <
MX6UL_PAD_CSI_DATA01__GPIO4_IO22 0x10b0
>;
};

pinctrl_ecspi2_1: ecspi2grp-1 {
fsl,pins = <
MX6UL_PAD_CSI_DATA02__ECSPI2_MOSI 0x100b1
MX6UL_PAD_CSI_DATA03__ECSPI2_MISO 0x100b1
MX6UL_PAD_CSI_DATA00__ECSPI2_SCLK 0x100b1
>;
};

I see /dev/spidev1.0 .... but how can I try to communicate with the accelerometer?

Can I read and write on SPI like an USB or UART etc. with some command in user space like

cat < /dev/spidev1.0 

?

0 项奖励
回复
2 回复数

720 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Fabio

one can check variscite spidev tutorial:

DART-6UL SPI - Variscite Wiki 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

720 次查看
fabio_poiatti
Contributor III

thanks

0 项奖励
回复