📄 iekc64_intr.h
字号:
#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 receives the whole set of interrupts
from the different components of the board (EPLD, FPGA, FIFOs, ...).
The output of this controller is sent 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 allows 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 selected interrupt number is wrong
IEKC64_INTR_ERR_BAD_INTR_NBR = IEKC64_ERR_CODE( IEKC64_INTR, 2 ),
//! The selected interrupt number 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 )
};
/*--------------------------------------------------------------------------*/
/*! Opens and initializes the INTR module
\return An IEKC64_STATUS. If the call succeeds, 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 );
/*--------------------------------------------------------------------------*/
/*! Connects 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));
/*--------------------------------------------------------------------------*/
/*! Disconnects an user function from the on board interrupt demultiplexed
through EXTINT7 handler or from 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);
/*--------------------------------------------------------------------------*/
/*! Maps 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 );
/*--------------------------------------------------------------------------*/
/*! Enables 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);
/*--------------------------------------------------------------------------*/
/*! Disables 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 the selection has to be done
\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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -