12-4 Chapter 12: Cash Drawer Interface
Component Architecture
Thedevelopershouldprovideadescription,eithertextuallyor
diagrammatically(i.e.,blockdiagram),ofhowthecomponentsofthe
modulesubsysteminteractinthissub‐section.
ThememberfunctionInitialize()issubsequentlycalledtoopenthe
NCRWindowsNTportdriver(ifapplicable)andperformother
initializationtasks.Then,thedevice’s
OpenPort()memberfunctionis
calledtomakethedeviceavailable,atwhichtimeQueryConf()iscalled.
Oncethedevicehasbeenconfigured,thememberfunctions
OpenDrawer(),GetDrawerStatus()andSetState()canbecalledtointeract
withthecashdrawer.Thesemethodsthemselvesinvokethemember
functionsWriteIOPort()andReadIOPort()toactuallysend
andreceive
datatothecashdrawerviatheportaddressesobtainedinQueryConf().
Code Changes
Followingisanenumerationofthecodechangesneededtosupportthe
7402:
TheinterfaceofthenewdevicesupportstwoseparatefieldsforGPIO
selectportaddress(read/write)andsolenoidandstatusbitport
address(read/write).ThechipGPIObitsmustbeselectedforuseas
GPIOandaseither
inputoroutput.
Itisdesiredthatthedrivingcircuitbedisabledatpoweronandwhen
notactivelydrivingthesolenoid.Twooutputcontrolimplementations
willbeused:
1. Usethem_nIOPort_Selectaddressregistertosetthesolenoidbitto
anoutputfunctionbeforedrivingthebithigh
usingm_nIOPort,set
thesolenoidbitlowafterthechargingtimeandthensettingthebit
functiontoinputusingm_nIOPort_Select.