Skip to content

905 Interface Binding And Roles ​

905-interface-binding-roles.mc covers binding a physical pin range to a named interface and role. Tutorial first use: 03-define-components-and-interfaces.

Syntax synopsis:

text
pins = [
    io 1:2 = UART0::UART.TTL(DCE)
]
bash
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 90-language-reference/905-interface-binding-roles.mc --lib mcode --pass1 --pass2

Source ​

text
// Reference: Interface Binding And Roles
// Focus: binding a physical pin range to a named interface role.

component REF_UART_DEVICE
{
    name = "Reference UART Device"
    pins = [
        io 1:2 = UART0::UART.TTL(DCE)
        psnk [3,4] = [VCC, GND]
    ]
}

module main
{
    io GND
    io V3V3

    DC.SRC PWR(3.3V, 20mA)
    REF_UART_DEVICE U_DEV
    HDR.1X3 J_DEBUG

    PWR.1 -> V3V3
    PWR.2 -> GND
    V3V3 -> U_DEV.VCC
    U_DEV.GND -> GND

    U_DEV.UART0.TX -> J_DEBUG.1
    U_DEV.UART0.RX -> J_DEBUG.2
    GND -> J_DEBUG.3
}

MCode Bench is the public face of the MCode stack. Closed capabilities are served through the MCode gateway.