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

pic32 use spi_hal bus driver for SPI #2963

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented Mar 20, 2023

This is simple refactor of hal_spi so it can be used with spi_hal bus driver.

When bus driver bus/drivers/spi_hal is added to the target pic32mz_periph_create() function creates proper devices
so applications using bus driver interface can be built.

There was pic32 specific mips_spi_cfg struct for SPI pins.
Now SPI for pic32 uses common hal defined structure
and hal_spi_init_hw function is added so bus driver spi_hal
can be used.
If bus driver is present function pic32mz_periph_spi_devs()
creates SPI devices.

This also adds hal_spi_init_hw function needed by spi_hal.
hal_spi_init_hw(uint8_t spi_num, uint8_t spi_type,
const struct hal_spi_hw_settings *cfg)
{
return hal_spi_init(spi_num, (void *)cfg, spi_type);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: maybe cast to const void * ?

@kasjer kasjer merged commit 1005be8 into apache:master Mar 21, 2023
@kasjer kasjer deleted the kasjer/pic32-use-spi_hal branch March 21, 2023 13:16
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.

None yet

2 participants