iekc64_intr.h
来自「TI公司的算法标准 Framework5的源代码」· C头文件 代码 · 共 316 行
H
316 行
/*
* Copyright 2002 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/* "@(#) RF5_IEK 2.00.02 12-11-02 (swat-c19)" */
/*! \verbatim
==============================================================================
Copyright (C) 2002 A.T.E.M.E.
All Rights Reserved
------------------------------------------------------------------------------
MODULE NAME... IEKC64_INTR
FLENAME...... iekc64_intr.h
PROJECT....... IEK C64x
------------------------------------------------------------------------------
HISTORY:
V1.0 09/01/2002 HCO
09/01/2002 HCO
------------------------------------------------------------------------------
\endverbatim <P> \file
\brief Header file for the IEKC64x board interrupts manager.
</P>*//*====================================================================*/
#ifndef _IEKC64_INTR_H_
#define _IEKC64_INTR_H_
#include <csl_stdinc.h>
#include <csl_irq.h>
#include "iekc64.h"
void INTR_dispatchEdma();
void INTR_dispatchExtInt();
void IekNoIntrFct(void);
#ifdef __cplusplus
extern "C" {
#endif
/*=======================================================================*//*!
\defgroup INTR INTR - Board interrupts management
\brief This module helps to manage the numerous interrupts
The board has more than 14 sources of interrupts and the DSP has only
5 external interrupt inputs.<br>
The mechanism implemented on the IEKC64 is as follow :
\li A dual-stage interrupt controller receive the whole set of interrupts
from the different components of the board (epld, fpga, fifos, ...).
This output of this controller is sended to EXTINT7.<br>
Every board interrupt can be enabled or disabled and any number of
interrupt can be enabled at the same time. The INTR module provides
an HWI (ISR or Interrupt Service Routine) that will identify the
source interrupt(s) and dispatch to the correct processing routine.
This allow any board interrupt to be processed by software.
\li The four other inputs (EXTINT4, EXTINT5, EXTINT6, NMI) receive each
the output of one of four multiplexer. The multiplexer can be set to
send to one of this inputs, any interrupts from a subset of all the
board interrupts.<br>
This allow faster response time for critical interrupts or allow
interrupts to be used as DMA triggering events.
The API provided by this module allow the control of the two parts of this
mechanism.
</P>*//*==============================================================*//*@{*/
// values for EPLDDSP_REG_SELIT45 and EPLDDSP_REG_SELIT6NMI
#define EPLDDSP_BIT_MASK 0x0F
// Bits definition for _IRQ_EXTPOL_ADDR
#define IEK_BITEXTPOL_XIP4 0x00000001
#define IEK_BITEXTPOL_XIP5 0x00000002
#define IEK_BITEXTPOL_XIP6 0x00000004
#define IEK_BITEXTPOL_XIP7 0x00000008
// function prototype for interrupt management of end of frame
/*--------------------------------------------------------------------------*/
/*! Defines the board interrupt sources
*/
typedef enum
{
//! \todo To be documented
INTR_FPGA0 = 64,
//! \todo To be documented
INTR_FPGA1 ,
//! \todo To be documented
INTR_FPGA2 ,
//! \todo To be documented
INTR_VGA ,
//! \todo To be documented
INTR_EXTA ,
//! \todo To be documented
INTR_EXTB ,
//! \todo To be documented
INTR_TBD ,
//! \todo To be documented
INTR_DCA ,
//! \todo To be documented
INTR_DCB ,
//! \todo To be documented
INTR_DCC ,
//! \todo To be documented
INTR_DCD ,
//! \todo To be documented
INTR_CHRXA ,
//! \todo To be documented
INTR_CHTXA ,
//! \todo To be documented
INTR_CHRXB ,
//! \todo To be documented
INTR_CHTXB ,
//! \todo To be documented
INTR_NONE = 255
}
IEKC64_INTR_SOURCE;
/*--------------------------------------------------------------------------*/
/*! Defines the values for interrupt edge definition
*/
typedef enum
{
//! Used to set the edge mode as falling
ITEDGE_FALLING = 0,
//! Used to set the edge mode as rising
ITEDGE_RISING
}
IEKC64_INTR_EDGE;
/*--------------------------------------------------------------------------*/
/*! Module error codes.<br>
If status returned from a module call is negative (or
IEKC64_SUCCESS(return code) is false), the value represents en error
from the list below
*/
enum IEKC64_INTR_STATUS
{
//! Generic error code
IEKC64_INTR_ERR = IEKC64_ERR_CODE( IEKC64_INTR, 1 ),
//! The interrupt number selected is wrong
IEKC64_INTR_ERR_BAD_INTR_NBR = IEKC64_ERR_CODE( IEKC64_INTR, 2 ),
//! The interrupt number selected is wrong
IEKC64_BAD_INTR_NBR = IEKC64_ERR_CODE( IEKC64_INTR, 3 ),
//! The interrupt you try to use is already allocated
IEKC64_INTR_ALREADY_USED = IEKC64_ERR_CODE( IEKC64_INTR, 4 )
};
/*--------------------------------------------------------------------------*/
/*! Open and initialize the INTR module
\return An IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Note: This function is not intended to be user callable
*/
IEKC64_STATUS INTR_init(void);
/*--------------------------------------------------------------------------*/
/*! Set the active edge for an external interrupt input
\param dspExtIntr
The external interrupt input on which
the selection have to be done
\param edge
The IEKC64_INTR_EDGE wanted for this input pin
\return An IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
// Set interrupt edge for external interrupt 4 (fall edge)
INTR_setEdge(IRQ_EVT_EXTINT4, ITEDGE_FALLING);
\endverbatim
*/
IEKC64_STATUS INTR_setEdge(Uint8 dspExtIntr, IEKC64_INTR_EDGE edge );
/*--------------------------------------------------------------------------*/
/*! Connect an user funtion to a board interrupt demultiplexed through
EXTINT7 handler or to an EDMA interrupt
\param boardIntr
The IEKC64_INTR_SOURCE board interrupt or EDMA channel on which to connect
the function
\param pFn
A pointer to a void f(void) function that will be called by
the demultiplexer upon interrupt reception
\return An IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
// Connect VIN_FrameAcquisition function on EDMA VIDEOIN_EDMA_TCC channel
INTR_connect(VIDEOIN_EDMA_TCC,VIN_FrameAcquisition);
\endverbatim
*/
IEKC64_STATUS INTR_connect(Uint8 boardIntr, void (*pFct)(void));
/*--------------------------------------------------------------------------*/
/*! Disconnect an user funtion to the on board interrupt demultiplexed through
EXTINT7 handler or to an EDMA interrupt
\param boardIntr
The IEKC64_INTR_SOURCE board interrupt or EDMA channel on which to connect
the function
\return An IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
// diconnect EDMA on dispatcher
INTR_disconnect(VIDEOIN_EDMA_TCC);
\endverbatim
*/
IEKC64_STATUS INTR_disconnect(Uint8 boardIntr);
/*--------------------------------------------------------------------------*/
/*! Map a board interrupt demultiplexed through EXTINT7 handler
\param boardIntr
The IEKC64_INTR_SOURCE board interrupt
\return An IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
// Map interrupt from FPGA1 on external interrupt ExtIntrVideoOut
INTR_mapHwExtInt(INTR_FPGA1,ExtIntrVideoOut);
\endverbatim
*/
IEKC64_STATUS INTR_mapHwExtInt(Uint8 boardIntr, Uint8 dspExtIntr );
/*--------------------------------------------------------------------------*/
/*! Enable a board interrupt demultiplexed through EXTINT7 handler or enable an EDMA channel
\param boardIntr
The IEKC64_INTR_SOURCE board interrupt or EDMA channel on which to connect
the function
\return An IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
INTR_enable(VIDEOOUT_EDMA_TCC);
\endverbatim
*/
IEKC64_STATUS INTR_enable(Uint8 IntrSrc);
/*--------------------------------------------------------------------------*/
/*! Disable a board interrupt demultiplexed through EXTINT7 handler or disable
an EDMA channel
\param boardIntr
The IEKC64_INTR_SOURCE board interrupt or EDMA channel on which to connect
the function
\return An IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
INTR_disable(VIDEOOUT_EDMA_TCC);
\endverbatim
*/
IEKC64_STATUS INTR_disable(Uint8 IntrSrc);
/*@}*//* end of group INTR */
#ifdef __cplusplus
}
#endif
#endif /* ifndef _IEKC64_INTR_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?