MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / modSPIActivateConfiguration

Function modSPIActivateConfiguration

modules/pins/spi/esp/modSPI.c:107–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void modSPIActivateConfiguration(modSPIConfiguration config)
108{
109 modSPIFlush();
110
111 if (config == gConfig)
112 return;
113
114 if (gConfig) {
115 (gConfig->doChipSelect)(0, gConfig);
116 if (!config) {
117 gConfig = config;
118 return;
119 }
120 if (config->reserved == gConfig->reserved) {
121 gConfig = config;
122 (gConfig->doChipSelect)(1, gConfig);
123 return;
124 }
125 }
126
127 gConfig = config;
128 if (gConfig) {
129 WRITE_PERI_REG(SPI_FLASH_CLOCK(HSPI), gConfig->reserved);
130
131 (gConfig->doChipSelect)(1, gConfig);
132 }
133
134 if (config)
135 modSPISetMode(config->mode);
136}
137
138// data must be long aligned
139uint8_t ICACHE_RAM_ATTR modSpiLoadBufferAsIs(uint8_t *data, uint8_t bytes)

Callers 15

modSPIUninitFunction · 0.70
modSPITxRxFunction · 0.70
modSPITxCommonFunction · 0.70
ili9341CommandFunction · 0.50
powerDownFunction · 0.50
writeRegisterSPI_8Function · 0.50
readRegisterSPI_FIFOFunction · 0.50
readRegisterSPI_8Function · 0.50
destm32sCommandFunction · 0.50
lpm013m126aSendFunction · 0.50
lpm013m126aEndFunction · 0.50
lpm013m126aHoldFunction · 0.50

Calls 2

modSPISetModeFunction · 0.85
modSPIFlushFunction · 0.70

Tested by

no test coverage detected