12-2 Chapter 12: Cash Drawer Interface
long OpenDrawer();
OpenDrawer(),setsthecontrolbitstooutput,enablesthearming
circuitryusingthearmbit,energizesthesolenoidoftheselected
drawer,waitsaconstanttime,thenreleasesthecashdrawer
solenoid(s)bit(s)anddisablesthearmingcircuit.Theseoutputbits
arethenconfiguredasinputsagain.Thismethod
usesSetState()for
controllingthedrawer.SeethesectiononHardware/Firmware
Interfacesformoredetail.
void ClosePort();
ClosePort()resetstheportopenedstatusflagtofalse.
DWORD GetDrawerStatus();
GetDrawerStatus(),readsfromtheportthatmonitorsthecash
drawerstatusbitandmasksunusedbitstodeterminethedrawer
state.Thismethod
usesReadIOPort()formonitoringthestatusbit.
SeethesectiononHardware/FirmwareInterfacesformoredetail.
BOOL SetState( DWORD dwState );
SetState(),usestheconstantmaskstocreatethedatatowritetothe
portthatcontrolthecashdrawersolenoid(s)bit(s).Thismethod
usesWriteIOPort()forcontrollingthesolenoid(s).Seethe
section
onHardware/FirmwareInterfacesformoredetail.
BOOL QueryConf();
InQueryConf(),wemustinitiateaconfigurationcyclewiththePCI
registersthatcontrolthecashdrawersolenoid(s)andmonitorthe
statusbit.InteractionwithGPIO_BASE(GeneralPurposeI/OBase
AddressRegister)takesplaceinordertodeterminetheportaddress
used
forcontrollingthesolenoid(s)andformonitoringthestatus
bit.SeethesectiononHardware/FirmwareInterfacesformore
detail.