Library .h Files Context

Elves needs a list to indicate which functions belong to a library. For this purpose a .h file needs to be generated with the same name as the library file except with the extension .h. The contents of the .h file must be the function prototypes of the required functions plus any defined constants used by the library. For instance the libAdc703x.r79 library has an associated file libAdc703x.h starting as follows:

#define uint unsigned int

extern uint AdcSetI(uint uCalIGn, int iCalIOff, uint uICon, uint uGain);
extern uint AdcSetV(uint uCalVGn, int iCalVOff, uint uVCon);
extern uint AdcSetT(uint uCalTGn, int iCalTOff, uint uTCon);
extern uint AdcRd(int *piIVal, int *piVVal, int *piTVal);
extern uint AdcGo(uint uGoMode, uint uPower, uint uGoCfg);
extern uint AdcFlt(uint uFilterCfg, uint uSf, uint uAf);
extern uint AdcHv(uint uHvAttOn);

// AdcSetI
#define ADCI_REF_INT 	0x00
#define ADCI_REF_EXT 	0x10
#define ADCI_REF_EXT2 	0x20
#define ADCI_REF_AVDD2 	0x30

#define ADCI_IN_IN 	0x00
#define ADCI_IN_SC 	0x40
#define ADCI_IN_D136 	0x80
#define ADCI_IN_D1 	0xc0

#define ADCI_UNIPOLAR 	0x200
#define ADCI_ENABLE 	0x8000

etc.

This same .h file needs be in a #include in you source code to supply the necessary function prototypes and defined constants to the compiler.

For additional details see Elves Code Rules.