For my IR project i want to setup a array with IR protocol defines; for the structure i created a class like below.
public class IRType {
string Name ; // protocol name
byte Type; // Bit 0 .. 1 is Carrier frequency 00 = 36
// 01 = 38
// 10 = 40
// 11 = 56
// Bit 3 code type
// 0 = Space
// 1 = shift
// Bit 4 Check Headerspace len 1 = yes
byte Bitsize ;
ushort HeaderPulse ;
ushort HeaderSpace ;
ushort OnePulse ;
ushort OneSpace ;
ushort NullPulse ;
ushort NullSpace ;
ushort StopPulse ;
ushort stopSpace ;
ushort StopEnd ;
ulong AddressMask ;
ulong CommandMask ;
byte TroggleBit ;
public IRType(string aName, byte aType, byte aBitsize,
ushort aHeaderPulse, ushort aHeaderSpace, ushort aOnePulse, ushort aOneSpace,
ushort aNullPulse, ushort aNullSpace, ushort aStopPulse, ushort astopSpace,
ushort aStopEnd, ulong aAddressMask, ulong aCommandMask, byte aTroggleBit) {
Name = aName ;
Type = aType ;
Bitsize = aBitsize;
HeaderPulse = aHeaderPulse;
HeaderSpace = aHeaderSpace;
OnePulse = aOnePulse ;
OneSpace = aOnePulse ;
NullPulse = aNullPulse ;
NullSpace = aNullSpace ;
StopPulse = aStopPulse ;
stopSpace = astopSpace ;
StopEnd = aStopEnd ;
AddressMask = aAddressMask;
CommandMask = aCommandMask;
TroggleBit = aTroggleBit ;
}
}
now i want to create a array like this
const IRType[] defIRProtocols = new IRType[2];
But now i need to fill the above array with the real defines like i did in a PIC project.
// DefCount = 2;
// IRdefType: array[0..1] of array [0..10] of dword = (
// ('A', $0001080E, 974, 786, 950, 788, 950, 788, 0, 0, 0), // RC5
// ('B', $0002080F, 1788, 878, 875, 875, 875, 875, 980, 0, 0));
is there a way to to setup this. I have seen some examples some where about adding classes to the array but now i need it i cant find where i did find it before.
thanks
Niels