|
Defines |
| #define | BYTE unsigned char |
| #define | WORD unsigned int |
| #define | BOOL int |
| #define | BIT0 1 |
| #define | BIT1 2 |
| #define | BIT2 4 |
| #define | BIT3 8 |
| #define | BIT4 16 |
| #define | BIT5 32 |
| #define | BIT6 64 |
| #define | BIT7 128 |
| #define | PIC_FILENAME "/dev/axis_0/spi_0" |
| #define | PIC_RETRIES 5 |
Functions |
| int | PIC_Initialise (void) |
| | Initialises communications between the AXIS and the PIC. This must be called before using any PIC API functions.
|
| void | PIC_Close (int fdPIC) |
| | Closes communications between the AXIS and the PIC. This should be called at the end of your program after all PIC API calls have been made.
|
| int | PIC_ReadFirmwareVersion (int fdPIC, int *version) |
| | Obtains the PIC firmware version.
|
| int | PIC_ReadRTC (int fdPIC, time_t *rtc) |
| | Reads the real time clock.
|
| int | PIC_SetRTC (int fdPIC, time_t rtc) |
| | Sets the real time clock.
|
| int | PIC_ReadPowerOffTime (int fdPIC, time_t *powerOffTime) |
| | Obtains the last PIC power-off time.
|
| int | PIC_ReadPowerOnTime (int fdPIC, time_t *powerOnTime) |
| | Obtains the last PIC power-on time.
|
| int | PIC_ReadAnalogueInput (int fdPIC, int adcPort, int *value) |
| | Perform an A/D conversion on the specified analogue input. Each port has a resolution of 10 bits equating to an integer range of 0 to 1023.
|
| int | PIC_ReadSwitches (int fdPIC, int *switches) |
| | Returns the current state of the 8 input switches.
|
| int | PIC_ClearLog (int fdPIC) |
| | Empties the power-off switch logger.
|
| int | PIC_GetLogEntry (int fdPIC, int *valid, time_t *rtc, int *switches) |
| | Obtains the next switch log entry. Every entry contains the switch position in addition to the PIC time at which the switch event took place.
|
| int | PIC_DeleteLogEntry (int fdPIC, int *deleteOK) |
| | Deletes the oldest power-off switch log entry.
|
| int | PIC_ReadWatchdogResetFlag (int fdPIC, int *flag) |
| | Checks whether a watchdog reset has occurred. As soon as this flag is read then it is automatically cleared.
|
| int | PIC_ReadPowerOnResetFlag (int fdPIC, int *flag) |
| | Checks whether a power-on reset has occurred. As soon as this flag is read then it is automatically cleared.
|
| int | PIC_ReadBrownOutResetFlag (int fdPIC, int *flag) |
| | Checks whether a brown out reset has occurred. As soon as this flag is read then it is automatically cleared.
|
| int | PIC_ReadOscillatorFailureFlag (int fdPIC, int *flag) |
| | Checks whether an oscillator failure has occurred. As soon as this flag is read then it is automatically cleared.
|
| int | PIC_ReadLogBufferOverflowFlag (int fdPIC, int *flag) |
| | Checks whether a power off switch log overflow has occurred. As soon as this flag is read then it is automatically cleared.
|
| int | PIC_BatteryFastCharge (int fdPIC, int fastCharge) |
| | Controls battery fast charge. Please note that it is not recommended to leave the battery fast-charging for long periods of time.
|
| int | PIC_BatteryReadVoltage (int fdPIC, int *batteryVoltage) |
| | Reads the current battery voltage. This is a 10-bit value with a corresponding range of 0 to 1023.
|
| int | PIC_BatteryReadMaxRef (int fdPIC, int *maxRef) |
| | Reads the maximum battery reference voltage when in low power mode. This is a 10-bit value with a corresponding range of 0 to 1023.
|
| int | PIC_BatteryReadMinETXVoltage (int fdPIC, int *minETXVoltage) |
| | Reads the minimum ETX voltage. This is a 10-bit value with a corresponding range of 0 to 1023.
|
| int | PIC_ConfigureRA2InputType (int fdPIC, int type) |
| | Configures RA2 as either an analogue or a digital input. Please note that when configured as an analogue input then the corresponding multiplexed switch input bits will be masked out.
|
| int | PIC_ConfigureRA4InputType (int fdPIC, int type) |
| | Configures RA4 as either an analogue or a digital input. Please note that when configured as an analogue input then the corresponding multiplexed switch input bits will be masked out.
|