Main Page | Modules | File List | Globals

picapi.h

Go to the documentation of this file.
00001 
00008 #ifndef PICAPI_H
00009 #define PICAPI_H
00010 
00013 #ifndef FALSE
00014 
00017 #define FALSE  0
00018 #endif
00019 
00020 #ifndef TRUE
00021 
00024 #define TRUE   1
00025 #endif
00026 
00033 #define DIGITAL_INPUT               0
00034 
00038 #define ANALOGUE_INPUT              1
00039 
00046 #define PIC_SUCCESS                 0
00047 
00051 #define PIC_UNKNOWNERROR            -1
00052 
00056 #define PIC_FILEERROR               -2
00057 
00061 #define PIC_HDRMISMATCH             -3
00062 
00066 #define PIC_DATAMISMATCH            -4
00067 
00071 #define PIC_PARAMERROR              -5
00072 
00073 // Initialisation / Cleanup
00074 int PIC_Initialise( void );
00075 void PIC_Close( int fdPIC );
00076 
00077 // PIC Firmware Information
00078 int PIC_ReadFirmwareVersion( int fdPIC, int *version );
00079 
00080 // Real time clock functions
00081 int PIC_ReadRTC( int fdPIC, time_t *rtc );
00082 int PIC_SetRTC( int fdPIC, time_t rtc );
00083 int PIC_ReadPowerOffTime( int fdPIC, time_t *powerOffTime );
00084 int PIC_ReadPowerOnTime( int fdPIC, time_t *powerOffTime );
00085 
00086 // Analogue input functions
00087 int PIC_ReadAnalogueInput( int fdPIC, int adcPort, int *value );
00088 
00089 // Switch / Power off switch logger functions
00090 int PIC_ReadSwitches( int fdPIC, int *switches );
00091 int PIC_ClearLog( int fdPIC );
00092 int PIC_GetLogEntry( int fdPIC, int *valid, time_t *rtc, int *switches );
00093 int PIC_DeleteLogEntry( int fdPIC, int *deleteOK );
00094 
00095 // PIC Status Flags
00096 int PIC_ReadWatchdogResetFlag( int fdPIC, int *flag );
00097 int PIC_ReadPowerOnResetFlag( int fdPIC, int *flag );
00098 int PIC_ReadBrownOutResetFlag( int fdPIC, int *flag );
00099 int PIC_ReadOscillatorFailureFlag( int fdPIC, int *flag );
00100 int PIC_ReadLogBufferOverflowFlag( int fdPIC, int *flag );
00101 
00102 // Battery functions
00103 int PIC_BatteryFastCharge( int fdPIC, int fastCharge );
00104 int PIC_BatteryReadVoltage( int fdPIC, int *batteryVoltage );
00105 int PIC_BatteryReadMaxRef( int fdPIC, int *maxRef );
00106 int PIC_BatteryReadMinETXVoltage( int fdPIC, int *minETXVoltage );
00107 
00108 // Hardware configuration
00109 int PIC_ConfigureRA2InputType( int fdPIC, int type );
00110 int PIC_ConfigureRA4InputType( int fdPIC, int type );
00111 
00112 #endif
00113 

Generated on Mon Jan 24 14:26:21 2005 for AXIS PIC API by doxygen 1.3.6