7-2
Chapter 7: Cash Drawer Interface
long OpenDrawer();
OpenDrawer (), sets the control bits to output, enables the arming
circuitry using the arm bit, energizes the solenoid of the selected
drawer, waits a constant time, then releases the cash drawer
solenoid(s) bit(s) and disables the arming circuit. These output bits
are then configured as inputs again. This method uses SetState() for
controlling the drawer. See the section on Hardware/Firmware
Interfaces for more detail.
void ClosePort();
ClosePort() resets the port opened status flag to false.
DWORD GetDrawerStatus();
GetDrawerStatus (), reads from the port that monitors the cash
drawer status bit and masks unused bits to determine the drawer
state. This method uses ReadIOPort () for monitoring the status bit.
See the section on Hardware/Firmware Interfaces for more detail.
BOOL SetState( DWORD dwState );
SetState (), uses the constant masks to create the data to write to the
port that control the cash drawer solenoid(s) bit(s). This method
uses WriteIOPort () for controlling the solenoid(s). See the section
on Hardware/Firmware Interfaces for more detail.
BOOL QueryConf();
In QueryConf(), we must initiate a configuration cycle with the PCI
registers that control the cash drawer solenoid(s) and monitor the
status bit. Interaction with GPIO_BASE (General Purpose I/O Base
Address Register) takes place in order to determine the port address
used for controlling the solenoid(s) and for monitoring the status
bit. See the section on Hardware/Firmware Interfaces for more
detail.