| RTOS_MSPM0 1.1 ECE445M starter code

SPI.h
Go to the documentation of this file.
1
104 #ifndef __SPI_H__
105 #define __SPI_H__
106
107
108 // PB0 output used for SDC CS
109 #define SDC_CS GPIOB
110 #define SDC_CS_PIN (1<<0) // CS controlled by software
111 #define SDC_CS_INDEX (PB0INDEX) // PB0 GPIO
112 #define SDC_CS_LOW() (SDC_CS->DOUTCLR31_0 = SDC_CS_PIN) // PB0 low
113 #define SDC_CS_HIGH() (SDC_CS->DOUTSET31_0 = SDC_CS_PIN) // PB0 high
114
115 // PB6 output used for SDC CS
116 //#define TFT_CS_LOW() (GPIOB->DOUTCLR31_0 = (1<<6)) // PB6 low
117 //#define TFT_CS_HIGH() (GPIOB->DOUTSET31_0 = (1<<6)) // PB6 high
118 #define TFT_CS GPIOB
119 #define TFT_CS_PIN (1<<6) // TFT CS controlled by software
120 #define TFT_CS_INDEX (PB6INDEX) // PB6 GPIO
121 #define TFT_CS_LOW() (TFT_CS->DOUTCLR31_0 = TFT_CS_PIN) // PB6 low
122 #define TFT_CS_HIGH() (TFT_CS->DOUTSET31_0 = TFT_CS_PIN) // PB6 high
123
124 #define TFT_DC GPIOB
125 #define TFT_DC_PIN (1<<16) // D/C controlled by software
126 #define TFT_DC_INDEX (PB16INDEX) // PB16 GPIO
127 #define TFT_DC_LOW() (TFT_DC->DOUTCLR31_0 = TFT_DC_PIN) // PB16 low
128 #define TFT_DC_HIGH() (TFT_DC->DOUTSET31_0 = TFT_DC_PIN) // PB16 high
129
130 #define TFT_RST GPIOB
131 #define TFT_RST_PIN (1<<15) // !RST controlled by software
132 #define TFT_RST_INDEX (PB15INDEX) // PB15 GPIO
133 #define TFT_RST_LOW() (TFT_RST->DOUTCLR31_0 = TFT_RST_PIN) // PB15 low
134 #define TFT_RST_HIGH() (TFT_RST->DOUTSET31_0 = TFT_RST_PIN) // PB15 high
135
136
144 void SPI_OutData(char data);
145
153 void SPI_OutCommand(char command);
154
165 void SPI1_Reset(void);
166
177 void CS_Init(void);
178
195 void SPI1_Init(void);
196
197
205 void TFT_OutCommand(char command);
206
214 void TFT_OutData(char data);
215
216 #endif // __SPI_H__
TFT_OutCommand
void TFT_OutCommand(char command)
Output command.
SPI_OutCommand
void SPI_OutCommand(char command)
Output command.
SPI1_Init
void SPI1_Init(void)
initialize SPI1
SPI1_Reset
void SPI1_Reset(void)
Reset LCD.
CS_Init
void CS_Init(void)
SDC CS initialization.
TFT_OutData
void TFT_OutData(char data)
Output data.
SPI_OutData
void SPI_OutData(char data)
Output data.