cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
639 Views
Registered: ‎09-16-2019

AXI Quad Spi, how do I set the SPICR register in my C code?

Jump to solution

Hello,

I would like to manually control the slave select line for the Quad SPI peripheral at a certain point in my C code. In PG153 I have read that bit[7] of the SPICR register can be used to toggle the slave select. However, I do not see any examples on how to do this in C code. 

My Quad SPI is set up as follows in my C code:

 

 

ConfigPtr_spi = XSpi_LookupConfig(XPAR_AXI_QUAD_SPI_0_DEVICE_ID);
	Status = XSpi_CfgInitialize(&Spi_AXI, ConfigPtr_spi,XPAR_AXI_QUAD_SPI_0_BASEADDR);
	Status = XSpi_SetOptions(&Spi_AXI, XSP_MASTER_OPTION | XSP_MANUAL_SSELECT_OPTION |  XSP_CLK_PHASE_1_OPTION);
	XSpi_Start(&Spi_AXI);
	XSpi_IntrGlobalDisable(&Spi_AXI);
	XSpi_SetSlaveSelect(&Spi_AXI, 0x01);

 

Thank you for your time. 

 

 

0 Kudos
1 Solution

Accepted Solutions
582 Views
Registered: ‎09-16-2019

So after some experimentation and grasping in the dark, I found out that the function to control the SS is:

XSpi_SetSlaveSelect(&Spi_AXI, 0x00000000);  for SS off

XSpi_SetSlaveSelect(&Spi_AXI, 0x00000001);  for SS on 

 

 

 

 

View solution in original post

0 Kudos
2 Replies
583 Views
Registered: ‎09-16-2019

So after some experimentation and grasping in the dark, I found out that the function to control the SS is:

XSpi_SetSlaveSelect(&Spi_AXI, 0x00000000);  for SS off

XSpi_SetSlaveSelect(&Spi_AXI, 0x00000001);  for SS on 

 

 

 

 

View solution in original post

0 Kudos
576 Views
Registered: ‎09-16-2019

But not exactly, I'm still working on this. 

0 Kudos