TABLE OF CONTENTS


/IO_Ports [ Modules ]

[ Top ] [ Modules ]

DESCRIPTION

Pins & Ports IO subsystem


IO_Ports/Os_port_config_pin [ Functions ]

[ Top ] [ IO_Ports ] [ Functions ]

DESCRIPTION

Configures a pin as input/output and to use the internal pullup

DECLARATION

Sub Os_port_config_pin(byref Port As Word , Byval Pin As Byte , Byval Direction As Byte , Byval Pullup As Byte)

SOURCE

   Os_enter_critical
   Port.pin = Pullup
   Incr Port
   Port.pin = Direction
   Os_exit_critical
End Sub

IO_Ports/Os_port_get_pin [ Functions ]

[ Top ] [ IO_Ports ] [ Functions ]

DESCRIPTION

Gets the pin's input state

DECLARATION

Function Os_port_get_pin(byref Port As Word , Byval Pin As Byte) As Byte

SOURCE

   Local Portvalue As Byte
   Port = Port + 2
   Os_enter_critical
   Portvalue = Inp(port)
   Os_exit_critical
   Portvalue = Portvalue.pin
   Os_port_get_pin = Portvalue
End Function

IO_Ports/Os_port_set_pin [ Functions ]

[ Top ] [ IO_Ports ] [ Functions ]

DESCRIPTION

Sets the pin's output state

DECLARATION

Sub Os_port_set_pin(byref Port As Word , Byval Pin As Byte , Byval Value As Byte)

SOURCE

   Local Portvalue As Byte
   Os_enter_critical
   Portvalue = Inp(port)
   Portvalue.pin = Value
   Out Port , Portvalue
   Os_exit_critical
End Sub

IO_Ports/Os_port_toggle_pin [ Functions ]

[ Top ] [ IO_Ports ] [ Functions ]

DESCRIPTION

Toggles a pin

DECLARATION

Sub Os_port_toggle_pin(byref Port As Word , Byval Pin As Byte)

SOURCE

   Local Portvalue As Byte
   Os_enter_critical
   Portvalue = Inp(port)
   Portvalue.pin = Not Portvalue.pin
   Out Port , Portvalue
   Os_exit_critical
End Sub