This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to close the spi interface

hi, now ,i have save the power,so need to close the spi interface at some time. but when i call follow function (hal_spi_disable). it see not close the spi interface,

if any issue about this?


uint32_t hal_spi_disable(SPIModuleNumber module_number)
{
    switch (module_number)
    {
        case SPI0:
            NRF_SPI0->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
            break;
        case SPI1:
            NRF_SPI1->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
            break;
        default:
            return NRF_ERROR_INVALID_PARAM;
    }
    
    return NRF_SUCCESS;
}

Parents Reply Children
No Data
Related