1.1.9.4.6 DRV_USART_SerialSetup Function
C
bool DRV_USART_SerialSetup
(
const DRV_HANDLE handle,
DRV_USART_SERIAL_SETUP* setup
)Summary
Sets the USART serial communication settings dynamically.
Description
This function sets the USART serial communication settings dynamically.
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.
Parameters
| Param | Description |
|---|---|
| handle | A valid open-instance handle, returned from the driver's open routine |
| setup | Pointer to the structure containing the serial setup. |
Returns
true - Serial setup was updated successfully.
false - Failure while updating serial setup.
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);Remarks
This routine must not be called from the interrupt context.
