Sun Microsystems S16A manual S16aserialstr, S16aserialwrite

Page 20

Input and Output

S16A User’s Guide

s16a_serial_str

Description

Send a command string to the Analog Input Module. Read the response from the AIM and return it only if it differs from the command string sent. Otherwise return NULL. This routine is especially useful for command strings, which echo the command string, unless an error occurs.

Syntax

char *s16a_serial_str(S16aDev *s16a_p, char *str);

Arguments

 

s16a_p

S16A device struct, returned from s16a_open

str

Null-terminated command string to send to the Analog Input Module

Return

NULL indicates a response string that matches the input command string, which indicates successful transmission. Otherwise, this routine returns a pointer to a string containing the characters received in response to the command string. The response string is in a single buffer allocated by the library. Therefore, if you need to preserve the response string, you must copy it to another buffer before making another libs16a.a library call. Sets errno on failure.

s16a_serial_write

Description

Send a command string to the Analog Input Module.

Syntax

int s16a_serial_write(S16aDev *s16a_p, char *buf, size);

Arguments

 

s16a_p

S16A device struct, returned from s16a_open

buf

Array of characters containing the command string to send to the Analog Input Module

size

Number of characters in the command string

Return

Success: number of characters transferred; –1 on driver error. Sets errno on failure.

16

EDT, Inc. October, 1996

Image 20
Contents S16A EDT, Inc. October Contents Tables Overview Installation Installing the HardwareInstalling the Software Using SunOS VersionS16A User’s Guide Installation Using System V Release 4 Solaris 2.4 or Later Building the Sample ProgramsIncluded Files ReadmeInput and Output Elements of S16A ApplicationsGeneral DMA Library Routines DMA Library RoutinesRoutine Description S16abufferaddresses S16A-specific Library RoutinesSyntax ArgumentsS16achecknextbuffer S16acancelS16acancelcurrent S16aclose S16aconfigureringbuffers ArgumentsS16adone S16agetdaccontrolregS16agetdiodatareg S16agetdiodirectionregS16agetoutputbits S16aopenS16aread S16aserialreadS16aserialstr S16aserialwriteS16asetdefaults S16asetdaccontrolregS16asetdiodatareg S16asetdiodirectionregS16asetoutputbits S16astartbuffersS16astopbuffers S16awaitforbufferS16awaitfornextbuffer S16awriteError Codes and Conditions Error ConditionsFoiparityerror Hardware Interface Electrical InterfaceS16A Interface Signals Interface SignalsSignal S16A I/O Description Connector Pinout Connector PinoutPin Signal Registers SBus Addresses S16A ROMNext DMA Address Registers DMA RegistersCurrent DMA Address Registers Current Count Registers Control and Next Count RegistersDirect I/O Registers DAC Output Control RegisterDIO Direction Register DIO Data RegisterAnalog Input Module Internal Registers DAC Output Control RegisterName Description Analog Input Module Internal RegistersInput Configuration Registers Input Clock Prescale RegistersTrim Registers Input Gain High Byte ValuesTrim Register Use Trim Registers Trim Output Offset RegistersTemperature Register Analog Input Module Uart RegistersAnalog Input Module Control Protocol Trim Input Gain RegistersWrite to an Input Configuration Register Read from an Input Configuration RegisterWrite to a Clock Prescale Register Read from a Clock Prescale RegisterUart Command/Status Register Read the Temperature RegisterUart Command/Status Register Write to a Trim RegisterXilinx Programming Registers Uart Data RegisterSpecifications References Contacting EDT Index 15-16Configuration ROM