Пример #1
0
uint32_t nrf_drv_ppi_channel_disable(nrf_ppi_channel_t channel)
{
    if (!is_app_channel(channel))
    {
        return NRF_ERROR_INVALID_PARAM;
    }
    if (is_programmable_app_channel(channel) && !is_allocated_channel(channel))
    {
        return NRF_ERROR_INVALID_STATE;
    }
    nrf_ppi_channel_disable(channel);
    return NRF_SUCCESS;
}
Пример #2
0
uint32_t nrf_drv_ppi_channel_free(nrf_ppi_channel_t channel)
{
    if (!is_programmable_app_channel(channel))
    {
        return NRF_ERROR_INVALID_PARAM;
    }
    // First disable this channel
    nrf_ppi_channel_disable(channel);
    CRITICAL_REGION_ENTER();
    channel_allocated_clr(channel);
    CRITICAL_REGION_EXIT();
    return NRF_SUCCESS;
}
Пример #3
0
uint32_t nrf_drv_ppi_channel_free(nrf_ppi_channel_t channel)
{
    ret_code_t err_code = NRF_SUCCESS;

    if (!is_programmable_app_channel(channel))
    {
        err_code = NRF_ERROR_INVALID_PARAM;
    }
    else
    {
        // First disable this channel
        nrf_ppi_channel_disable(channel);
        CRITICAL_REGION_ENTER();
        channel_allocated_clr(channel);
        CRITICAL_REGION_EXIT();
    }
    NRF_LOG_INFO("Function: %s, error code: %s.\r\n", (uint32_t)__func__, (uint32_t)ERR_TO_STR(err_code));
    return err_code;
}
Пример #4
0
uint32_t nrf_drv_ppi_channel_disable(nrf_ppi_channel_t channel)
{
    ret_code_t err_code = NRF_SUCCESS;

    if (!is_app_channel(channel))
    {
        err_code = NRF_ERROR_INVALID_PARAM;
    }
    else if (is_programmable_app_channel(channel) && !is_allocated_channel(channel))
    {
        err_code = NRF_ERROR_INVALID_STATE;
    }
    else
    {
        nrf_ppi_channel_disable(channel);
        err_code = NRF_SUCCESS;
    }
    NRF_LOG_INFO("Function: %s, error code: %s.\r\n", (uint32_t)__func__, (uint32_t)ERR_TO_STR(err_code));
    return err_code;
}
Пример #5
0
uint32_t nrf_drv_ppi_channel_disable(nrf_ppi_channel_t channel)
{
    uint32_t err_code;

    if (!is_app_channel(channel))
    {
        err_code = NRF_ERROR_INVALID_PARAM;
    }
    else if (is_programmable_app_channel(channel) && !is_allocated_channel(channel))
    {
        err_code = NRF_ERROR_INVALID_STATE;
    }
    else
    {
#if (NRF_PPI_RESTRICTED > 0)
        err_code = sd_ppi_channel_enable_clr(channel_to_mask(channel));
#else
        nrf_ppi_channel_disable(channel);
        err_code = NRF_SUCCESS;
#endif
    }

    return err_code;
}
Пример #6
0
uint32_t nrf_drv_ppi_channel_free(nrf_ppi_channel_t channel)
{
    uint32_t err_code;

    if (!is_programmable_app_channel(channel))
    {
        err_code = NRF_ERROR_INVALID_PARAM;
    }
    else
    {
        // First disable this channel
#if (NRF_PPI_RESTRICTED > 0)
        err_code = sd_ppi_channel_enable_clr(channel_to_mask(channel));
#else
        nrf_ppi_channel_disable(channel);
        err_code = NRF_SUCCESS;
#endif
        CRITICAL_REGION_ENTER();
        channel_allocated_clr(channel);
        CRITICAL_REGION_EXIT();
    }

    return err_code;
}