📄 csl_uartaux.h
字号:
* @n Enables break condition of Universal asynchronous receive transmitter
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Enables break condition of Universal asynchronous receive transmitter
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartBreakEnable (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartBreakEnable (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->LCR, UART_LCR_BC, CSL_UART_LCR_BC_ENABLE);
}
/** ============================================================================
* @n@b CSL_uartBreakDisable
*
* @b Description
* @n Disables break condition of Universal asynchronous receive transmitter
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Disables break condition of Universal asynchronous receive transmitter
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartBreakDisable (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartBreakDisable (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->LCR, UART_LCR_BC, CSL_UART_LCR_BC_DISABLE);
}
/** ============================================================================
* @n@b CSL_uartConfigBaudRate
*
* @b Description
* @n Configures baudrate of Universal asynchronous receive transmitter
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
configBaud configur baud parameter of type CSL_UartBaudCoig
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Configures baudrate of Universal asynchronous receive transmitter
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
CSL_UartBaudConfig configBaud;
...
CSL_uartConfigBaudRate (hUart, configBaud);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartConfigBaudRate (
CSL_UartHandle hUart,
CSL_UartBaudConfig configBaud
)
{
Uint16 divisor;
CSL_UartRegsOvly uartRegs = hUart->regs;
divisor = configBaud.moduleClock/(16 * configBaud.baudrate);
/* To access divisor latches of the baud generator */
CSL_FINSR(uartRegs->LCR, 7, 7, 1);
CSL_FINS (uartRegs->DLL, UART_DLL_DLL, divisor);
CSL_FINS (uartRegs->DLH, UART_DLH_DLH, divisor >> 8);
/* Restore the LCR state */
CSL_FINSR(uartRegs->LCR, 7, 7, 0);
}
/** ============================================================================
* @n@b CSL_uartConfigLine
*
* @b Description
* @n Controls the format of the asynchronous data communication
* exchange of Universal asynchronous receive transmitter
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
configLine configur line parameter of type CSL_UartLineConfig
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Controls the format of the asynchronous data communication
* exchange of Universal asynchronous receive transmitter
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
CSL_UartBaudConfig configBaud;
...
CSL_uartConfigLine (hUart, configBaud);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartConfigLine (
CSL_UartHandle hUart,
CSL_UartLineConfig configLine
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->LCR, UART_LCR_WLS, configLine.charLen);
CSL_FINS (uartRegs->LCR, UART_LCR_STB, configLine.numStopBits);
CSL_FINSR (uartRegs->LCR, 5, 3, configLine.parityCtrl);
}
/** ============================================================================
* @n@b CSL_uartAutoflowDisable
*
* @b Description
* @n Configures autoflow parameters exchange of Universal asynchronous receive
* transmitter
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Configures autoflow parameters exchange of Universal asynchronous receive
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartAutoflowDisable (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartAutoflowDisable (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->MCR, UART_MCR_AFE, CSL_UART_MCR_AFE_DISABLE);
CSL_FINS (uartRegs->MCR, UART_MCR_RTS, CSL_UART_MCR_RTS_DISABLE);
}
/** ============================================================================
* @n@b CSL_uartAutoCtsRts
*
* @b Description
* @n auto Cts and rts enabled of Universal asynchronous receive transmitter
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n auto cts and rts enabled of Universal asynchronous receive transmitter
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartAutoCtsRts (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartAutoCtsRts (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->MCR, UART_MCR_AFE, CSL_UART_MCR_AFE_ENABLE);
CSL_FINS (uartRegs->MCR, UART_MCR_RTS, CSL_UART_MCR_RTS_ENABLE);
}
/** ============================================================================
* @n@b CSL_uartAutoCts
*
* @b Description
* @n auto cts only enabled of Universal asynchronous receive transmitter
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n auto cts only enabled of Universal asynchronous receive transmitter
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartAutoCts (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartAutoCts (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->MCR, UART_MCR_AFE, CSL_UART_MCR_AFE_ENABLE);
}
/** ============================================================================
* @n@b CSL_uartLoopbackEnable
*
* @b Description
* @n Enables loopback mode of Universal asynchronous receive transmitter
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Enables loopback mode of Universal asynchronous receive transmitter
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartLoopbackEnable (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartLoopbackEnable (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->MCR, UART_MCR_LOOP, CSL_UART_MCR_LOOP_ENABLE);
}
/** ============================================================================
* @n@b CSL_uartLoopbackDisable
*
* @b Description
* @n Disables loopback mode of Universal asynchronous receive transmitter
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Disables loopback mode of Universal asynchronous receive transmitter
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartLoopbackEnable (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartLoopbackDisable (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->MCR, UART_MCR_LOOP, CSL_UART_MCR_LOOP_DISABLE);
}
/** ============================================================================
* @n@b CSL_uartStop
*
* @b Description
* @n the UART stop immediately if a transmission isn't in progress. If a
* transmission is in progress, the UART stops after completion of one word
* transmission
* @verbatim
hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n the UART stop immediately if a transmission isn't in progress. If a
* transmission is in progress, the UART stops after completion of one word
* transmission
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartStop (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartStop (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->PWREMU_MGMT, UART_PWREMU_MGMT_FREE, CSL_UART_EMU_STOP);
}
/** ============================================================================
* @n@b CSL_uartRunFree
*
* @b Description
* @n UART runs free
*
* @verbatim
* hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n UART runs free
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartRunFree (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartRunFree (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->PWREMU_MGMT, UART_PWREMU_MGMT_FREE, CSL_UART_EMU_RUN);
}
/** ============================================================================
* @n@b CSL_uartEnable
*
* @b Description
* @n Re-enables transmitter and receiver
* @verbatim
* hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Re-enables transmitter and receiver
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartEnable (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartEnable (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->PWREMU_MGMT, UART_PWREMU_MGMT_URST, CSL_UART_ENABLE);
}
/** ============================================================================
* @n@b CSL_uartReset
*
* @b Description
* @n Resets UART module
* @verbatim
* hUart Handle to the Universal asynchronous receiver
transmitter instance
* @endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Resets UART module
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_UartHandle hUart;
...
CSL_uartReset (hUart);
...
@endverbatim
* =============================================================================
*/
CSL_IDEF_INLINE
void CSL_uartReset (
CSL_UartHandle hUart
)
{
CSL_UartRegsOvly uartRegs = hUart->regs;
CSL_FINS (uartRegs->PWREMU_MGMT, UART_PWREMU_MGMT_URST, CSL_UART_RESET);
}
#ifdef __cplusplus
}
#endif
#endif /* _CSL_UARTAUX_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -