#ifndef _SONIXDEF_H_
#define _SONIXDEF_H_

unsigned long GetRollingCode(unsigned int offset);

#define GetRomAddr(addr) ((addr<<1) | 0x8000ul) 

#define _DELAY(X)  __asm{_Delay X}
#define ROMWRT  __asm{ROMWRT}

#define DefineRomTable(name,addr,size,value) __asm{ __DefineRomTable name addr size value}

#ifdef _DEFINE_INTRINSIC_
unsigned long _getROM(unsigned int address);
unsigned int  _getRAM(unsigned int address);
void _setRAM(unsigned int address, unsigned int value);

void _bSET(unsigned long address, unsigned int bitOffset);
void _bCLR(unsigned long address, unsigned int bitOffset);
int _bTest0(unsigned long address, unsigned int bitOffset);
int _bTest1(unsigned long address, unsigned int bitOffset);
#endif
#endif