Test software to communicate with the AXIS PIC.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <popt.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "../../sw/kernel_driver/axis.h"
#include "picapi.h"
#include "17682.h"
Include dependency graph for testpic.cpp:

Defines | |
| #define | PIC_FILENAME "/dev/axis_0/spi_0" |
Functions | |
| int | DisplayVersionInformation (int fdPIC) |
| Displays to screen both the current issue of this software in addition to the firmware version of the PIC. | |
| int | ReadPowerOnAndOffTimes (int fdPIC) |
| Displays to screen the last PIC power off and power on times. | |
| int | ReadRealTimeClock (int fdPIC) |
| Displays to screen the current PIC RTC. | |
| int | SetRealTimeClock (int fdPIC) |
| Sets the PIC clock to the current PC time. | |
| int | ReadAnalogueInputs (int fdPIC, unsigned int adcNum) |
| Reads the specified analogue port and displays to screen. | |
| int | ClearSwitchLog (int fdPIC) |
| Empties the power-off switch log buffer. | |
| int | ReadSwitchLog (int fdPIC) |
| Reads the entire power-off switch log and displays it to screen. | |
| int | ReadSwitches (int fdPIC) |
| Reads the switch position and displays to screen as an 8-bit binary value. | |
| int | CheckPICFlags (int fdPIC) |
| Reads the state of the internal PIC flags, and if any are set then it is displayed to screen. | |
| int | ReadBatteryVoltage (int fdPIC) |
| Reads the current PIC battery voltage and displays to screen. This is a 10-bit value with a corresponding range of 0 to 1023. | |
| int | ReadBatteryMaxRef (int fdPIC) |
| Reads the maximum battery reference voltage and displays to screen. This is a 10-bit value with a corresponding range of 0 to 1023. | |
| int | ReadMinETXVoltage (int fdPIC) |
| Reads the minimum ETX voltage and displays to screen. This is a 10-bit value with a corresponding range of 0 to 1023. | |
| int | 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 | ConfigureDigitalInput (int fdPIC, int input) |
| Configures either RA2 or RA4 as a digital input. | |
| int | ConfigureAnalogueInput (int fdPIC, int input) |
| Configures either RA2 or RA4 as an analogue input. | |
| void | BitDump (int num, int numBits) |
| Displays an integer value in binary format. | |
| int | main (int argc, const char **argv) |
|
|
|
|
||||||||||||
|
Controls battery fast charge. Please note that it is not recommended to leave the battery fast charging for long periods of time.
|
Here is the call graph for this function:

|
||||||||||||
|
Displays an integer value in binary format.
|
|
|
Reads the state of the internal PIC flags, and if any are set then it is displayed to screen. The following PIC flags are checked:
|
Here is the call graph for this function:

|
|
Empties the power-off switch log buffer.
|
Here is the call graph for this function:

|
||||||||||||
|
Configures either RA2 or RA4 as an analogue input.
|
Here is the call graph for this function:

|
||||||||||||
|
Configures either RA2 or RA4 as a digital input.
|
Here is the call graph for this function:

|
|
Displays to screen both the current issue of this software in addition to the firmware version of the PIC.
|
Here is the call graph for this function:

|
||||||||||||
|
|
Here is the call graph for this function:

|
||||||||||||
|
Reads the specified analogue port and displays to screen.
|
Here is the call graph for this function:

|
|
Reads the maximum battery reference voltage and displays to screen. This is a 10-bit value with a corresponding range of 0 to 1023.
|
Here is the call graph for this function:

|
|
Reads the current PIC battery voltage and displays to screen. This is a 10-bit value with a corresponding range of 0 to 1023.
|
Here is the call graph for this function:

|
|
Reads the minimum ETX voltage and displays to screen. This is a 10-bit value with a corresponding range of 0 to 1023.
|
Here is the call graph for this function:

|
|
Displays to screen the last PIC power off and power on times.
|
Here is the call graph for this function:

|
|
Displays to screen the current PIC RTC.
|
Here is the call graph for this function:

|
|
Reads the switch position and displays to screen as an 8-bit binary value.
|
Here is the call graph for this function:

|
|
Reads the entire power-off switch log and displays it to screen.
|
Here is the call graph for this function:

|
|
Sets the PIC clock to the current PC time.
|
Here is the call graph for this function:

1.3.6