Calibre UK UCA93 manual Int IOState

Page 17

CALIBRE

3.3.21.Write_IO_Pin

Function specification

int Write_IO_Pin (int IONumber, int IOState)

Parameters are:int IONumber

 

The number of the IO pin (0 or 1) to be driven

 

int IOState

Parameters returned

The required state (0 or 1) of the selected IO pin

int

 

Returns a 0 if function successful.

Prerequisites

Returns 0x800D if the transfer timed out.

None

Functional description

Two spare IO pins are available to drive external logic. IO0 is on PL1 pin 2 and

 

is an open drain driver. When driven low it can sink up to 10mA, when high it is

 

high impedance and cannot source current. A pullup resistor should be fitted to

 

the desired rail which should not exceed +5V. IO1 is on PL1 pin 3 and is a

 

complementary driver which can source or sink up to 10mA. Its logic levels are

 

fixed at 0V and +5V nominal.

3.3.22.Read_IO_Pin

Function specification

int Read_IO_Pin (int IONumber)

Parameters are:int IONumber

Parameters returned

The number of the IO pin (0 or 1) to be read

int

 

Returns the state (0 or 1) of the chosen IO pin if function successful.

Prerequisites

Returns 0x800D if the transfer timed out.

None

Functional description

Two spare IO pins are available which can be driven by external logic. IO0 is

 

on PL1 pin 2 and IO1 is on PL1 pin 3. These pins are normally high impedance

 

input unless specifically driven by the Write_IO_Pin function. They can be

 

driven high or low by external logic then read by the Read_IO_Pin function.

 

Normal 5V CMOS logic levels (0 < 1.5V, 1 > 3.5V) should be applied for reliable

 

reading.

Issue 1.0

Page 14

01/07/03

 

Image 17
Contents Calibre Calibre Contents General Introduction Connecting the Adapter to your SystemPacking List Bus Termination and ProtectionBus Capacitance Limitations/Cable Choice Variable Voltage Bus Power SupplyIntroduction Installing the AdapterLibraries for Programming in Microsoft Windows Environments Function Prototypes Calibre Int ownaddress Int SlaveBlockTimeoutInt ClockSpeed Int BusVoltageSendAddress Int DataByteInt I2CData NoneInt I2Cstatus Using the AdapterInt NoTries Int NoBytesToSendInt DataVal Returns an unused integerInt NoBytesToTransmit Int TimeoutInt RdData Int NoBytesToReceive Int PullupVoltage Int Int IOStateSendAddressNoStatus WriteByteNoStatus Stop Real-Time Bus MonitorAppendix a I2C Communications Adapter Status Codes Bit 4 The BER Bus Error BitBit 7 MSB The old PIN Bit Bit 5 The old STS BitPolling the Status Register and how to avoid it USB Bus CharacteristicsBlock Functions Block Write FunctionSlave Receiver Function Slave Transmitter FunctionCalibre Question Get corrupted transfers why is this? When the the Most Commonly Asked I2C QuestionsGeneral Questions Question Do you have software to talk to my........?