I'd like to disable UART Tx when CC2530 is going to 'PWRMGR_CONSERVE' state.
How can I disable UART Tx?
Detail:
- I use CC2530ZDK.
- I use osal_pwrmgr_task_state(My_App_TaskID, PWRMGR_CONSERVE);
see http://e2e.ti.com/support/low_power_rf/f/158/t/153290.aspx#555159
- Before going to conserve state, I use 'HalUARTSuspend();'
- Even when ED is the conserve state, UART Tx (P0_3 pin) is high(=3.3V out).
And in my system, it causes the electric leak.
- I found the function 'HalUARTClose()' in HAL Drivers API (SWRA193).
But it isn't implemented. (Z-stack 2.5.0, IAR workbench 8.10.3)
- I study 'CC253x User's Guide' (SWRU191B) and 'Using UART in CC253xFx' (DN112).
And I found the correspond registers; P0SEL, P0DIR, P0, P0INP.
- I added the code to change the registers when state change. But it did't work.
UART Tx remained to be High. It was opposite of my intention.
Here is the code:
// Go into the conserve state:
HalUARTSuspend();
P0SEL &= ~0x0c;
P0DIR &= ~0x08;
P0 &= ~0x0c;
P0INP |= 0x0c;
osal_pwrmgr_task_state(TaskID, PWRMGR_CONSERVE);
break;
// When back to HOLD state:
osal_pwrmgr_task_state(RemoteCamClient_TaskID, PWRMGR_HOLD);
P0SEL |= 0x0c;
P0DIR |= 0x08;
P0INP &= ~0x0c;
HalUARTResume();
break;
Question
1. How can I disable UART Tx ?
2. If I can, I'd like to disable UART Rx, too. How ?
3. If my scenario above is not well, I'd like to use 'HalUARTClose()' function.
Please teach me the implement of the function.
Regards.