Description: coin changer driver
Source: money.asm
Wrapper: money.c


The Money module handles detecting when coins are inserted, as well as controlling the parts of the hardware that are connected to the Coke machine coin changer. When a coin is inserted and accepted, the appropriate message is generated.


MESSAGE_Money_NickelInserted a nickel was deposited
MESSAGE_Money_DimeInserted a dime was deposited
MESSAGE_Money_QuarterInserted a quarter was deposited


cokerr Money_QueryVersion (char* versionstring)
returns the version string.

cokerr Money_SetCREMs (byte cremstate)
accepts or rejects incoming coins. If cremstate is 0, coins are rejected; if cremstate is 1, coins are accepted (except when a purchase is pending) and generate messages.

cokerr Money_SetLight (byte lightstate)
turns on or off the "Exact Change Required" light. If lightstate is 0, the light is turned off; if lightstate is 1, the light is turned on.

cokerr Money_AllowPurchase ()
puts the machine in a state where the next virtual button push (Button_Push ()) will release a frosty beverage. Button_ReleaseBeverage() is recommended instead, to take care of the entire process.

cokerr Money_ReleaseNickel ()
makes a nickel fall into the coin return slot. This command can be called multiple times in succession in order to release multiple nickels.

cokerr Money_CheckNickelTube ()
returns successful if there are nickels in the nickel tube; returns an error if the nickel tube is empty (no more nickels can be released).
Errors: ERROR_Money_NickelTubeEmpty