Retrieve SPI number (spi_host_device_t) from spi_device_handle_t

Posts: 22
Joined: Mon Jul 22, 2019 2:29 pm

Retrieve SPI number (spi_host_device_t) from spi_device_handle_t

Postby AloyseTech » Tue Nov 17, 2020 9:45 pm


I'm trying to retrieve the SPI number (spi_host_device_t) from a spi_device_handle_t to free it (spi_bus_free) at closing of a driver.

I've not managed to do it without trying to de-reference the handle...

Code: Select all

int SPI_Close(void *spiHandle)
    spi_device_handle_t devHandle = *(spi_device_handle_t *)spiHandle;
    //todo: free spi bus, this fail since I'm dereferencing the pointer...
    free((spi_device_handle_t *)spiHandle);
    return 0;
Any advice?

Who is online

Users browsing this forum: No registered users and 44 guests