Component: Injector (DS1307 RTC) (Comms)

From Flowcode Help
Revision as of 10:34, 28 July 2016 by BenR (talk | contribs)
Jump to navigationJump to search


Author Matrix Ltd
Version 1.0 (Release)
Category Comms
This inherits from Data Injector Template


Image Injector (DS1307 RTC) component

Comms data injector to allow simulation of a DS1307 Real Time Clock and RAM.

Examples

This example uses the I2C master component combined with the DS1307 injector to simulate an I2C communications bus between the target Microcontroller and the virtual DS1307 device.

FC6 Icon.png I2C DS1307 Example

The panel displays the current time from the DS1307 RAM which is populated to match the system time.

DS1307Panel.jpg


The I2C console shows the communications between the target microcontroller and simulated I2C device.

DS1307Data.jpg


The DS1307 console shows the contents of RAM memory on the simulated I2C device.

DS1307Ram.jpg


Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

This component inherits simulation macros from Data Injector Template

InitialiseInjector

Sets up the injector ready to receive commands or send data

Parameters

<- STRING InjectorName
Name of the console that will be created
This parameter may be returned back to the caller


Return value

BYTE


RxByteCount

Returns the number of bytes currently sat in the receive buffer.

Parameters

This macro has no parameters


Return value

UINT


TxByte

Puts a byte onto the comms channel.

Parameters

BYTE DataByte


Return value

This call does not return a value


RxByte

Attempt to receive a byte back from the injector

0 - 255 = Valid data

256 = RX timeout no data available

Parameters

This macro has no parameters


Return value

UINT


GetTxConsoleHandle

Gets the handle to the console allowing data displaying on the panel etc.

This call is provided by Data Injector Template

Parameters

This macro has no parameters


Return value

HANDLE


ChangeState

Changes the state for I2C or SPI type comms where the data bytes along are not enough to go on.

Parameters

BYTE NewState


Return value

This call does not return a value


GetRxConsoleHandle

Gets the handle to the console allowing data displaying on the panel etc.

This call is provided by Data Injector Template

Parameters

This macro has no parameters


Return value

HANDLE


GetConsoleHandle

Gets the handle to the console allowing data displaying on the panel etc.

Parameters

This macro has no parameters


Return value

HANDLE



Property reference

Circular Buffer Size

This property is of type Unsigned integer and can be referenced with the variable name CircularBufferSize.

No additional information


Termination Character

This property is of type Fixed list of ints and can be referenced with the variable name TermChar.

No additional information


Device Address

This property is of type Unsigned integer and can be referenced with the variable name DeviceAddress.

No additional information