| RTOS_MSPM0 1.1 ECE445M starter code

SPI1.h
Go to the documentation of this file.
1
40 #ifndef __SPI_H__
41 #define __SPI_H__
42
43
44 // PB0 output used for SDC CS
45 #define SDC_CS GPIOB
46 #define SDC_CS_PIN (1<<0) // CS controlled by software
47 #define SDC_CS_INDEX (PB0INDEX) // PB0 GPIO
48 #define SDC_CS_LOW() (SDC_CS->DOUTCLR31_0 = SDC_CS_PIN) // PB0 low
49 #define SDC_CS_HIGH() (SDC_CS->DOUTSET31_0 = SDC_CS_PIN) // PB0 high
50
51 // PB6 output used for SDC CS
52 //#define TFT_CS_LOW() (GPIOB->DOUTCLR31_0 = (1<<6)) // PB6 low
53 //#define TFT_CS_HIGH() (GPIOB->DOUTSET31_0 = (1<<6)) // PB6 high
54 #define TFT_CS GPIOB
55 #define TFT_CS_PIN (1<<6) // TFT CS controlled by software
56 #define TFT_CS_INDEX (PB6INDEX) // PB6 GPIO
57 #define TFT_CS_LOW() (TFT_CS->DOUTCLR31_0 = TFT_CS_PIN) // PB6 low
58 #define TFT_CS_HIGH() (TFT_CS->DOUTSET31_0 = TFT_CS_PIN) // PB6 high
59
60 #define TFT_DC GPIOB
61 #define TFT_DC_PIN (1<<16) // D/C controlled by software
62 #define TFT_DC_INDEX (PB16INDEX) // PB16 GPIO
63 #define TFT_DC_LOW() (TFT_DC->DOUTCLR31_0 = TFT_DC_PIN) // PB16 low
64 #define TFT_DC_HIGH() (TFT_DC->DOUTSET31_0 = TFT_DC_PIN) // PB16 high
65
66 #define TFT_RST GPIOB
67 #define TFT_RST_PIN (1<<15) // !RST controlled by software
68 #define TFT_RST_INDEX (PB15INDEX) // PB15 GPIO
69 #define TFT_RST_LOW() (TFT_RST->DOUTCLR31_0 = TFT_RST_PIN) // PB15 low
70 #define TFT_RST_HIGH() (TFT_RST->DOUTSET31_0 = TFT_RST_PIN) // PB15 high
71
72
80 void SPI_OutData(char data);
81
89 void SPI_OutCommand(char command);
90
101 void SPI1_Reset(void);
102
103 // SDC CS initialization
104 void CS_Init(void);
105
122 void SPI1_Init(void);
123
124 //---------TFT_OutCommand------------
125 // Output 8-bit command to SPI port
126 // Input: data is an 8-bit data to be transferred
127 // Output: none
128 void TFT_OutCommand(char command);
129
137 void TFT_OutData(char data);
138
139 #endif // __SPI_H__
CS_Init
void CS_Init(void)
Configure SDC chip select.
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.
TFT_OutData
void TFT_OutData(char data)
Output data.
SPI_OutData
void SPI_OutData(char data)
Output data.