Skip to content

Commit 748b600

Browse files
committed
add some notes to the SPI functions (aligned to 32Bit)
- Fatal exception (9)
1 parent 0d376cb commit 748b600

File tree

1 file changed

+24
-0
lines changed
  • hardware/esp8266com/esp8266/libraries/SPI

1 file changed

+24
-0
lines changed

hardware/esp8266com/esp8266/libraries/SPI/SPI.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,13 @@ void SPIClass::write32(uint32_t data, bool msb) {
308308
while(SPI1CMD & SPIBUSY) {}
309309
}
310310

311+
/**
312+
* Note:
313+
* data need to be aligned to 32Bit
314+
* or you get an Fatal exception (9)
315+
* @param data uint8_t *
316+
* @param size uint32_t
317+
*/
311318
void SPIClass::writeBytes(uint8_t * data, uint32_t size) {
312319
while(size) {
313320
if(size > 64) {
@@ -340,6 +347,15 @@ void SPIClass::writeBytes_(uint8_t * data, uint8_t size) {
340347
while(SPI1CMD & SPIBUSY) {}
341348
}
342349

350+
351+
/**
352+
* Note:
353+
* data need to be aligned to 32Bit
354+
* or you get an Fatal exception (9)
355+
* @param data uint8_t *
356+
* @param size uint8_t max for size is 64Byte
357+
* @param repeat uint32_t
358+
*/
343359
void SPIClass::writePattern(uint8_t * data, uint8_t size, uint32_t repeat) {
344360
if(size > 64) return; //max Hardware FIFO
345361

@@ -376,6 +392,14 @@ void SPIClass::writePattern_(uint8_t * data, uint8_t size, uint8_t repeat) {
376392
writeBytes(&buffer[0], bytes);
377393
}
378394

395+
/**
396+
* Note:
397+
* in and out need to be aligned to 32Bit
398+
* or you get an Fatal exception (9)
399+
* @param out uint8_t *
400+
* @param in uint8_t *
401+
* @param size uint32_t
402+
*/
379403
void SPIClass::transferBytes(uint8_t * out, uint8_t * in, uint32_t size) {
380404
while(size) {
381405
if(size > 64) {

0 commit comments

Comments
 (0)