We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f3ff3d commit ac46099Copy full SHA for ac46099
src/modm/platform/spi/sam/spi_master.hpp.in
@@ -105,8 +105,10 @@ public:
105
106
static void
107
setDataMode(DataMode mode) {
108
- uint32_t value = (uint32_t)mode ^ 2; // Flip CPHA bit
109
- Regs()->SPI_CSR[0] = (Regs()->SPI_CSR[0] & ~(SPI_CSR_CPOL | SPI_CSR_NCPHA)) | (value << SPI_CSR_CPOL_Pos);
+ uint32_t value = (uint32_t)mode ^ 1; // Flip CPHA bit
+ Regs()->SPI_CSR[0] = (Regs()->SPI_CSR[0] & ~(SPI_CSR_CPOL | SPI_CSR_NCPHA)) |
110
+ (((value & 2) >> 1) << SPI_CSR_CPOL_Pos) |
111
+ ((value & 1) << SPI_CSR_NCPHA_Pos);
112
}
113
114
0 commit comments