Hi,
I want direct register configuration for SPI configure in TM4C1294NCPDT controller.
Any example code is suggest me.
Thanks & Regard,
Vijay
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I want direct register configuration for SPI configure in TM4C1294NCPDT controller.
Any example code is suggest me.
Thanks & Regard,
Vijay
Hi,
We provide TivaWare SDK with peripheral drivers to abstract users from the hardware. We don't have any examples that use DRM (direct register manipulation) style of coding. However, you can easily look at any one of the SPI API source code to understand how SPI registers are used for operations. You can also refer to the datasheet. The device datasheet contains the full registers description. It is a matter of writing and reading the registers at their specified addresses. Below is a snippet of code to write data to the SPI data register. Refer to C:\ti\TivaWare_C_Series-2.2.0.295\driverlib\ssi.c file.
void SSIDataPut(uint32_t ui32Base, uint32_t ui32Data) { // // Check the arguments. // ASSERT(_SSIBaseValid(ui32Base)); ASSERT((ui32Data & (0xfffffffe << (HWREG(ui32Base + SSI_O_CR0) & SSI_CR0_DSS_M))) == 0); // // Wait until there is space. // while(!(HWREG(ui32Base + SSI_O_SR) & SSI_SR_TNF)) { } // // Write the data to the SSI. // HWREG(ui32Base + SSI_O_DR) = ui32Data; }
Hi Charles,
I am aware of the availability of APIs and how they operate. However, when I examined the API code, I discovered that the register address differed significantly from the datasheet's direct register address.
How can I use DRM (direct register manipulation) to send and receive data and configure SPI (SSI)? What are the specific steps in the process?
Thanks & Regards,
Vijay
The base addresses for QSSI modules are listed in the datasheet. You need to use these registers. They are matching the hw_memmap.h file.
Hi Charles,
What are the Steps to follow to Configure the SSI Register?
can you explain the Step by step Register Configure method?
Thanks & Regards,
Vijay
Why don't you run a simple example in C:\ti\TivaWare_C_Series-2.2.0.295\examples\peripherals\ssi\spi_master.c and single step through the source code and it gives you step by step how the APIs use DRM to setup all the registers.
Just to give you a simple example to write to a register. Let's say you want to write a random value 0x1234 to the SSIDR register in the SSI0 module.
HWREG(SSI0_BASE + SSI_O_DR) = 0x1234;