MCF52259 QSPI 5 Chip select

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

MCF52259 QSPI 5 Chip select

1,409 次查看
fcorra
Contributor I

Hi,

 

i'm working on a custom board with 3 internal (cs0,cs2,cs3 ) + 2 external (gpio) chip select for spi device.

 

I got a look at the driver code and found that the ioctl  install the callback function

as:

 

 callbacks = (SPI_CS_CALLBACK_STRUCT_PTR)(param_ptr);
                for (num = 0; num < MCF5XXX_QSPI_CS_COUNT; num++)
                {
                    if (0 != (callbacks->MASK & (1 << num)))
                    {
                        io_info_ptr->CS_CALLBACK[num] = callbacks->CALLBACK;
                        io_info_ptr->CS_USERDATA[num] = callbacks->USERDATA;
                    }               

 

The internal structure has a callback function and userdata for each CS but install the same values on each CS.

 

the MCF5XXX_QSPI_CS_COUNT is defined as 4, this is the total CS count (included CS0,CS2,CS3 ) or just the callback managed CS?

 

if it is the total CS count how can i manage 5 CS? Do i need to modify the driver code?

 

Thanks

 

fulvio

 

 

 

 

0 项奖励
回复
1 回复

995 次查看
PetrM
Senior Contributor I

You can call this IOCTL five times, each time with MASK set to different CS and with different callback to have it separated.

 

I'm affraid you'll have to set the MCF5XXX_QSPI_CS_COUNT to 6 and recompile BSP for your purpose. It's total number of CSs. And you'll have to come up with your own bit definitions of CS4 and CS5 (external).

 

PetrM

 

0 项奖励
回复