/******************************************************************************
* Function Name: R_OSTM_Open
* Description  :
* Arguments    : int32_t channel
* Return Value : DEVDRV_SUCCESS
*              : DEVDRV_ERROR
******************************************************************************/
int32_t R_OSTM_Open(uint32_t channel)
{
    if (channel >= OSTM_CH_TOTAL)
    {
        return DEVDRV_ERROR;
    }

    switch (channel)
    {
        case DEVDRV_CH_0:
            OSTM_Open(&OSTM0);
        break;
        case DEVDRV_CH_1:
            OSTM_Open(&OSTM1);
        break;
        default:
        break;
    }

    return DEVDRV_SUCCESS;
}
Esempio n. 2
0
/******************************************************************************
* Function Name: R_OSTM_Open
* Description  : Starts the OSTM timer counter specified by the argument channel.
* Arguments    : uint32_t channel : OSTM channel (0 or 1)
* Return Value : DEVDRV_SUCCESS   : Success to start counting OSTM
*              : DEVDRV_ERROR     : Failure to start counting OSTM
******************************************************************************/
int32_t R_OSTM_Open(uint32_t channel)
{
    /* ==== Argument check ==== */
    if (channel >= OSTM_CH_TOTAL)
    {
        return DEVDRV_ERROR;        /* Argument error */
    }

    /* ==== Start counting OSTM ==== */
    switch (channel)
    {
        case DEVDRV_CH_0:
            OSTM_Open(&OSTM0);
        break;
        case DEVDRV_CH_1:
            OSTM_Open(&OSTM1);
        break;
        default:
            /* Do not reach here based on the assumption */
        break;
    }

    return DEVDRV_SUCCESS;
}