SW_I2C
 
 
 Bean SW_I2C
 
SW emulated I2C using two I/O pins.

Events are functions called when some important event occurred and its processing starts.

Events:

  • EventModule - Name of the user module (without extension), where the events from this bean are placed.
  • BeforeNewSpeed - This event is called when the CPU speed mode is being changed (using CPU methods) - before the change. The event is enabled only if speed modes are supported in the target CPU bean (more than one speed mode).

      ANSIC prototype: void BeforeNewSpeed(void)

  • AfterNewSpeed - This event is called when the CPU speed mode is being changed (using CPU methods) - after the change. The event is enabled only if speed modes are supported in the target CPU bean (more than one speed mode).

      ANSIC prototype: void AfterNewSpeed(void)

  • OnRxChar - Called when a correct character is received. In the SLAVE mode, this event is not called if the bean receives the first byte with slave address and R/W bit.

      ANSIC prototype: void OnRxChar(void)

  • OnTxChar - Called when a correct character is sent. In MASTER mode, this event is not called if the bean sends the first byte with slave address and R/W bit.

      ANSIC prototype: void OnTxChar(void)

  • OnFreeTxBuf - When working as the MASTER, if the Output buffer size property is different from zero, this event is called when the output buffer becomes empty during transmitting from it. If the Output buffer size property is equal to zero, the event is not provided. This event is not provided for the SLAVE mode.

      ANSIC prototype: void OnFreeTxBuf(void)

  • OnNACK - In the MASTER mode, this event is called when an invalid slaves acknowledgement occurs during communication transfer. If the acknowledge polling is provided (MASTER mode only), i.e., the Acknowledge polling trials property value is higher than one, this event is called only when no trial is successful. In the SLAVE mode, this event is called when a master sends an acknowledgement instead of no acknowledgement at the end of the last byte transfer.

      ANSIC prototype: void OnNACK(void)


For each generated event it is possible to set:
  • Procedure Name - name of procedure (written by user) that handles the event.



Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.