diff --git a/include/fw_spi.h b/include/fw_spi.h index f860a5b..4767f3e 100644 --- a/include/fw_spi.h +++ b/include/fw_spi.h @@ -92,5 +92,6 @@ typedef enum #define SPI_SetPort(__ALTER_PORT__) (P_SW1 = P_SW1 & ~(0x03 << 2) | ((__ALTER_PORT__) << 2)) uint8_t SPI_TxRx(uint8_t dat); +void SPI_TxRxBytes(uint8_t *pBuf, uint8_t len); #endif diff --git a/src/fw_spi.c b/src/fw_spi.c index 71b9584..ec4a6e4 100644 --- a/src/fw_spi.c +++ b/src/fw_spi.c @@ -24,3 +24,11 @@ uint8_t SPI_TxRx(uint8_t dat) SPI_ClearInterrupts(); return SPDAT; } + +void SPI_TxRxBytes(uint8_t *pBuf, uint8_t len) +{ + while(len--) + { + *pBuf++ = SPI_TxRx(*pBuf); + } +} \ No newline at end of file