linux spi 设置cs信号,【3518ev200】如何将SPI的CS引脚设置为高电平有效

问题已解决,海思spi1的cs0通道,一共4个管脚,分别是SCLK,SDO,SOI,CSN0,现将SCLK,SDO,SOI,映射为spi功能:

himm 0x200f0050 0x1

himm 0x200f0054 0x1

himm 0x200f0058 0x1

之后配置CSN0为GPIO输出管脚

himm 0x20180400 0x04

在程序中增加

#include #define GPIO00_BASE (0x20140000)

#define GPIO01_BASE (0x20150000)

#define GPIO02_BASE (0x20160000)

#define GPIO03_BASE (0x20170000)

#define GPIO04_BASE (0x20180000)

#define GPIO05_BASE (0x20190000)

#define GPIO06_BASE (0x201A0000)

#define GPIO07_BASE (0x201B0000)

#define GPIO08_BASE (0x201C0000)

#define GPIO09_BASE (0x201D0000)

#define GPIO10_BASE (0x201E0000)

#define GPIO11_BASE (0x201F0000)

unsigned int GPIO_REG[]=

{

GPIO00_BASE,

GPIO01_BASE,

GPIO02_BASE,

GPIO03_BASE

你可能感兴趣的:(linux,spi,设置cs信号)