Help > RITTLE FOR THE PIC32MZ MICROCONTROLLER > Work with Communication Interfaces > trmt


trmt (text_interface, any_data [, any_data, …] );

Transmit data to the specified interface.

The interfaces is specified in text form – “UART1”, “SPI2”, etc.

Specifically for the I2C case, the interface also includes an optional action, immediately following the interface identifier.

Actions can be

:S     - The transmission is preceded by an I2C start condition.

:P     - The transmission is followed by an I2C stop condition.

:R     - The transmission is preceded by an I2C repeated start condition.

Data elements can be one or more of integer, real, or text type. Integer information sends a single data word, real is transmitted in its native form (8 bytes), and text is transmitted as a zero-terminated string of bytes.


trmt “UART2”, 10, 20, 30, 40;     ‘ send bytes 10, 20, 30, 40, to UART2

trmt “SPI1”, str1;                            ‘ str1 is a text variable transmitted over SPI1

trmt “IIC1:S”, 0x44;                        ‘ a start condition followed by byte 0x44 is
‘ transmitted over I2C. The bus remains open for
‘ following bytes

trmt “IIC1:P”, 0x80, 0xfe;             ‘ a stop condition is generated after sending the
‘ supplied sequence of bytes