InterruptControllerInterface.h
3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//=========================================================
// 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
//=========================================================