librpipUartConfigRead

uint32_t librpipUartConfigRead(uint32_t id, uint32_t* baud, uint32_t* csize, uint32_t* parity, uint32_t* stop, uint32_t* mode);

Description

Gets the configuration for a UART.

Parameters

  • uint32_t id
    The I2C bus to configure. The I2C bus needs to have been detected during the librpipInit().
  • uint32_t* baud
    A pointer to a unit32_t to hold the baud rate currently set.
  • uint32_t* csize
    A pointer to a unit32_t to hold the word size currently set.
  • uint32_t* parity
    A pointer to a unit32_t to hold the parity currently set.
  • uint32_t* stop
    A pointer to a unit32_t to hold the stop bits currently set.
  • uint32_t* mode
    A pointer to a unit32_t to hold the mode currently set.

Returns

0 on failure or 1 on success.

Example

Get the configuration of UART0:

uint32_t feature_set, baud, csize, parity, stop, mode;
feature_set = librpipInit(LIBRPIP_BOARD_DETECT, LIBRPIP_FLAG_DEBUG_ON, 0);
if(feature_set & LIBRPIP_FEATURE_UART0) { 
        librpipUartConfigRead(0, &baud, &csize, &parity, &stop, &mode);
}