MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / flash_read_command

Function flash_read_command

core/flash.c:160–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158 }
159}
160static uint8_t flash_read_command(bool peek) {
161 (void)peek;
162 switch (flash.command[0xF]) {
163 case 0x05: // Read Status Register-1
164 return flash.commandStatus[1];
165 case 0x35: // Read Status Register-2
166 return flash.commandStatus[2];
167 case 0x15: // Read Status Register-3
168 return flash.commandStatus[3];
169 case 0xAB: // Release Power-down / Device ID
170 flash.commandAddress = 1;
171 // fallthrough
172 case 0x90: // Read Manufacturer / Device ID
173 case 0x92: // Read Manufacturer / Device ID Dual I/O
174 case 0x94: // Read Manufacturer / Device ID Quad I/O
175 return 0xEF15 >> (~flash.commandAddress++ & 1) * 8;
176 case 0x4B: // Read Unique ID Number
177 return flash.uniqueID >> (~flash.commandAddress++ & 7) * 8;
178 case 0x9F: // Read JEDEC ID
179 if (flash.commandAddress >= 3) {
180 flash.commandAddress = 0;
181 }
182 return 0xEF4016 >> (2 - flash.commandAddress++) * 8;
183 }
184 return 0;
185}
186static void flash_write_command(uint8_t byte) {
187 switch (flash.command[0xF]) {
188 case 0x32: // Quad Input Page Program

Callers 1

flash_readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected