Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Hobbyking_Cheetah_Compact Hobbyking_Cheetah_Compact_DRV8323_14bit Hobbyking_Cheetah_Compact_DRV8323_V51_201907 HKC_MiniCheetah ... more
Fork of mbed-dev by
Diff: targets/TARGET_NXP/TARGET_LPC176X/spi_api.c
- Revision:
- 172:7d866c31b3c5
- Parent:
- 170:19eb464bc2be
--- a/targets/TARGET_NXP/TARGET_LPC176X/spi_api.c Wed Aug 16 18:27:13 2017 +0100
+++ b/targets/TARGET_NXP/TARGET_LPC176X/spi_api.c Thu Aug 31 17:27:04 2017 +0100
@@ -98,7 +98,7 @@
int FRF = 0; // FRF (frame format) = SPI
uint32_t tmp = obj->spi->CR0;
- tmp &= ~(0xFFFF);
+ tmp &= ~(0x00FF); // Clear DSS, FRF, CPOL and CPHA [7:0]
tmp |= DSS << 0
| FRF << 4
| SPO << 6
@@ -146,7 +146,7 @@
obj->spi->CPSR = prescaler;
// divider
- obj->spi->CR0 &= ~(0xFFFF << 8);
+ obj->spi->CR0 &= ~(0xFF00); // Clear SCR: Serial clock rate [15:8]
obj->spi->CR0 |= (divider - 1) << 8;
ssp_enable(obj);
return;
