8000 cc3200: Fix SPI clock divider calculation. · rpavlik/circuitpython@f67d061 · GitHub
[go: up one dir, main page]

Skip to content

Commit f67d061

Browse files
author
danicampora
committed
cc3200: Fix SPI clock divider calculation.
1 parent d0601b0 commit f67d061

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

cc3200/hal/spi.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -782,23 +782,17 @@ SPIConfigSetExpClk(unsigned long ulBase,unsigned long ulSPIClk,
782782
}
783783

784784
//
785-
// Mask the configurations and set clock divider granularity
786-
// to 1 cycle
785+
// set clock divider granularity to 1 cycle
787786
//
788-
ulRegData = (ulRegData & (~(MCSPI_CH0CONF_WL_M |
789-
MCSPI_CH0CONF_EPOL |
790-
MCSPI_CH0CONF_POL |
791-
MCSPI_CH0CONF_PHA |
792-
MCSPI_CH0CONF_TURBO ) |
793-
MCSPI_CH0CONF_CLKG));
787+
ulRegData |= MCSPI_CH0CONF_CLKG;
794788

795789
//
796790
// Get the divider value
797791
//
798792
ulDivider = ((ulSPIClk/ulBitRate) - 1);
799793

800794
//
801-
// The least significant four bits of the divider is used fo configure
795+
// The least significant four bits of the divider is used to configure
802796
// CLKD in MCSPI_CHCONF next eight least significant bits are used to
803797
// configure the EXTCLK in MCSPI_CHCTRL
804798
//

0 commit comments

Comments
 (0)
0