Skip to content

SPI needs setClockDivider #26

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

Closed
nseidle opened this issue Jul 9, 2019 · 6 comments
Closed

SPI needs setClockDivider #26

nseidle opened this issue Jul 9, 2019 · 6 comments

Comments

@nseidle
Copy link
Member

nseidle commented Jul 9, 2019

Attempting to run SparkFun BME280 library failed because

C:\Dropbox\Apps\Arduino\libraries\arduino_173658\src\SparkFunBME280.cpp: In member function 'uint8_t BME280::begin()':
C:\Dropbox\Apps\Arduino\libraries\arduino_173658\src\SparkFunBME280.cpp:98:7: error: 'class 
SPIClass' has no member named 'setClockDivider'
    SPI.setClockDivider(SPI_CLOCK_DIV32);
@nseidle
Copy link
Member Author

nseidle commented Jul 9, 2019

FWIW it's not recommended for use in new projects: https://www.arduino.cc/en/Reference/SPISetClockDivider

@nseidle
Copy link
Member Author

nseidle commented Jul 9, 2019

Notes to myself: we're not respecting LSB MSB settings. I believe the HAL has MSB hardcoded:

image

Page 321 of datasheet shows bit 23 controls MSB/LSB so we should be able to manipulate it. I know there are bit wise operators in the HAL...

image

@nseidle
Copy link
Member Author

nseidle commented Jul 9, 2019

Register access helper macros:

image

@nseidle
Copy link
Member Author

nseidle commented Jul 9, 2019

The macro helper functions are defined in v2.2 of HAL so we don't have access to them but the AM_REGVAL is available and seems to be working.

@nseidle
Copy link
Member Author

nseidle commented Jul 10, 2019

Should be fixed in PR #30.

@oclyke
Copy link
Contributor

oclyke commented Aug 5, 2019

All this is taken care of now. Thanks!

@oclyke oclyke closed this as completed Aug 5, 2019
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

2 participants