- }
- return;
- }
-
-
- void configUart(msp430_uart_config_t* config) {
- msp430_uctl_t uctl = call Usart.getUctl();
- msp430_utctl_t utctl = call Usart.getUtctl();
- msp430_urctl_t urctl = call Usart.getUrctl();
-
- uctl.pena = config->pena;
- uctl.pev = config->pev;
- uctl.spb = config->spb;
- uctl.clen = config->clen;
- uctl.listen = config->listen;
- uctl.sync = 0;
- uctl.mm = config->mm;
-
- utctl.ckpl = config->ckpl;
- utctl.ssel = config->ssel;
- utctl.urxse = config->urxse;
-
- urctl.urxeie = config->urxeie;
- urctl.urxwie = config->urxwie;
-
- call Usart.setUctl(uctl);
- call Usart.setUtctl(utctl);
- call Usart.setUrctl(urctl);
- call Usart.setUbr(config->ubr);
- call Usart.setUmctl(config->umctl);
- }
-
- async command void Usart.setModeUartTx(msp430_uart_config_t* config) {
-
- atomic {
- call UTXD.selectModuleFunc();
- call URXD.selectIOFunc();
- call Usart.resetUsart(TRUE);
- configUart(config);
- call Usart.enableUartTx();
- call Usart.resetUsart(FALSE);
- call Usart.clrIntr();
- call Usart.disableIntr();
- }
-