InterruptControllerInterface.h 3.89 KB
//=========================================================
// Copyright 2001 VAutomation Inc. Nashua NH USA. All rights reserved.
// This software is provided under license and contains proprietary   
// and confidential material which is the property of VAutomation Inc.
// HTTP://www.vautomation.com											
//==========================================================
//
//  Class Name:	CInterruptControllerInterface
//  Author:  
//  Company:  VAutomation An Arc Cores Company
//  Date created:  2/01/2001 at 9:46
//
//
//==========================================================
//
//  Notes: This file should not modified. It is designed to 
//  compile under a wide range of compilers and any addtional
//  dependencies may defeat the purpose of its structure.
//
//
//
//==========================================================

#ifndef __CINTERRUPTCONTROLLERINTERFACE__
#define __CINTERRUPTCONTROLLERINTERFACE__

//=========================================================
// Member Varible Includes
//=========================================================



//=========================================================
//             HEADER INCLUDE FILE SECTION
//=========================================================
#include "DataTypes.h"

//=========================================================
//                       TYPES
//=========================================================

// Assigning enums to all the interrupts so we can be sure at
// compile time all the IRQs expected are implemented in this class
enum IRQNumberType{ IRQ_0,IRQ_1,IRQ_2,IRQ_3,IRQ_4,IRQ_5,IRQ_6,IRQ_7 };

typedef unsigned char PriorityLevelType;

//This is the function prototype for a callback function used for
//IRQ servicing.
typedef void InterruptCallbackType( void );

//=========================================================
//
// Class Comments:
// 
// 	This class is a wrapper around the interrupt functionality of a processor.  The wrapper is designed to 
// 	Hide the implementation and syntax of the interrupt functions from the code using this interface. 
// 	Note: The implementation of the IRQs should be built flexible enough for future expansion.  
// 	
// 	
// 
// Public function comments:
//	 Create - Function must be called before any other function. The device name can be used
//			  for any purpose. In some implimentations the device_name is used for improved 
//			  error messages and status messages.

//   AddIRQ - Function is used to attach a function pointer to a IRQ number.
//			  Once a call to this function is complete, the Callback will be 
//			  activated when ever the irq activated.
//
//	 RemoveIRQ - Function is used to detach a function callback pointer. It is assumed
//			  The function was attached using the AddIRQ function. A return value of false
//			  will be set, if the function does not exist in the current list of callbacks.
// 
// 
// Private function comments:
// 
// 
// Protected function comments:
// 
// 
//=========================================================

class CInterruptControllerInterface
{

  public:

	// Member functions
	bool Create( char* device_name );
	bool AddIRQ( InterruptCallbackType *m_callback, IRQNumberType m_irq_number=IRQ_0, PriorityLevelType m_priority=0);
	bool RemoveIRQ(  InterruptCallbackType *m_callback, IRQNumberType m_irq_number=IRQ_0, PriorityLevelType m_priority=0);

	// Member functions default overrides
	CInterruptControllerInterface( ); // Default constructor
	virtual ~CInterruptControllerInterface( ); // Destructor

	// Operator Members

	// GetCopy Member Functions

	// Set Member Functions


  public:

	// Member varibles


  private:

	// Member functions


  private:

	// Member varibles
	void *m_internal_info_pointer; //This is a void to hide implementation


  protected:

	// Member functions
	
  protected:

	// Member varibles


  public:

	// Friend functions

};

#endif

//=========================================================