Serial.write() hexadecimal value

Hi,

I'm looking at this code that sends a hexadecimal value to a serial device.

Serial.write(0xAA);

I'm learning to port code to pure c on a microcontroller. The uart write function declaration for the microcontroller is below. It says that it performs a

single character write

. Is the hexadecimal value a single character.

Does this mean that you can can this function as

ti_uart_write(QM_UART_0, 0xAA);

/**
 * Perform a single character write on the UART interface.
 * This is a blocking synchronous call.
 *
 * @brief UART character data write.
 * @param [in] uart UART index.
 * @param [in] data Data to write to UART.
 * @return ti_rc_t QM_RC_OK on success, error code otherwise.
 */
ti_rc_t qm_uart_write(const ti_uart_t uart, const uint8_t data);

Is the hexadecimal value a single character.

No. It is a single byte. Any code that outputs binary data and talks about chars was written by someone I would not trust.

Does this mean that you can can this function as

Knowing one (incorrect) phrase from the function description is NOT a basis for making that assumption.

Besides Paul’s comments, which are on a more philosophical level,

of course you can write

  qm_uart_write(QM_UART_0, 0xAA);

0xAA is a perfect value for a const uint8_t parameter.

Thank you for your help.