[][src]Function mraa_sys::mraa_uart_settings

pub unsafe extern "C" fn mraa_uart_settings(
    index: c_int,
    devpath: *mut *const c_char,
    name: *mut *const c_char,
    baudrate: *mut c_int,
    databits: *mut c_int,
    stopbits: *mut c_int,
    parity: *mut mraa_uart_parity_t,
    rtscts: *mut c_uint,
    xonxoff: *mut c_uint
) -> mraa_result_t

Get the current settings of an UART. This is an unintrusive function. Meaning it intends not to change anything, only read the values without disturbing.

All but the first index parameter are "outparameters". That means they can contain values on return. If any parameter is not interesting, a null pointer can be sent instead as a placeholder. The devpath parameter can be either in or out parameter. In case of a negative index, the UART is identified using *devpath instead. This functionality is intended for and needed by for instance USB serial adapters.

In case of a non-success return value, the outparameters are undefined.

@param index uart index to look up, if negative, *devpath will be used instead @param devpath points to the device path of the UART, eg: /dev/ttyS0 @param name outparameter that on return will point to the name of the UART @param baudrate pointer to an integer to contain the current baudrate (0--4M) @param databits pointer to an integer to contain the number databits (5--8) @param stopbits pointer to an integer to contain the number stopbits (1--2) @param parity will contain the current parity mode @param rtscts will point to non-zero if CTS/RTS flow control is enabled, zero otherwise @param xonxoff will point to a non-zero value if xon/xoff flow control is enabled @return result