⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_intc.h

📁 TMS320DM6446平台下
💻 H
📖 第 1 页 / 共 2 页
字号:
/** * @brief   Releases an allocated event * * CSL_intcClose(..) must be called to release an event that has * been previously allocated with a call to CSL_intcOpen(..). * * @b Example: * @verbatim        if (CSL_intcClose(hIntc) != CSL_SOK) {            // close failed! //        }   @endverbatim * * @return  CSL_SOK on success; CSL_ESYS_FAIL on failure. */CSL_Status    CSL_intcClose (        CSL_IntcHandle      hIntc   /**< Handle to an event; see CSL_intcOpen(..) */);/** * @brief   Sets up the interrupt controller for a particular event * * CSL_intcHwSetup(..) API is used to configure the interrupt controller * for the event identified by the handle. The user must instantiate * and initialize a setup-structure with appropriate configuration * parameters before passing it to the function. * * @b Example: * @verbatim        CSL_IntcHwSetup setup = CSL_INTC_HWSETUP_DEFAULTS;          setup.priority = CSL_INTC_PRIORITY_DEFAULT;          CSL_intcHwSetup(hIntc, &setup);     @endverbatim * * @return*/CSL_Status    CSL_intcHwSetup (        CSL_IntcHandle      hIntc,  /**< Handle to an event; see CSL_intcOpen(..) */        CSL_IntcHwSetup *   hwSetup /**< Pointer to a Setup-structure */);/** * @brief   Perform a control-operation * * This API is used to invoke any of the supported control-operations * supported by the module. Note: Refer to the control-command documentation * for details on the parameter (if any) that a specific command accepts. * * @b Example: * @verbatim        CSL_intcHwControl(hIntc, CSL_INTC_CMD_EVTSET, NULL);   @endverbatim * * @return  CSL_SOK on success; *          CSL_ESYS_FAIL on failure; *          CSL_ESYS_BADHANDLE if the handle is invalid; *          CSL_ESYS_NOTSUPPORTED if not supported; *          CSL_ESYS_INVCMD on an invalid command.*/CSL_Status    CSL_intcHwControl (        CSL_IntcHandle          hIntc,      /**< Handle to an event; see CSL_intcOpen(..) */        CSL_IntcHwControlCmd    command,    /**< Command identifier */        void *                  commandArg  /**< Optional command parameter */);/** * @brief   Queries the peripheral for status * * The CSL_intcGetHwStatus(..) API could be used to retrieve status * or configuration information from the peripheral. The user must * allocate an object that would hold the retrieved information * and pass a pointer to it to the function. The type of the object * is specific to the query-command. * * @b Example: * @verbatim        Bool    evtPending = FALSE;        while (evtPending == FALSE) {            CSL_intcGetHwStatus(hIntc, CSL_INTC_QUERY_ISEVENTPENDING, &evtPending);        }     @endverbatim * * @return  CSL_SOK on success; *          CSL_ESYS_FAIL on failure; *          CSL_ESYS_BADHANDLE if the handle is invalid; *          CSL_ESYS_NOTSUPPORTED if not supported; *          CSL_ESYS_INVQUERY on an invalid query.*/CSL_Status    CSL_intcGetHwStatus (        CSL_IntcHandle          hIntc,      /**< Handle to an event; see CSL_intcOpen(..) */        CSL_IntcHwStatusQuery   query,      /**< Query identifier */        void *                  response    /**< Pointer to an object that would contain the retrieved information */);/** * @brief   Enable an event * * The API enables the specified event. If the user wishes to restore * the enable-state of the event at a later point of time, they may * store the current state using the parameter, which could be used * with CSL_intcEventRestore(..). * Note: The function directly works on the event and hence it is * not necessary to "open" the event to invoke the API. * * @b Example: * @verbatim        CSL_intcEventEnable(CSL_INTC_EVENTID_UART1, NULL);   @endverbatim * * @return  CSL_SOK on success*/CSL_Status    CSL_intcEventEnable (        CSL_IntcEventId             eventId,    /**< Event-ID of interest */        CSL_IntcEventEnableState *  prevState   /**< (Optional) Pointer to object that would store current state */);/** * @brief   Disable an event * * The API disables the specified event. If the user wishes to restore * the enable-state of the event at a later point of time, they may * store the current state using the parameter, which could be used * with CSL_intcEventRestore(..). * Note: The function directly works on the event and hence it is * not necessary to "open" the event to invoke the API. * * @b Example: * @verbatim        CSL_IntcEventEnableState    oldState;        CSL_intcEventDisable(CSL_INTC_EVENTID_I2C, &oldState);   @endverbatim * * @return  CSL_SOK on success*/CSL_Status    CSL_intcEventDisable (        CSL_IntcEventId             eventId,    /**< Event-ID of interest */        CSL_IntcEventEnableState *  prevState   /**< (Optional) Pointer to object that would store current state */);/** * @brief   Restore the event to a previous enabled/disabled state * * The API restores the specified event to a previous enable-state * as recorded by the event-enable state passed as an argument. * Note: The function directly works on the event and hence it is * not necessary to "open" the event to invoke the API. * * @b Example: * @verbatim        CSL_intcEventRestore(CSL_INTC_EVENTID_I2C, oldState);   @endverbatim * * @return  CSL_SOK on success*/CSL_Status    CSL_intcEventRestore (        CSL_IntcEventId             eventId,    /**< Event-ID of interest */        CSL_IntcEventEnableState    prevState   /**< Object that contains information about previous state */);/** * @brief   Globally enable interrupts * * The API enables the global interrupt by manipulating the processor's * global interrupt enable/disable flag. If the user wishes to restore * the enable-state at a later point, they may store the current state * using the parameter, which could be used with CSL_intcGlobalRestore(..). * CSL_intcGlobalEnable(..) must be called from a privileged mode. * * @b Example: * @verbatim        CSL_intcGlobalEnable(NULL);   @endverbatim * * @return  CSL_SOK on success */CSL_Status    CSL_intcGlobalEnable (        CSL_IntcGlobalEnableState * prevState   /**< (Optional) Pointer to object that would store current state */);/** * @brief   Globally disable interrupts * * The API disables the global interrupt by manipulating the processor's * global interrupt enable/disable flag. If the user wishes to restore * the enable-state at a later point, they may store the current state * using the parameter, which could be used with CSL_intcGlobalRestore(..). * CSL_intcGlobalDisable(..) must be called from a privileged mode. * * @b Example: * @verbatim        CSL_IntcGlobalEnableState   gieState;          CSL_intcGlobalDisable(&gieState);        // critical-section code //        CSL_intcGlobalRestore(gieState);   @endverbatim * * @return  CSL_SOK on success */CSL_Status    CSL_intcGlobalDisable (        CSL_IntcGlobalEnableState * prevState   /**< (Optional) Pointer to object that would store current state */);/** * @brief   Restore global interrupt enable/disable to a previous state * * The API restores the global interrupt enable/disable state to a previous * state as recorded by the global-event-enable state passed as an argument. * CSL_intcGlobalDisable(..) must be called from a privileged mode. * * @b Example: * @verbatim        CSL_IntcGlobalEnableState   gieState;          CSL_intcGlobalDisable(&gieState);        // critical-section code //        CSL_intcGlobalRestore(gieState);   @endverbatim * * @return  CSL_SOK on success*/CSL_Status    CSL_intcGlobalRestore (        CSL_IntcGlobalEnableState       prevState   /**< Object containing information about previous state */);/** * @brief   Hooks up and sets up the CSL interrupt dispatchers * * The user should call CSL_intcDispatcherInit(..) if they * wish to make use of the dispatchers built into the CSL INTC * module. * * Note: This API must be called before using * CSL_intcPlugEventHandler(..). * * @b Example: * @verbatim      CSL_sysInit( );      if (CSL_intcInit( ) != CSL_SOK) {        // module initialization failed! //      }      if (CSL_intcDispatcherInit( ) != CSL_SOK) {        // CSL dispatcher setting up failed! //      }   @endverbatim * * @return CSL_SOK on success; CSL_ESYS_FAIL on failure.*/CSL_Status    CSL_intcDispatcherInit (        void);/** * @brief   Associate an event-handler with an event * * CSL_intcPlugEventHandler(..) ties an event-handler to an event; so * that the occurence of the event, would result in the event-handler * being invoked. * * @b Example: * @verbatim        CSL_IntcEventHandlerRecord  evtHandlerRecord;          evtHandlerRecord.handler = myIsr;        evtHandlerRecord.arg     = (void *)hTimer;        CSL_intcPlugEventHandler(hIntc, &evtHandlerRecord);   @endverbatim * * @return  Returns the address of the previous handler*/CSL_IntcEventHandler    CSL_intcPlugEventHandler (        CSL_IntcHandle                  hIntc,                /**< Handle identying the interrupt-event; see CSL_intcOpen(..) */        CSL_IntcEventHandlerRecord *    eventHandlerRecord                /**< Provides the details of the event-handler */);/** * @brief   Hook up an exception handler * * This API hooks up the handler to the specified exception. * Note: In this case, it is done by inserting a B(ranch) instruction * to the handler. Because of the restriction in the instruction * th handler must be within 32MB of the exception vector. * Also, the function assumes that the exception vector table is * located at its default ("low") address. * * @b Example: * @verbatim        CSL_intcHookIsr(CSL_INTC_VECTID_UNDEF, (void *)myUndefExceptionHandler);   @endverbatim */void    CSL_intcHookIsr (        CSL_IntcVectId  vectId,     /**< Exception identifier */        void *          isrAddr     /**< Pointer to the handler */);#ifdef __cplusplus}#endif#endif/* Rev.No.   Date/Time               ECN No.          Modifier      *//* -------   ---------               -------          --------      *//* 6         20 Jan 2005 09:57:46    6138             xkeshavm      *//*                                                                  *//* psc interrupt number is added                                    *//********************************************************************/ 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -