Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPI baud rate prescaler issue #2

Open
Roshan-DSouza opened this issue Jun 24, 2018 · 0 comments
Open

SPI baud rate prescaler issue #2

Roshan-DSouza opened this issue Jun 24, 2018 · 0 comments

Comments

@Roshan-DSouza
Copy link

For example, below evaluates to 0x18
#define SPI_REG_CR1_BR_PCLK_DIV_16 ( ( uint32_t) 3 << 3 )

and in hal, we have error check condition which checks 0x18> 7 sets default CR1 with 0.
if(pre_scalar_value > 7 )
SPIx->CR1 |= (0x00 << 3); //if pre_scalar_value > 7,then use default . that is 0

In order to fix, it is just enough to have below change
#define SPI_REG_CR1_BR_PCLK_DIV_16 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant