atari Module
Files:
Interface
Function: AtariInit
Arguments: None
Returns: Nothing
Initializes the ports for use with the Atari interface.
Function: ToggleButton
Arguments: state: A constant specifying what state to make the button. Takes ON, OFF, or TOGGLE.
Returns: Nothing
Changes the state of a button. Can specify either on, off, or toggle.
Function: GetPowerStatus
Arguments: None
Returns: The power status. Either HI or LO.
Gives whether the power status from the protection board is HI or LO.
Pseudo-Code
AtariInit(Takes and returns nothing.)
set the data direction of the atari power pin to read
for each control pin:
set the pin to off
set the data direction to write
endfor
ToggleButton(Takes constants of the button to toggle and the state to toggle it to.)
if the passed-in state is ON:
set the pin corresponding to the passed-in button to HI
else if the passed-in state is OFF:
set the pin corresponding to the passed-in button to LO
else if the passed-in state is TOGGLE:
toggle the pin corresponding to the passed-in button to the opposite of what it
was previously
GetPowerStatus(Returns a constant indicating the Atari's power status.) read whether the power pin is HI or LO return the opposite of the power pin status