TI工程师您好!
我目前遇到的问题是,如何将3352 SPI1的CS配置为GPIO CS功能,然后通过软件控制CS?
Linux版本:3.2
ADS1220片选为AM3352 SPI1的SPI1_CS0管脚.
问题描述:
AM3352的SPI1上接了一个ADS1220,将CS设置成SPI1硬CS(即SPI1_CS0功能)读写ADS1220成功,由于想使用ADS1220的DOUT/RDY管脚中断功能,故ADS1220的CS在AD转换期间须保持低电平时ADS1220才会有转换完成中断输出.
看了内核的代码,spi_board_info中有个controller_data成员,应该是用omap2_mcspi_cs结构体初始化,但是查看源码,实在不知道如何初始化omap2_mcspi_cs结构体?网络搜索也没有此类应用.
user1490342:
#define ADS1220_IRQ_GPIOGPIO_TO_PIN(3, 15)
#define ADS1220_CS_GPIOGPIO_TO_PIN(3, 17)static struct omap2_mcspi_cs ads1220_spi1_csinfo = {.base = ioremap(AM33XX_GPIO3_BASE, SZ_64), //GPIO3_17,SZ_??.phys = 17? or 1<<17? or??, //?.word_len = 8, //SPI one transfer bits size?.node = ?//??.chconf0 = 0,//??
};static struct spi_board_info am335x_spi1_slave_info[] = {{.modalias= "ads1220",.irq= OMAP_GPIO_IRQ(ADS1220_IRQ_GPIO),.max_speed_hz= 5000000, //min 150ns=6.666MHz.bus_num= 2,//start at 1.mode = SPI_MODE_1,.chip_select= 0,.platform_data = &ads1220_data,.controller_data = &ads1220_spi1_csinfo,},
};