LOGUART Share PAD
Introduction
在当前的设计下,loguart tx pad可以通过切换function id作为LOGUART tx或uart trx来使用,loguart rx pad可以用作LOGUART rx或uart trx。同理,Hci trx pad可以通过设func_id作为bt hci uart的trx使用。
另外loguart trx pad有作为BT HCI UART的trx的需求.
Functional Description
默认情况下loguart trx pad作为loguart的tx和rx使用,作用是输出log和响应command,同时loguart trx pad也可以作为uart和bt hci的trx pin。因为loguart仅有这1套pinmux,所以loguart trx pad切换成其他功能后,loguart不会有log输出,也无法通过loguart响应command。
Block Diagram
The loguart and bt hci pad control is illustrated below.
Pin Switch
将loguart trx pad切给uart trx使用
用户可以通过修改loguart trx pad的func id来切换成uart 的trx,即修改上图中pinmux模块。默认loguart trx pad的func_id是0,软件在系统启动后会将loguart trx pad的func_id设置成1,且默认 BTWL_USE_LOGUART_PAD_EN = 0 ,此时引脚对作为loguart的trx。用户只需配置func_id为19/20/23/24/25/26就可以把loguart trx pad切换给uart使用,切换后引脚对的功能和 BTWL_USE_LOGUART_PAD_EN 值无关。此时loguart模块的tx无法输出,rx端维持高电平,不会有数据输入给loguart。
将bt hci trx pad切给bt hci trx使用
用户可以通过修改bt hci trx pad的func_id 和 r_BT_USE_EXT_UART 来实现,具体做法是把bt hci trx pad func_id置为14且 r_BT_USE_EXT_UART 设置为1。
r_BT_USE_EXT_UART :用来控制bt hci uart的引脚接到uart3还是引出到bt hci trx pad。
r_BT_USE_EXT_UART |
BT HCI UART模块的引脚接口 |
|---|---|
0 |
接给uart3 |
1 |
接给bt hci trx pad |
此时若 BTWL_USE_LOGUART_PAD_EN 设置成1且loguart tx pad的func_id设置成1,BT HCI的log也可经由loguart tx pin同时输出。
将loguart trx pad切给bt hci trx使用
用户可以通过修改loguart trx pad的func_id, BTWL_USE_LOGUART_PAD_EN 来实现。具体做法是将loguart trx pad的func_id置为1,把 BTWL_USE_LOGUART_PAD_EN 设置成1。
BTWL_USE_LOGUART_PAD_EN signal is illustrated below.
BTWL_USE_LOGUART_PAD_EN : 总的控制信号,由 WL_USE_REQ bit, BT_USE_REQ bit 和 FORCE_LOGUART_USE_LOGUART_PAD_B bit共同控制。 BT_USE_REQ bit位于BT端,由BT读写, WL_USE_REQ bit 位于 wifi端,由wifi读写, FORCE_LOGUART_USE_LOGUART_PAD_B bit位于wifi soc端,可由wifi soc读写。一般情况下,BT和wifi端仅需要改变自己端的控制bit即可修改 BTWL_USE_LOGUART_PAD_EN 切换引脚对功能.
默认情况下
WL_USE_REQ = BT_USE_REQ = 0,FORCE_LOGUART_USE_LOGUART_PAD_B = 0此时BTWL_USE_LOGUART_PAD_EN = 0.当wifi端完成操作,想要切换pin到bt hci供bt使用时,只要把 WL_USE_REQ 和 FORCE_LOGUART_USE_LOGUART_PAD_B 都写成1,此时
BTWL_USE_LOGUART_PAD_EN = 1, 切换成bt hci trx pin,此时loguart的tx无法输出,rx端保持与bt hci rx pin data一致。当bt端完成操作,想要切换pin到loguart供wifi使用时,只要把 BT_USE_REQl 写成1,此时
BTWL_USE_LOGUART_PAD_EN = 0, 切换成loguart trx pin当wifi端完成操作,想要切换pin到bt hci供bt使用时,只要把 WL_USE_REQ 写成0,此时
BTWL_USE_LOGUART_PAD_EN = 1, 切换成bt hci trx pin,此时loguart rx端保持与bt hci rx pin data一致。当bt端完成操作,想要切换pin到loguart供wifi使用时,只要把 BT_USE_REQl 写成0,此时
BTWL_USE_LOGUART_PAD_EN = 0, 切换成loguart trx pin……
即当 FORCE_LOGUART_USE_LOGUART_PAD_B 保持1的情况下,wifi soc和bt端想要把pad切给对方的话仅需修改自己这端的 sw bit,即wifi soc修改 WL_USE_REQ , bt修改 BT_USE_REQ.
此外,wifi soc端可以强行切换引脚对给loguart,只需要将 FORCE_LOGUART_USE_LOGUART_PAD_B bit写0,此时 BTWL_USE_LOGUART_PAD_EN = 0。
为了便于wifi soc端获知 WL_USE_REQl 和 BT_USE_REQ 异或的结果,wifi soc可以读取 SW_ctrl bit,这是只读的比特位。
LOGUART TRX PAD control is illustrated below.
WL_USE_REQ |
BT_USE_REQ |
FORCE_LOGUART_USE_LOGUART_PAD_B |
BTWL_USE_LOGUART_PAD_EN |
LOGUART TRX PAD |
|---|---|---|---|---|
0 |
0 |
0 |
0 (Default) |
Loguart trx |
1 |
0 |
1 |
1 |
Bt hci trx + loguart rx |
1 |
1 |
1 |
0 |
Loguart trx |
0 |
1 |
1 |
1 |
Bt hci trx + loguart rx |
0 |
0 |
1 |
0 |
Loguart trx |
* |
* |
0 |
0 |
Loguart trx |
* means whatever
Design Flow Notes
The bit definitions at the Wifi soc side are shown in the following table.
Access |
Default value |
Description |
|
|---|---|---|---|
R/W |
0 |
WL_USE_REQ |
who uses loguart trx pad depends on the xor of WL_USE_REQ and BT_USE_REQ, wifi can send use request by change the value of WL_USE_REQ |
R |
0 |
BTWL_USE_LOGUART_PAD_ST |
The state of xor of WL_USE_REQ and BT_USE_REQ. 0: loguart use loguart trx pad 1: bt hci use loguart trx pad |
R/W |
0 |
FORCE_LOGUART_USE_LOGUART_PAD_B |
For wifi soc to use loguart pad mandatory if necessary 0: loguart use loguart trx pad 1: who uses loguart trx pad depends on BTWL_USE_LOGUART_PAD_ST |
The bit definition at the BT side is shown in the following table.
Access |
Default value |
Description |
|
|---|---|---|---|
R/W |
0 |
BT_USE_REQ |
who uses loguart trx pad depends on the xor of WL_USE_REQ and BT_USE_REQ |