1.1.10.4.6 DRV_USART_SerialSetup Function

1.1.10.4.6 C

bool DRV_USART_SerialSetup
(
    const DRV_HANDLE handle,
    DRV_USART_SERIAL_SETUP* setup
)

1.1.10.4.6 Summary

Sets the USART serial communication settings dynamically.

1.1.10.4.6 Description

This function sets the USART serial communication settings dynamically.

1.1.10.4.6 Precondition

DRV_USART_Open must have been called to obtain a valid opened device handle. The USART transmit or receive transfer status should not be busy.

1.1.10.4.6 Parameters

ParametersDescription
handleA valid open-instance handle, returned from the driver's open routine
setupPointer to the structure containing the serial setup

1.1.10.4.6 Returns

True - Serial setup was updated successfully.

False - Failure while updating serial setup.

1.1.10.4.6 Example

// 'handle', returned from the DRV_USART_Open

DRV_USART_SERIAL_SETUP setup = {
    115200,
    DRV_USART_PARITY_ODD,
    DRV_USART_DATA_8_BIT,
    DRV_USART_STOP_1_BIT
};

DRV_USART_SerialSetup(handle, &setup);

1.1.10.4.6 Remarks

This routine must not be called from the interrupt context.