Difference between revisions of "Component: LIN Master (Comms)"

From Flowcode Help
Jump to navigationJump to search
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_LinMaster.fcfx FC_Comp_Source_LinMaster.fcfx]
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/LinMaster.fcfx FC_Comp_Source_temp/LinMaster.fcfx]
  
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_LinMaster.fcfx FC_Comp_Source_LinMaster.fcfx]
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/LinMaster.fcfx FC_Comp_Source_temp/LinMaster.fcfx]
  
 
==Detailed description==
 
==Detailed description==
Line 77: Line 77:
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
 +
 +
  
  
Line 84: Line 86:
  
 
==Macro reference==
 
==Macro reference==
 +
 +
===GetState===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetState'''
 +
|-
 +
| colspan="2" | Returns the current state&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
===Initialise===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Initialise the component&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
  
 
===PowerDown===
 
===PowerDown===
Line 99: Line 129:
  
  
===GetState===
+
===ReadData===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetState'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadData'''
 +
|-
 +
| colspan="2" | Returns a data byte indexed by Idx&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Returns the current state&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Idx
 
|-
 
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
Line 113: Line 148:
  
  
===debug===
+
===ReadDataCount===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''debug'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDataCount'''
|-
 
| colspan="2" | &nbsp;
 
 
|-
 
|-
 +
| colspan="2" | Returns the data count size&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | idx
 
|-
 
| colspan="2" | &nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
Line 161: Line 191:
  
  
===ReadDataCount===
+
===SendMessageWithData===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDataCount'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendMessageWithData'''
 +
|-
 +
| colspan="2" | Sends a message with data of length DataCount. See SetData&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Identifier
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | DataCount
 +
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
| colspan="2" | Returns the data count size&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Checksum
 
|-
 
|-
 +
| colspan="2" | 0=Classic, 1=Enhanced&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
Line 229: Line 274:
  
  
===ReadData===
+
===WakeUp===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadData'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WakeUp'''
 
|-
 
|-
| colspan="2" | Returns a data byte indexed by Idx&nbsp;
+
| colspan="2" | Wake Up the device&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" | Idx
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
===SendMessageWithData===
+
===debug===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendMessageWithData'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''debug'''
 
|-
 
|-
| colspan="2" | Sends a message with data of length DataCount. See SetData&nbsp;
+
| colspan="2" | &nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Identifier
+
| width="90%" | idx
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | DataCount
 
 
|-
 
|-
 
| colspan="2" | &nbsp;
 
| colspan="2" | &nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Checksum
 
|-
 
| colspan="2" | 0=Classic, 1=Enhanced&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
===WakeUp===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WakeUp'''
 
|-
 
| colspan="2" | Wake Up the device&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" | Initialise the component&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}

Revision as of 12:02, 3 February 2023

Author Matrix Ltd
Version 1.2
Category Comms


LIN Master component

Low level routines for controlling a LIN master (1.3 & 2.0) interface.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_temp/LinMaster.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_temp/LinMaster.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples





Macro reference

GetState

Fc9-comp-macro.png GetState
Returns the current state 
Fc9-u8-icon.png - BYTE Return


Initialise

Fc9-comp-macro.png Initialise
Initialise the component 
Fc9-void-icon.png - VOID Return


PowerDown

Fc9-comp-macro.png PowerDown
Power Down the device 
Fc9-void-icon.png - VOID Return


ReadData

Fc9-comp-macro.png ReadData
Returns a data byte indexed by Idx 
Fc9-u8-icon.png - BYTE Idx
 
Fc9-u8-icon.png - BYTE Return


ReadDataCount

Fc9-comp-macro.png ReadDataCount
Returns the data count size 
Fc9-u8-icon.png - BYTE Return


SendMessage

Fc9-comp-macro.png SendMessage
Sends message with specified identifier and awaits a reply from a slave. Returns 0 to indicate a successful transaction. Returns 3 to indicate a timeout. Returns 6 to indicate a bad CRC. 
Fc9-u8-icon.png - BYTE Identifier
 
Fc9-u8-icon.png - BYTE ResponseCount
 
Fc9-u8-icon.png - BYTE ChecksumType
0=Classic, 1=Enhanced 
Fc9-u8-icon.png - BYTE Return


SendMessageWithData

Fc9-comp-macro.png SendMessageWithData
Sends a message with data of length DataCount. See SetData 
Fc9-u8-icon.png - BYTE Identifier
 
Fc9-u8-icon.png - BYTE DataCount
 
Fc9-u8-icon.png - BYTE Checksum
0=Classic, 1=Enhanced 
Fc9-u8-icon.png - BYTE Return


SetData

Fc9-comp-macro.png SetData
Sets the data bytes to be sent 
Fc9-u8-icon.png - BYTE Data1
 
Fc9-u8-icon.png - BYTE Data2
 
Fc9-u8-icon.png - BYTE Data3
 
Fc9-u8-icon.png - BYTE Data4
 
Fc9-u8-icon.png - BYTE Data5
 
Fc9-u8-icon.png - BYTE Data6
 
Fc9-u8-icon.png - BYTE Data7
 
Fc9-u8-icon.png - BYTE Data8
 
Fc9-void-icon.png - VOID Return


WakeUp

Fc9-comp-macro.png WakeUp
Wake Up the device 
Fc9-void-icon.png - VOID Return


debug

Fc9-comp-macro.png debug
 
Fc9-u8-icon.png - BYTE idx
 
Fc9-u8-icon.png - BYTE Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Baud Rate
LIN bus data rate in bits per second 
Fc9-type-10-icon.png Label
Label shown on the comms flasher component. 
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png TX
LIN Transmit Pin 
Fc9-type-5-icon.png RX
LIN Receive Pin  
Fc9-type-5-icon.png CS
LIN bus chip select pin 
Fc9-type-5-icon.png WAKE
LIN bus Wake up pin