standard peripheral libraries help
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-02-18 3:43 AM
Posted on February 18, 2018 at 12:43
hello
can anybody help me about these code
/////////////////////////////////////////////////////////////////////////////////////////////
/* Enable SPI in Master Mode, CPOL=0, CPHA=0. */
/* Clock speed = fPCLK1 / 256 = 280 kHz at 72 MHz PCLK1 clk. */ SPIx->CR1 = 0x037C; SPIx->CR2 = 0x0000;/////////////////////////////////////////////////////////////////////////////////////////
this is my code below
* SPI configuration */
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; SPI_InitStructure.SPI_Mode = SPI_Mode_Master; SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b; SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low; SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge; SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256; SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; SPI_InitStructure.SPI_CRCPolynomial = 7; SPI_Init(EVAL_SPIx, &SPI_InitStructure);are they equal?if it not equal can tell me what should i change?
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-02-18 6:09 AM
Posted on February 18, 2018 at 15:09
Presuming an STM32F030 part, not looking to dig through the Reference Manual to confirm bit settings.
Would suggest you do printf('%08X %08X\n', SPIx->CR1, SPIx->CR2); type confirmation
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
