POWERplate24 Command Reference
Note that the addr argument is always set to 0 (zero)

>>>General<<<
help() - this will display a summary of all of the commands associated with the
POWERplate24

getID(0) - returns the string "Pi-Plates POWERplate24"

>>>Monitor Functions<<<
getHVin(0) - returns the measured input voltage with an accuracy of ±2%

getVin(0) - returns the measured +5VDC voltage with an accuracy of ±2%
  
getCPUtemp() - this function allows you to monitor the CPU temperature on the
Raspberry Pi. This a system function and not specific to the POWERplate24 so no
address argument is required.

>>>Power Status Functions<<<
statEnable(0) - after executing this function, the POWERplate24 will pull down
on STAT pin (GPIO22) if a change occurs to the power status of the external DC
supply.

statDisable(0) - instructs the POWERplate24 to stop asserting status changes on
GPIO22.

getPOWstatus(0) - returns an eight bit value reflecting the current power status
of the POWERplate24. The format is:
    _____________________________________
    |X|X|X|X|X|X|LOW_DC_IN|LOW_BAT|NO_AC|
    -------------------------------------
    *LOW_DC_IN is set to one if the external DC voltage is less than 8VDC
    *LOW_BAT is routed from the external DC supply. For the MeanWell DRC
    family, this bit will be set to 1 if the attached battery drops below 11V
    (12V supply) and 22V (24V supply).
    *NO_AC is set to one when the external UPS-capable power supply is operating
    on battery power.

getPOWchange(0) - returns the contents of the Power Status Change register. The
contents of this register are then cleared and the status pin is reset if
enabled and asserted.

getSTATflag(0) - this is a convenience function that returns the value of the
STAT flag (GPIO22). If enabled, this will return a boolean 'True' if a change
has occurred in the external power supply and a 'False' otherwise.

>>>Wake Scheduler<<<
setRTC(0,zone) - by default, the POWERplate24 mirrors the real time clock using
the local time zone. This local clock gets set whenever the POWERplate24 module
is loaded and does not require any user intervention. However, it it possible to
override the time zone with one of two values:
    'L' - use local time zone
    'G' - use Greenwich meantime also known as "zulu" time.
    
setWAKE(0,hour,minute,second) - sets the wakeup time on the POWERplate24 in 24
hour format. The ranges for each argument are:
    hour should be between 0 and 23
    minute should be between 0 and 59
    second should be between 0 and 59
    
enableWAKE(0) - this function enables the wakeup mode. It should be preceded
with the setWAKE call and followed by the powerOFF command.

disableWAKE(0) - this is a complementary function to enableWAKE - it's primarily
useful during programming and troubleshooting.

getWAKESOURCE(0) - this function allows the bootup script to interrogate what
caused the POWERplate24 to apply power to the stack.  For example, if the
POWERplate24 powers up the stack because of a scheduled wake then the bootup
script might make a series of measurements, update a database, then shutdown.
But, if the pushbutton causes the powerup, then the script might exit
immediately and not shutdown. This function will return the following values:

    0 - initial power up
    1 - power applied with pushbutton
    2 - power applied with scheduled wakeup
    
powerOFF(0) - simulates the pushbutton and performs the powerdown sequence. This
function only works correctly if the line "dtoverlay=gpio-shutdown,gpio_pin=24"
has been added to the end of the /boot/config.txt file.

>>>LED Control<<<
setLED(0,led) - this function allows manual control of the bicolor LED on the
facing edge of the board. The led argument is a string with one of the following
case independent values:
    'RED'
    'GREEN' or 'GRN'
    'YELLOW' or 'YEL'
    'OFF'
    
ledMODE(0,mode) - the default state of the LED is to be on at all times. But, to
reduce power consumption, it can be programmed to blink at a 1 second rate with
a 12.5% duty cycle or stay off. The mode arguments to do this are shown below.
Note that this setting is saved on the POWERplate24 and will be retained between
power cycles. Holding the pushbutton down for 10 seconds will reset this setting
to mode 0.
    mode 0: auto: always off
    mode 1: auto: blink
    mode 2: auto: always on (default)
    mode 3: manual - set automatically when the setLED command is issued.


>>>Fan Control<<<
fanON(0) - sets the cooling fan to the ON state. This setting is saved on the
POWERplate24 and will be retained between power cycles.

fanOFF(0) - sets the cooling fan to the OFF state. This setting is saved on the
POWERplate24 and will be retained between power cycles. Holding the pushbutton
down for 10 seconds will reset this setting to the ON state.

fanSTATE(0) - returns a 1 if the fan is on and a 0 if off.

>>>Pushbutton / Power Control<<<
getSWstate(0) - this function provides a programmatic method of reading the
status of the button. Returns a 1 if the button is pressed and a 0 otherwise.

enablePOWERSW(0,BYPASS) - this tells the POWERplate24 to initiate the power
control functions when the pushbutton is held down for 3 seconds. This setting
is saved on the POWERplate24 and will be retained between power cycles. This
function only works correctly if the line dtoverlay=gpio-shutdown,gpio_pin=24
has been added to the end of the /boot/config.txt file. Note that if the
optional variable BYPASS is set to True, the POWERplate24 will bypass the switch
and power up the stack whenever a DC supply is initially plugged in. If set to
False, the POWERplate24 will wait for the user to hold the button down for 3
seconds before applying power to the rest of the stack. Note that the default
BYPASS value is True. 

disablePOWERSW(0) - this disables pushbutton control of power. This setting is
saved on the POWERplate24 and will be retained between power cycles.

setSHUTDOWNdelay(0,delay) - by default, after the POWERplate24 instructs the
Raspberry Pi to power down, it delays for 20 seconds to allow the OS to complete
the shutdown function. This delay can be modified to be in the range of 10 to
240 seconds. Avoid setting this value for anything less than 20-30 seconds with
older versions of the RPi. Note that this value is saved on the POWERplate24 and
will be retained between power cycles. Holding the pushbutton down for 10
seconds will rest this value to 20 seconds.