SWSPI
 
General Info
Properties
Methods
Events
Typical Usage



Embedded Beans
CPU Beans
About Beans
Bean Categories



 
 Bean SWSPI
 
Software synchronous serial communication

Methods are user callable functions/subroutines that are means of controlling the bean functions.

Methods:

  • RecvChar - If any data received, this method returns one character, otherwise it returns an error code (it does not wait for data).

      ANSIC prototype: byte RecvChar(byte *Chr)
    • Chr: Pointer to byte - A pointer to the received character.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_RXEMPTY - No data in receiver
      ERR_OVERRUN - Overrun error is detected

  • SendChar - Sends one character to the channel.

      ANSIC prototype: byte SendChar(byte Chr)
    • Chr:byte - Character to send.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK

  • CharsInRxBuf - Returns number of characters in the input buffer.

      ANSIC prototype: byte CharsInRxBuf(word *Chr)
    • Chr: Pointer to word - A pointer to the number of characters in the input buffer.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK

  • CharsInTxBuf - Returns number of characters in the output buffer.

      ANSIC prototype: byte CharsInTxBuf(word *Chr)
    • Chr: Pointer to word - A pointer to the number of characters in the output buffer.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK

  • SetShiftClockPolarity - Sets the shift clock polarity at runtime. Output data will be shifted on the selected edge polarity.

      ANSIC prototype: byte SetShiftClockPolarity(byte Edge)
    • Edge:byte - Edge polarity, possible values:
      0-falling edge,
      1-rising edge.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK

  • SetIdleClockPolarity - Set the idle clock polarity at runtime. If communication does not run, the clock signal will be set to the required level.

      ANSIC prototype: byte SetIdleClockPolarity(byte Level)
    • Level:byte - Idle clock polarity:
      0-low
      1-high
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK


Note: Some methods can be implemented as macros.



©1997-2004, UNIS, Ltd.