1: int32_t AG903_UARTMgrSetParam(
AG903_UARTMgrHandle*handle,
AG903_UARTMgrParam* param)
2: {
3: int32_t retval =
AG903_ENONE;
4: int32_t result;
5: uint8_t ch;
6:
7: result = UARTMgr_CheckHandle(handle, &ch);
8:
if(
AG903_ENONE != result) {
9:
return -
AG903_EINVAL;
10: }
11:
if(NULL == param) {
12:
return -
AG903_EINVAL;
13: }
14:
if( (AG903_UART_STAT_IDLE != UartChStat[ch].snd.stat) ||
15: (AG903_UART_STAT_IDLE != UartChStat[ch].rcv.stat) ) {
16:
return -
AG903_EBUSY;
17: }
18:
19: retval = UARTMgr_SetParam(ch, param);
20:
21:
return retval;
22: }