/* * Copyright (C) 2012 Realtek Semiconductor Corp. * All Rights Reserved. * * This program is the proprietary software of Realtek Semiconductor * Corporation and/or its licensors, and only be used, duplicated, * modified or distributed under the authorized license from Realtek. * * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. * * $Revision: * $Date: 2017-03-01 16:03:53 +0800 (Wed, 01 Mar 2017) $ * * Purpose : Definition those public Interrupt APIs and its data type in the SDK. * * Feature : The file have include the following module and sub-modules * (1) Interrupt parameter settings */ /* * Include Files */ #include #include #include #include #include #include /* * Symbol Definition */ /* * Data Declaration */ /* * Function Declaration */ /* Function Name: * rt_intr_init * Description: * Initialize interrupt module. * Input: * None * Output: * None * Return: * RT_ERR_OK * RT_ERR_FAILED * Note: * Must initialize interrupt module before calling any interrupt APIs. */ int32 rt_intr_init(void) { int32 ret = RT_ERR_OK; return ret; } /* end of rt_intr_init */ /* Function Name: * rt_intr_imr_set * Description: * Set interrupt mask. * Input: * intr - interrupt type * enable - interrupt status * * Output: * None * Return: * RT_ERR_OK * RT_ERR_FAILED * RT_ERR_OUT_OF_RANGE * Note: * None. */ int32 rt_intr_imr_set(rt_intr_type_t intr, rt_enable_t enable) { int32 ret; /* function body */ if (NULL == RT_MAPPER->intr_imr_set) return RT_ERR_DRIVER_NOT_FOUND; RTK_API_LOCK(); ret = RT_MAPPER->intr_imr_set(intr, enable); RTK_API_UNLOCK(); return ret; } /* end of rt_intr_imr_set */ /* Function Name: * rt_intr_imr_get * Description: * Get interrupt mask. * Input: * intr - interrupt type * pEnable - pointer of return status * * Output: * None * Return: * RT_ERR_OK * RT_ERR_FAILED * RT_ERR_NULL_POINTER * RT_ERR_OUT_OF_RANGE * Note: * None. */ int32 rt_intr_imr_get(rt_intr_type_t intr, rt_enable_t *pEnable) { int32 ret; /* function body */ if (NULL == RT_MAPPER->intr_imr_get) return RT_ERR_DRIVER_NOT_FOUND; RTK_API_LOCK(); ret = RT_MAPPER->intr_imr_get(intr, pEnable); RTK_API_UNLOCK(); return ret; } /* end of rt_intr_imr_get */