Skip to content

Commit 252b115

Browse files
baoleiyuaneasonxiang
authored andcommitted
driver: uart: add hardware flow control
this patch add hardware flow control Signed-off-by: baoleiyuan <baolei.yuan@unisoc.com>
1 parent c35835e commit 252b115

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/include/hal_uart.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ static inline void uwp_uart_set_byte_len(volatile struct uwp_uart *uart,
169169

170170
static inline void uwp_uart_init(volatile struct uwp_uart *uart)
171171
{
172-
// uart->cdk0.cdk0 = 0xe1;
173-
174172
uart->ien = 0;
175173
uart->ctrl1.bit.rx_tout_thld = 1;
176174
uart->ctrl2.bit.rxf_full_thld = 1;
177175
uart->ctrl2.bit.txf_empty_thld = 64;
176+
/*for hardware flow control*/
177+
uart->ctrl1.bit.rcv_hw_flow_en = 1;
178+
uart->ctrl1.bit.rcv_hw_flow_thld = 50;
179+
uart->ctrl1.bit.tx_hw_flow_en = 1;
178180
}
179181

180182
static inline void uwp_uart_int_enable(volatile struct uwp_uart *uart,

0 commit comments

Comments
 (0)