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

bitbang-hal updates #4

Merged
merged 3 commits into from
Jun 30, 2019
Merged

bitbang-hal updates #4

merged 3 commits into from
Jun 30, 2019

Conversation

geomatsi
Copy link
Collaborator

Hi @sajattack and all,

Here is a patch series with misc updates for bitbang-hal.
Functional changes include:

  • enable support for both LSB first and FSB first bit order
    Other changes include:
  • re-export MODE_* from embedded-hal to simplify using of bitbang-hal
  • use match for SPI modes to improve code readability

Besides, spi example is updated according to suggested changes.

Regards,
Sergey

geomatsi added 3 commits June 29, 2019 22:33
SPI mode is defined by CPOL and CPHA parameters, where CPOL determines
the polarity of the clock and CPHA determines the timing of the data
bits relative to the clock pulses.

Constants for all four SPI modes are defined in embedded_hal. Re-export
them from bitbang_hal to simplify its usage: now there is no no need
to pull embedded_hal as dependency just to use MODE_* consts.

Besides, update spi example accordingly.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
Enable both LSB first and MSB first transfers: add
function set_bit_order to select configuration.
By default MSB first configuration is used.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
Use 'match' for different SPI modes to improve readability.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
@sajattack sajattack merged commit c74f1df into sajattack:master Jun 30, 2019
@geomatsi geomatsi deleted the bitbang-hal-updates branch July 1, 2019 18:47
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

Successfully merging this pull request may close these issues.

2 participants