RTOS_MSPM0  1.1
ECE445M starter code
Macros | Functions
SPI1.h File Reference

Synchronous serial communication. More...

Go to the source code of this file.

Macros

#define SDC_CS   GPIOB
 
#define SDC_CS_PIN   (1<<0)
 
#define SDC_CS_INDEX   (PB0INDEX)
 
#define SDC_CS_LOW()   (SDC_CS->DOUTCLR31_0 = SDC_CS_PIN)
 
#define SDC_CS_HIGH()   (SDC_CS->DOUTSET31_0 = SDC_CS_PIN)
 
#define TFT_CS   GPIOB
 
#define TFT_CS_PIN   (1<<6)
 
#define TFT_CS_INDEX   (PB6INDEX)
 
#define TFT_CS_LOW()   (TFT_CS->DOUTCLR31_0 = TFT_CS_PIN)
 
#define TFT_CS_HIGH()   (TFT_CS->DOUTSET31_0 = TFT_CS_PIN)
 
#define TFT_DC   GPIOB
 
#define TFT_DC_PIN   (1<<16)
 
#define TFT_DC_INDEX   (PB16INDEX)
 
#define TFT_DC_LOW()   (TFT_DC->DOUTCLR31_0 = TFT_DC_PIN)
 
#define TFT_DC_HIGH()   (TFT_DC->DOUTSET31_0 = TFT_DC_PIN)
 
#define TFT_RST   GPIOB
 
#define TFT_RST_PIN   (1<<15)
 
#define TFT_RST_INDEX   (PB15INDEX)
 
#define TFT_RST_LOW()   (TFT_RST->DOUTCLR31_0 = TFT_RST_PIN)
 
#define TFT_RST_HIGH()   (TFT_RST->DOUTSET31_0 = TFT_RST_PIN)
 

Functions

void SPI_OutData (char data)
 Output data. More...
 
void SPI_OutCommand (char command)
 Output command. More...
 
void SPI1_Reset (void)
 Reset LCD. More...
 
void CS_Init (void)
 SDC CS initialization. More...
 
void SPI1_Init (void)
 initialize SPI1 More...
 
void TFT_OutCommand (char command)
 Output command. More...
 
void TFT_OutData (char data)
 Output data. More...
 

Detailed Description

Synchronous serial communication.

SPI uses a chip select, clock, data out and data in. This interface is used for TFT and SDC This interface can be used for MKII LCD and the ST7735R LCD

Version
RTOS v7.0
Author
Daniel Valvano and Jonathan Valvano
Warning
AS-IS
Note
For more information see http://users.ece.utexas.edu/~valvano/
Date
Dec 27, 2025
SPI-LCD pins
Pin Function Description
PB9 SPI1 SCLK <tdLCD SPI clock (SPI)
PB6 GPIO CS LCD SPI CS
PB0 GPIO CS SDC SPI CS
PB8 SPI1 PICO LCD SPI data (SPI)
PB7 SPI1 POCI SCD SPI data (SPI)
PB15GPIO J2.17 LCD !RST =1 for run, =0 for reset
PB16GPIO J4.31 LCD D/C RS =1 for data, =0 for command