Files
fpp/docs/spec/Specifiers/Internal-Port-Specifiers.adoc
Rob Bocchino 04f37768ae Update spec and version number
* Update spec to latest on state machines
* Update version number to v2.2.0
2024-10-01 09:00:54 -07:00

57 lines
1.2 KiB
Plaintext

=== Internal Port Specifiers
An *internal port specifier* specifies
a single-use port for use in handlers of the enclosing
<<Definitions_Component-Definitions,component>>.
A component can use an internal port to send a message
to itself.
==== Syntax
`internal` `port`
<<Lexical-Elements_Identifiers,_identifier_>>
_[_
`(`
<<Formal-Parameter-Lists,_param-list_>>
`)`
_]_
_[_
`priority` <<Expressions,_expression_>>
_]_
_[_
_queue-full-behavior_
_]_
_queue-full-behavior_ has the same syntax as for
<<Specifiers_Port-Instance-Specifiers_Syntax,port instance specifiers>>.
==== Semantics
The identifier is the name of the port.
The parameter list specifies the formal parameters of the
port.
Each formal parameter is a piece of data carried on the port.
The names of the formal parameters must be distinct.
No formal parameter may be a `ref` parameter.
The optional priority and queue full behavior have the same semantics as in
<<Specifiers_Port-Instance-Specifiers_Semantics, async input port instance
specifiers>>.
==== Examples
[source,fpp]
----
@ Port 1
internal port Port1(
a: U32 @< Parameter a
b: F64 @< Parameter b
)
@ Port 2
internal port Port2(
a: U8 @< Parameter a
b: I32 @< Parameter b
) priority 10 drop
----