[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/msp430/usart
HplMsp430I2C0P.nc, 1.1.2.4, 1.1.2.5 HplMsp430I2C.nc, 1.1.2.1,
1.1.2.2 HplMsp430Usart0P.nc, 1.1.2.13,
1.1.2.14 HplMsp430Usart1P.nc, 1.1.2.8,
1.1.2.9 HplMsp430Usart.nc, 1.1.2.7,
1.1.2.8 Msp430I2CConfigure.nc, 1.1.2.2, 1.1.2.3 Msp430I2CP.nc,
1.1.2.8, 1.1.2.9 Msp430SpiConfigure.nc, 1.1.4.3,
1.1.4.4 Msp430SpiDmaP.nc, 1.1.2.8, 1.1.2.9 Msp430SpiNoDmaP.nc,
1.1.2.9, 1.1.2.10 Msp430Uart0P.nc, 1.1.4.5,
1.1.4.6 Msp430Uart1C.nc, 1.1.2.11, 1.1.2.12 Msp430Uart1P.nc,
1.1.4.5, 1.1.4.6 Msp430UartConfigure.nc, 1.1.4.3,
1.1.4.4 Msp430UartP.nc, 1.1.2.13, 1.1.2.14 msp430usart.h,
1.1.2.4, 1.1.2.5 Msp430UartControl.nc, 1.1.4.2, NONE
Philipp Huppertz
phihup at users.sourceforge.net
Thu Nov 30 05:27:55 PST 2006
- Previous message: [Tinyos-2-commits]
CVS: tinyos-2.x/tos/platforms/eyesIFX/chips/tda5250
HplTda5250DataIOC.nc, 1.1.2.4, 1.1.2.5 HplTda5250DataIOP.nc,
1.1.2.4, 1.1.2.5 tda5250BusResourceSettings.h, 1.1.4.4, 1.1.4.5
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/platforms/eyesIFX
eyesIFXSerialP.nc, 1.1.2.3, 1.1.2.4 RadioDataLinkC.nc,
1.1.2.10, 1.1.2.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1527/tos/chips/msp430/usart
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
HplMsp430I2C0P.nc HplMsp430I2C.nc HplMsp430Usart0P.nc
HplMsp430Usart1P.nc HplMsp430Usart.nc Msp430I2CConfigure.nc
Msp430I2CP.nc Msp430SpiConfigure.nc Msp430SpiDmaP.nc
Msp430SpiNoDmaP.nc Msp430Uart0P.nc Msp430Uart1C.nc
Msp430Uart1P.nc Msp430UartConfigure.nc Msp430UartP.nc
msp430usart.h
Removed Files:
Tag: tinyos-2_0_devel-BRANCH
Msp430UartControl.nc
Log Message:
- changed usart to use union configurations
- implementation of Usart0 and Usart1 is consistent again (don't configure in different ways)
- changed the way configure is done (don't rely on unconfiguring)
- do all configuring stuff in SWRST !
- fixed Spi.write(): rx interrupt is cleared now
- Spi.write() now relies on configure to disable rx interrupt
- fixed semantics of Usart.isTxIntrPending (dos not clear interrupt), now it behaves like Usart.isRxIntrPending
- removed UartControl: is no longer needed can be rx/tx can be set via config
Index: HplMsp430I2C0P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430I2C0P.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** HplMsp430I2C0P.nc 7 Nov 2006 23:15:04 -0000 1.1.2.4
--- HplMsp430I2C0P.nc 30 Nov 2006 13:27:52 -0000 1.1.2.5
***************
*** 64,69 ****
}
! async command void HplI2C.setModeI2C( msp430_i2c_config_t* config ) {
call HplUsart.disableUart();
call HplUsart.disableSpi();
--- 64,70 ----
}
! async command void HplI2C.setModeI2C( msp430_i2c_union_config_t* config ) {
+ call HplUsart.resetUsart(TRUE);
call HplUsart.disableUart();
call HplUsart.disableSpi();
***************
*** 80,95 ****
U0CTL &= ~I2CEN;
! U0CTL |= ( ( config->rxdmaen << 7 ) |
! ( config->txdmaen << 6 ) |
! ( config->xa << 4 ) |
! ( config->listen << 3 ) );
! I2CTCTL = 0;
! I2CTCTL = ( ( config->i2cword << 7 ) |
! ( config->i2crm << 6 ) |
! ( config->i2cssel << 4 ) );
! I2CPSC = config->i2cpsc;
! I2CSCLH = config->i2csclh;
! I2CSCLL = config->i2cscll;
! I2COA = config->i2coa;
U0CTL |= I2CEN;
--- 81,91 ----
U0CTL &= ~I2CEN;
! U0CTL = (config->i2cRegisters.uctl | (I2C | SYNC)) & ~I2CEN;
! I2CTCTL = config->i2cRegisters.i2ctctl;
!
! I2CPSC = config->i2cRegisters.i2cpsc;
! I2CSCLH = config->i2cRegisters.i2csclh;
! I2CSCLL = config->i2cRegisters.i2cscll;
! I2COA = config->i2cRegisters.i2coa;
U0CTL |= I2CEN;
Index: HplMsp430I2C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430I2C.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** HplMsp430I2C.nc 30 Aug 2006 17:15:55 -0000 1.1.2.1
--- HplMsp430I2C.nc 30 Nov 2006 13:27:52 -0000 1.1.2.2
***************
*** 6,10 ****
async command bool isI2C();
async command void clearModeI2C();
! async command void setModeI2C( msp430_i2c_config_t* config );
// U0CTL
--- 6,10 ----
async command bool isI2C();
async command void clearModeI2C();
! async command void setModeI2C( msp430_i2c_union_config_t* config );
// U0CTL
Index: HplMsp430Usart0P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart0P.nc,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -C2 -d -r1.1.2.13 -r1.1.2.14
*** HplMsp430Usart0P.nc 7 Nov 2006 23:15:04 -0000 1.1.2.13
--- HplMsp430Usart0P.nc 30 Nov 2006 13:27:52 -0000 1.1.2.14
***************
*** 68,71 ****
--- 68,72 ----
* @author: Vlado Handziski <handzisk at tkn.tu-berlin.de>
* @author: Joe Polastre
+ * @author: Philipp Huppertz <huppertz at tkn.tu-berlin.de>
* @version $Revision$ $Date$
*/
***************
*** 207,211 ****
atomic {
ME1 &= ~(UTXE0 | URXE0); // USART0 UART module enable
- call Usart.resetUsart(TRUE);
call UTXD.selectIOFunc();
call URXD.selectIOFunc();
--- 208,211 ----
***************
*** 248,252 ****
atomic {
ME1 &= ~USPIE0; // USART0 SPI module disable
- call Usart.resetUsart(TRUE);
call SIMO.selectIOFunc();
call SOMI.selectIOFunc();
--- 248,251 ----
***************
*** 254,281 ****
}
}
! void configSpi(msp430_spi_config_t* config) {
! msp430_uctl_t uctl = call Usart.getUctl();
! msp430_utctl_t utctl = call Usart.getUtctl();
!
! uctl.clen = config->clen;
! uctl.listen = config->listen;
! uctl.mm = config->mm;
! uctl.sync = 1;
!
! utctl.ckph = config->ckph;
! utctl.ckpl = config->ckpl;
! utctl.ssel = config->ssel;
! utctl.stc = config->stc;
!
! call Usart.setUctl(uctl);
! call Usart.setUtctl(utctl);
! call Usart.setUbr(config->ubr);
call Usart.setUmctl(0x00);
}
!
! async command void Usart.setModeSpi(msp430_spi_config_t* config) {
atomic {
configSpi(config);
call Usart.enableSpi();
--- 253,272 ----
}
}
+
+ void configSpi(msp430_spi_union_config_t* config) {
+ // U0CTL = (config->spiRegisters.uctl & ~I2C) | SYNC | SWRST;
+ U0CTL = (config->spiRegisters.uctl) | SYNC | SWRST;
+ U0TCTL = config->spiRegisters.utctl;
! call Usart.setUbr(config->spiRegisters.ubr);
call Usart.setUmctl(0x00);
}
! async command void Usart.setModeSpi(msp430_spi_union_config_t* config) {
!
atomic {
+ call Usart.resetUsart(TRUE);
+ call HplI2C.clearModeI2C();
+ call Usart.disableUart();
configSpi(config);
call Usart.enableSpi();
***************
*** 283,358 ****
call Usart.clrIntr();
call Usart.disableIntr();
! }
! 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();
! }
!
return;
}
! async command void Usart.setModeUartRx(msp430_uart_config_t* config) {
! atomic {
! call UTXD.selectIOFunc();
! call URXD.selectModuleFunc();
! call Usart.resetUsart(TRUE);
! configUart(config);
! call Usart.enableUartRx();
! call Usart.resetUsart(FALSE);
! call Usart.clrIntr();
! call Usart.disableIntr();
! }
! return;
}
! async command void Usart.setModeUart(msp430_uart_config_t* config) {
! atomic {
! call UTXD.selectModuleFunc();
! call URXD.selectModuleFunc();
call Usart.resetUsart(TRUE);
configUart(config);
! call Usart.enableUart();
call Usart.resetUsart(FALSE);
call Usart.clrIntr();
--- 274,309 ----
call Usart.clrIntr();
call Usart.disableIntr();
! }
return;
}
! void configUart(msp430_uart_union_config_t* config) {
! U0CTL = (config->uartRegisters.uctl & ~SYNC) | SWRST;
! U0TCTL = config->uartRegisters.utctl;
! U0RCTL = config->uartRegisters.urctl;
! call Usart.setUbr(config->uartRegisters.ubr);
! call Usart.setUmctl(config->uartRegisters.umctl);
}
! async command void Usart.setModeUart(msp430_uart_union_config_t* config) {
! atomic {
call Usart.resetUsart(TRUE);
+ call HplI2C.clearModeI2C();
+ call Usart.disableSpi();
configUart(config);
! if ((config->uartConfig.utxe == 1) && (config->uartConfig.urxe == 1)) {
! call Usart.enableUart();
! } else if ((config->uartConfig.utxe == 0) && (config->uartConfig.urxe == 1)) {
! call Usart.disableUartTx();
! call Usart.enableUartRx();
! } else if ((config->uartConfig.utxe == 1) && (config->uartConfig.urxe == 0)){
! call Usart.disableUartRx();
! call Usart.enableUartTx();
! } else {
! call Usart.disableUart();
! }
call Usart.resetUsart(FALSE);
call Usart.clrIntr();
***************
*** 365,369 ****
async command bool Usart.isTxIntrPending(){
if (IFG1 & UTXIFG0){
- IFG1 &= ~UTXIFG0;
return TRUE;
}
--- 316,319 ----
***************
*** 442,445 ****
--- 392,396 ----
default async event void I2CInterrupts.fired() {}
default async command bool HplI2C.isI2C() { return FALSE; }
+ default async command void HplI2C.clearModeI2C() {};
}
Index: HplMsp430Usart1P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart1P.nc,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** HplMsp430Usart1P.nc 7 Nov 2006 23:15:04 -0000 1.1.2.8
--- HplMsp430Usart1P.nc 30 Nov 2006 13:27:52 -0000 1.1.2.9
***************
*** 159,163 ****
async command void Usart.resetUsart(bool reset) {
if (reset)
! SET_FLAG(U1CTL, SWRST);
else
CLR_FLAG(U1CTL, SWRST);
--- 159,163 ----
async command void Usart.resetUsart(bool reset) {
if (reset)
! U1CTL = SWRST;
else
CLR_FLAG(U1CTL, SWRST);
***************
*** 210,215 ****
async command void Usart.disableUart() {
- ME2 &= ~(UTXE1 | URXE1); // USART1 UART module enable
atomic {
call UTXD.selectIOFunc();
call URXD.selectIOFunc();
--- 210,215 ----
async command void Usart.disableUart() {
atomic {
+ ME2 &= ~(UTXE1 | URXE1); // USART1 UART module enable
call UTXD.selectIOFunc();
call URXD.selectIOFunc();
***************
*** 250,255 ****
async command void Usart.disableSpi() {
- ME2 &= ~USPIE1; // USART1 SPI module disable
atomic {
call SIMO.selectIOFunc();
call SOMI.selectIOFunc();
--- 250,255 ----
async command void Usart.disableSpi() {
atomic {
+ ME2 &= ~USPIE1; // USART1 SPI module disable
call SIMO.selectIOFunc();
call SOMI.selectIOFunc();
***************
*** 258,286 ****
}
! void configSpi(msp430_spi_config_t* config) {
! msp430_uctl_t uctl = call Usart.getUctl();
! msp430_utctl_t utctl = call Usart.getUtctl();
!
! uctl.clen = config->clen;
! uctl.listen = config->listen;
! uctl.mm = config->mm;
! uctl.sync = 1;
!
! utctl.ckph = config->ckph;
! utctl.ckpl = config->ckpl;
! utctl.ssel = config->ssel;
! utctl.stc = config->stc;
! call Usart.setUctl(uctl);
! call Usart.setUtctl(utctl);
! call Usart.setUbr(config->ubr);
call Usart.setUmctl(0x00);
}
! async command void Usart.setModeSpi(msp430_spi_config_t* config) {
! call Usart.disableUart();
atomic {
call Usart.resetUsart(TRUE);
configSpi(config);
call Usart.enableSpi();
--- 258,274 ----
}
! void configSpi(msp430_spi_union_config_t* config) {
! U1CTL = (config->spiRegisters.uctl) | SYNC | SWRST;
! U1TCTL = config->spiRegisters.utctl;
! call Usart.setUbr(config->spiRegisters.ubr);
call Usart.setUmctl(0x00);
}
! async command void Usart.setModeSpi(msp430_spi_union_config_t* config) {
atomic {
call Usart.resetUsart(TRUE);
+ call Usart.disableUart();
configSpi(config);
call Usart.enableSpi();
***************
*** 288,374 ****
call Usart.clrIntr();
call Usart.disableIntr();
! }
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) {
!
! call Usart.disableSpi();
! call Usart.disableUart();
!
! 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();
! }
! return;
! }
!
! async command void Usart.setModeUartRx(msp430_uart_config_t* config) {
! call Usart.disableSpi();
! call Usart.disableUart();
! atomic {
! call UTXD.selectIOFunc();
! call URXD.selectModuleFunc();
! call Usart.resetUsart(TRUE);
! configUart(config);
! call Usart.enableUartRx();
! call Usart.resetUsart(FALSE);
! call Usart.clrIntr();
! call Usart.disableIntr();
! }
! return;
}
! async command void Usart.setModeUart(msp430_uart_config_t* config) {
!
! call Usart.disableSpi();
! call Usart.disableUart();
! atomic {
! call UTXD.selectModuleFunc();
! call URXD.selectModuleFunc();
call Usart.resetUsart(TRUE);
configUart(config);
! call Usart.enableUart();
call Usart.resetUsart(FALSE);
call Usart.clrIntr();
call Usart.disableIntr();
}
return;
}
--- 276,316 ----
call Usart.clrIntr();
call Usart.disableIntr();
! }
return;
}
! void configUart(msp430_uart_union_config_t* config) {
! U1CTL = (config->uartRegisters.uctl & ~SYNC) | SWRST;
! U1TCTL = config->uartRegisters.utctl;
! U1RCTL = config->uartRegisters.urctl;
! call Usart.setUbr(config->uartRegisters.ubr);
! call Usart.setUmctl(config->uartRegisters.umctl);
}
! async command void Usart.setModeUart(msp430_uart_union_config_t* config) {
! atomic {
call Usart.resetUsart(TRUE);
+ call Usart.disableSpi();
configUart(config);
! if ((config->uartConfig.utxe == 1) && (config->uartConfig.urxe == 1)) {
! call Usart.enableUart();
! } else if ((config->uartConfig.utxe == 0) && (config->uartConfig.urxe == 1)) {
! call Usart.disableUartTx();
! call Usart.enableUartRx();
! } else if ((config->uartConfig.utxe == 1) && (config->uartConfig.urxe == 0)){
! call Usart.disableUartRx();
! call Usart.enableUartTx();
! } else {
! call Usart.disableUart();
! }
call Usart.resetUsart(FALSE);
call Usart.clrIntr();
call Usart.disableIntr();
}
+
return;
}
***************
*** 376,380 ****
async command bool Usart.isTxIntrPending(){
if (IFG2 & UTXIFG1){
- IFG2 &= ~UTXIFG1;
return TRUE;
}
--- 318,321 ----
Index: HplMsp430Usart.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart.nc,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** HplMsp430Usart.nc 7 Nov 2006 23:15:04 -0000 1.1.2.7
--- HplMsp430Usart.nc 30 Nov 2006 13:27:52 -0000 1.1.2.8
***************
*** 166,182 ****
* Switches USART to Spi mode.
*/
! async command void setModeSpi(msp430_spi_config_t* config);
!
! /**
! * Switches USART to Uart TX mode (RX pins disabled).
! * Interrupts disabled by default.
! */
! async command void setModeUartTx(msp430_uart_config_t* config);
!
! /**
! * Switches USART to Uart RX mode (TX pins disabled)..
! * Interrupts disabled by default.
! */
! async command void setModeUartRx(msp430_uart_config_t* config);
/**
--- 166,170 ----
* Switches USART to Spi mode.
*/
! async command void setModeSpi(msp430_spi_union_config_t* config);
/**
***************
*** 184,188 ****
* Interrupts disabled by default.
*/
! async command void setModeUart(msp430_uart_config_t* config);
/* Dis/enabling of UTXIFG / URXIFG */
--- 172,176 ----
* Interrupts disabled by default.
*/
! async command void setModeUart(msp430_uart_union_config_t* config);
/* Dis/enabling of UTXIFG / URXIFG */
Index: Msp430I2CConfigure.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430I2CConfigure.nc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** Msp430I2CConfigure.nc 7 Nov 2006 23:15:04 -0000 1.1.2.2
--- Msp430I2CConfigure.nc 30 Nov 2006 13:27:52 -0000 1.1.2.3
***************
*** 37,40 ****
interface Msp430I2CConfigure {
! async command msp430_i2c_config_t* getConfig();
}
--- 37,40 ----
interface Msp430I2CConfigure {
! async command msp430_i2c_union_config_t* getConfig();
}
Index: Msp430I2CP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430I2CP.nc,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** Msp430I2CP.nc 7 Nov 2006 23:15:04 -0000 1.1.2.8
--- Msp430I2CP.nc 30 Nov 2006 13:27:52 -0000 1.1.2.9
***************
*** 100,104 ****
default async command error_t UsartResource.release[ uint8_t id ]() {return FAIL;}
default event void Resource.granted[ uint8_t id ]() {}
! default async command msp430_i2c_config_t* Msp430I2CConfigure.getConfig[uint8_t id]() {
return &msp430_i2c_default_config;
}
--- 100,104 ----
default async command error_t UsartResource.release[ uint8_t id ]() {return FAIL;}
default event void Resource.granted[ uint8_t id ]() {}
! default async command msp430_i2c_union_config_t* Msp430I2CConfigure.getConfig[uint8_t id]() {
return &msp430_i2c_default_config;
}
Index: Msp430SpiConfigure.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430SpiConfigure.nc,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -C2 -d -r1.1.4.3 -r1.1.4.4
*** Msp430SpiConfigure.nc 7 Nov 2006 23:15:08 -0000 1.1.4.3
--- Msp430SpiConfigure.nc 30 Nov 2006 13:27:52 -0000 1.1.4.4
***************
*** 37,40 ****
interface Msp430SpiConfigure {
! async command msp430_spi_config_t* getConfig();
}
--- 37,40 ----
interface Msp430SpiConfigure {
! async command msp430_spi_union_config_t* getConfig();
}
Index: Msp430SpiDmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430SpiDmaP.nc,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** Msp430SpiDmaP.nc 7 Nov 2006 23:15:08 -0000 1.1.2.8
--- Msp430SpiDmaP.nc 30 Nov 2006 13:27:52 -0000 1.1.2.9
***************
*** 97,101 ****
default async command error_t UsartResource.immediateRequest[ uint8_t id ]() { return FAIL; }
default async command error_t UsartResource.release[ uint8_t id ]() { return FAIL; }
! default async command msp430_spi_config_t* Msp430SpiConfigure.getConfig[uint8_t id]() {
return &msp430_spi_default_config;
}
--- 97,101 ----
default async command error_t UsartResource.immediateRequest[ uint8_t id ]() { return FAIL; }
default async command error_t UsartResource.release[ uint8_t id ]() { return FAIL; }
! default async command msp430_spi_union_config_t* Msp430SpiConfigure.getConfig[uint8_t id]() {
return &msp430_spi_default_config;
}
***************
*** 107,110 ****
--- 107,111 ----
call Usart.tx( tx );
while( !call Usart.isRxIntrPending() );
+ call Usart.clrRxIntr();
return call Usart.rx();
Index: Msp430SpiNoDmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430SpiNoDmaP.nc,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -C2 -d -r1.1.2.9 -r1.1.2.10
*** Msp430SpiNoDmaP.nc 7 Nov 2006 23:15:08 -0000 1.1.2.9
--- Msp430SpiNoDmaP.nc 30 Nov 2006 13:27:52 -0000 1.1.2.10
***************
*** 87,91 ****
--- 87,93 ----
async command void ResourceConfigure.unconfigure[ uint8_t id ]() {
+ call Usart.resetUsart(TRUE);
call Usart.disableSpi();
+ call Usart.resetUsart(FALSE);
}
***************
*** 96,104 ****
async command uint8_t SpiByte.write( uint8_t tx ) {
uint8_t byte;
! call Usart.disableRxIntr();
call Usart.tx( tx );
while( !call Usart.isRxIntrPending() );
byte = call Usart.rx();
! call Usart.enableRxIntr();
return byte;
}
--- 98,108 ----
async command uint8_t SpiByte.write( uint8_t tx ) {
uint8_t byte;
! // we are in spi mode which is configured to have turned off interrupts
! //call Usart.disableRxIntr();
call Usart.tx( tx );
while( !call Usart.isRxIntrPending() );
+ call Usart.clrRxIntr();
byte = call Usart.rx();
! //call Usart.enableRxIntr();
return byte;
}
***************
*** 108,112 ****
default async command error_t UsartResource.immediateRequest[ uint8_t id ]() { return FAIL; }
default async command error_t UsartResource.release[ uint8_t id ]() { return FAIL; }
! default async command msp430_spi_config_t* Msp430SpiConfigure.getConfig[uint8_t id]() {
return &msp430_spi_default_config;
}
--- 112,116 ----
default async command error_t UsartResource.immediateRequest[ uint8_t id ]() { return FAIL; }
default async command error_t UsartResource.release[ uint8_t id ]() { return FAIL; }
! default async command msp430_spi_union_config_t* Msp430SpiConfigure.getConfig[uint8_t id]() {
return &msp430_spi_default_config;
}
***************
*** 128,133 ****
--- 132,139 ----
while ( ++m_pos < end ) {
while( !call Usart.isTxIntrPending() );
+ call Usart.clrTxIntr();
call Usart.tx( m_tx_buf ? m_tx_buf[ m_pos ] : 0 );
while( !call Usart.isRxIntrPending() );
+ call Usart.clrRxIntr();
tmp = call Usart.rx();
if ( m_rx_buf )
Index: Msp430Uart0P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430Uart0P.nc,v
retrieving revision 1.1.4.5
retrieving revision 1.1.4.6
diff -C2 -d -r1.1.4.5 -r1.1.4.6
*** Msp430Uart0P.nc 7 Nov 2006 23:15:08 -0000 1.1.4.5
--- Msp430Uart0P.nc 30 Nov 2006 13:27:52 -0000 1.1.4.6
***************
*** 40,44 ****
provides interface Resource[ uint8_t id ];
provides interface ResourceConfigure[uint8_t id ];
- provides interface Msp430UartControl as UartControl[ uint8_t id ];
provides interface UartStream;
provides interface UartByte;
--- 40,43 ----
***************
*** 56,60 ****
ResourceConfigure = UartP.ResourceConfigure;
Msp430UartConfigure = UartP.Msp430UartConfigure;
- UartControl = UartP.UartControl;
UartStream = UartP.UartStream;
UartByte = UartP.UartByte;
--- 55,58 ----
Index: Msp430Uart1C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430Uart1C.nc,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -C2 -d -r1.1.2.11 -r1.1.2.12
*** Msp430Uart1C.nc 7 Nov 2006 23:15:08 -0000 1.1.2.11
--- Msp430Uart1C.nc 30 Nov 2006 13:27:52 -0000 1.1.2.12
***************
*** 44,48 ****
provides interface UartStream;
provides interface UartByte;
- provides interface Msp430UartControl as UartControl;
uses interface Msp430UartConfigure;
--- 44,47 ----
***************
*** 59,63 ****
UartStream = UartP.UartStream;
UartByte = UartP.UartByte;
- UartControl = UartP.UartControl[ CLIENT_ID ];
Msp430UartConfigure = UartP.Msp430UartConfigure[ CLIENT_ID ];
--- 58,61 ----
Index: Msp430Uart1P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430Uart1P.nc,v
retrieving revision 1.1.4.5
retrieving revision 1.1.4.6
diff -C2 -d -r1.1.4.5 -r1.1.4.6
*** Msp430Uart1P.nc 7 Nov 2006 23:15:08 -0000 1.1.4.5
--- Msp430Uart1P.nc 30 Nov 2006 13:27:52 -0000 1.1.4.6
***************
*** 40,44 ****
provides interface Resource[ uint8_t id ];
provides interface ResourceConfigure[uint8_t id ];
- provides interface Msp430UartControl as UartControl[ uint8_t id ];
provides interface UartStream;
provides interface UartByte;
--- 40,43 ----
***************
*** 56,60 ****
ResourceConfigure = UartP.ResourceConfigure;
Msp430UartConfigure = UartP.Msp430UartConfigure;
- UartControl = UartP.UartControl;
UartStream = UartP.UartStream;
UartByte = UartP.UartByte;
--- 55,58 ----
Index: Msp430UartConfigure.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430UartConfigure.nc,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -C2 -d -r1.1.4.3 -r1.1.4.4
*** Msp430UartConfigure.nc 7 Nov 2006 23:15:08 -0000 1.1.4.3
--- Msp430UartConfigure.nc 30 Nov 2006 13:27:52 -0000 1.1.4.4
***************
*** 37,40 ****
interface Msp430UartConfigure {
! async command msp430_uart_config_t* getConfig();
}
--- 37,40 ----
interface Msp430UartConfigure {
! async command msp430_uart_union_config_t* getConfig();
}
Index: Msp430UartP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430UartP.nc,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -C2 -d -r1.1.2.13 -r1.1.2.14
*** Msp430UartP.nc 7 Nov 2006 23:15:08 -0000 1.1.2.13
--- Msp430UartP.nc 30 Nov 2006 13:27:52 -0000 1.1.2.14
***************
*** 42,46 ****
provides interface Resource[ uint8_t id ];
provides interface ResourceConfigure[ uint8_t id ];
! provides interface Msp430UartControl as UartControl[ uint8_t id ];
provides interface UartStream;
provides interface UartByte;
--- 42,46 ----
provides interface Resource[ uint8_t id ];
provides interface ResourceConfigure[ uint8_t id ];
! //provides interface Msp430UartControl as UartControl[ uint8_t id ];
provides interface UartStream;
provides interface UartByte;
***************
*** 81,90 ****
async command void ResourceConfigure.configure[ uint8_t id ]() {
! call UartControl.setModeDuplex[id]();
}
async command void ResourceConfigure.unconfigure[ uint8_t id ]() {
call Usart.disableIntr();
call Usart.disableUart();
}
--- 81,95 ----
async command void ResourceConfigure.configure[ uint8_t id ]() {
! msp430_uart_union_config_t* config = call Msp430UartConfigure.getConfig[id]();
! m_byte_time = config->uartConfig.ubr / 2;
! call Usart.setModeUart(config);
! call Usart.enableIntr();
}
async command void ResourceConfigure.unconfigure[ uint8_t id ]() {
+ call Usart.resetUsart(TRUE);
call Usart.disableIntr();
call Usart.disableUart();
+ call Usart.resetUsart(FALSE);
}
***************
*** 92,117 ****
signal Resource.granted[ id ]();
}
-
- async command void UartControl.setModeRx[ uint8_t id ]() {
- msp430_uart_config_t* config = call Msp430UartConfigure.getConfig[id]();
- m_byte_time = config->ubr / 2;
- call Usart.setModeUartRx(config);
- call Usart.clrIntr();
- call Usart.enableRxIntr();
- }
-
- async command void UartControl.setModeTx[ uint8_t id ]() {
- call Usart.setModeUartTx(call Msp430UartConfigure.getConfig[id]());
- call Usart.clrIntr();
- call Usart.enableTxIntr();
- }
-
- async command void UartControl.setModeDuplex[ uint8_t id ]() {
- msp430_uart_config_t* config = call Msp430UartConfigure.getConfig[id]();
- m_byte_time = config->ubr / 2;
- call Usart.setModeUart(config);
- call Usart.clrIntr();
- call Usart.enableIntr();
- }
async command error_t UartStream.enableReceiveInterrupt() {
--- 97,100 ----
***************
*** 178,181 ****
--- 161,165 ----
call Usart.tx( data );
while( !call Usart.isTxIntrPending() );
+ call Usart.clrTxIntr();
return SUCCESS;
}
***************
*** 189,193 ****
while( !call Usart.isRxIntrPending() ) {
if ( ( call Counter.get() - start ) >= timeout_micro )
! return FAIL;
}
*byte = call Usart.rx();
--- 173,177 ----
while( !call Usart.isRxIntrPending() ) {
if ( ( call Counter.get() - start ) >= timeout_micro )
! return FAIL;
}
*byte = call Usart.rx();
***************
*** 203,207 ****
default async command error_t UsartResource.immediateRequest[ uint8_t id ]() { return FAIL; }
default async command error_t UsartResource.release[ uint8_t id ]() { return FAIL; }
! default async command msp430_uart_config_t* Msp430UartConfigure.getConfig[uint8_t id]() {
return &msp430_uart_default_config;
}
--- 187,191 ----
default async command error_t UsartResource.immediateRequest[ uint8_t id ]() { return FAIL; }
default async command error_t UsartResource.release[ uint8_t id ]() { return FAIL; }
! default async command msp430_uart_union_config_t* Msp430UartConfigure.getConfig[uint8_t id]() {
return &msp430_uart_default_config;
}
Index: msp430usart.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/msp430usart.h,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** msp430usart.h 7 Nov 2006 23:15:08 -0000 1.1.2.4
--- msp430usart.h 30 Nov 2006 13:27:52 -0000 1.1.2.5
***************
*** 31,35 ****
/**
* @author Vlado Handziski <handzisk at tkn.tu-berlin.de>
! * $Revision$ $Date$
*/
--- 31,35 ----
/**
* @author Vlado Handziski <handzisk at tkn.tu-berlin.de>
! * @author Philipp Huppertz <huppertz at tkn.tu-berlin.de>
*/
***************
*** 98,139 ****
typedef struct {
! unsigned int ubr: 16; //Clock division factor (>=0x0002)
! unsigned int ssel: 2; //Clock source (00=external UCLK [slave]; 01=ACLK [master]; 10=SMCLK [master]; 11=SMCLK [master])
! unsigned int clen: 1; //Character length (0=7-bit data; 1=8-bit data)
! unsigned int listen: 1; //Listen enable (0=disabled; 1=enabled, feed tx back to receiver)
unsigned int mm: 1; //Master mode (0=slave; 1=master)
! unsigned int ckph: 1; //Clock phase (0=normal; 1=half-cycle delayed)
! unsigned int ckpl: 1; //Clock polarity (0=inactive is low && data at rising edge; 1=inverted)
unsigned int stc: 1; //Slave transmit (0=4-pin SPI && STE enabled; 1=3-pin SPI && STE disabled)
unsigned int :0;
} msp430_spi_config_t;
- msp430_spi_config_t msp430_spi_default_config = {ubr: 0x0002, ssel: 0x02, clen: 1, listen: 0, mm: 1, ckph: 1, ckpl: 0, stc:1};
-
typedef struct {
! unsigned int ubr:16; //Baud rate (use enum msp430_uart_rate_t for predefined rates)
! unsigned int umctl: 8; //Modulation (use enum msp430_uart_rate_t for predefined rates)
! unsigned int ssel: 2; //Clock source (00=UCLKI; 01=ACLK; 10=SMCLK; 11=SMCLK)
! unsigned int pena: 1; //Parity enable (0=disabled; 1=enabled)
! unsigned int pev: 1; //Parity select (0=odd; 1=even)
! unsigned int spb: 1; //Stop bits (0=one stop bit; 1=two stop bits)
! unsigned int clen: 1; //Character length (0=7-bit data; 1=8-bit data)
! unsigned int listen: 1; //Listen enable (0=disabled; 1=enabled, feed tx back to receiver)
! unsigned int mm: 1; //Multiprocessor mode (0=idle-line protocol; 1=address-bit protocol)
! unsigned int :0;
! unsigned int ckpl: 1; //Clock polarity (0=normal; 1=inverted)
! unsigned int urxse: 1; //Receive start-edge detection (0=disabled; 1=enabled)
! unsigned int urxeie: 1; //Erroneous-character receive (0=rejected; 1=recieved and URXIFGx set)
! unsigned int urxwie: 1; //Wake-up interrupt-enable (0=all characters set URXIFGx; 1=only address sets URXIFGx)
! } msp430_uart_config_t;
typedef enum {
- /**
- The calculations were performed using the msp-uart.pl script:
- # msp-uart.pl -- calculates the uart registers for MSP430
- #
- # Copyright (C) 2002 - Pedro Zorzenon Neto - pzn dot debian dot org
- **/
-
//32KHZ = 32,768 Hz, 1MHZ = 1,048,576 Hz
UBR_32KHZ_1200=0x001B, UMCTL_32KHZ_1200=0x94,
--- 98,152 ----
typedef struct {
! unsigned int ubr: 16; //Clock division factor (>=0x0002)
!
! unsigned int :1;
unsigned int mm: 1; //Master mode (0=slave; 1=master)
! unsigned int :1;
! unsigned int listen: 1; //Listen enable (0=disabled; 1=enabled, feed tx back to receiver)
! unsigned int clen: 1; //Character length (0=7-bit data; 1=8-bit data)
! unsigned int: 3;
!
! unsigned int:1;
unsigned int stc: 1; //Slave transmit (0=4-pin SPI && STE enabled; 1=3-pin SPI && STE disabled)
+ unsigned int:2;
+ unsigned int ssel: 2; //Clock source (00=external UCLK [slave]; 01=ACLK [master]; 10=SMCLK [master] 11=SMCLK [master]);
+ unsigned int ckpl: 1; //Clock polarity (0=inactive is low && data at rising edge; 1=inverted)
+ unsigned int ckph: 1; //Clock phase (0=normal; 1=half-cycle delayed)
unsigned int :0;
} msp430_spi_config_t;
typedef struct {
! uint16_t ubr;
! uint8_t uctl;
! uint8_t utctl;
! } msp430_spi_registers_t;
!
! typedef union {
! msp430_spi_config_t spiConfig;
! msp430_spi_registers_t spiRegisters;
! } msp430_spi_union_config_t;
!
! msp430_spi_union_config_t msp430_spi_default_config = {
! {
! ubr : 0x0002,
! ssel : 0x02,
! clen : 1,
! listen : 0,
! mm : 1,
! ckph : 1,
! ckpl : 0,
! stc : 1
! }
! };
!
!
!
! /**
! The calculations were performed using the msp-uart.pl script:
! msp-uart.pl -- calculates the uart registers for MSP430
+ Copyright (C) 2002 - Pedro Zorzenon Neto - pzn dot debian dot org
+ **/
typedef enum {
//32KHZ = 32,768 Hz, 1MHZ = 1,048,576 Hz
UBR_32KHZ_1200=0x001B, UMCTL_32KHZ_1200=0x94,
***************
*** 142,146 ****
UBR_32KHZ_4800=0x0006, UMCTL_32KHZ_4800=0x77,
UBR_32KHZ_9600=0x0003, UMCTL_32KHZ_9600=0x29, // (Warning: triggers MSP430 errata US14)
!
UBR_1MHZ_1200=0x0369, UMCTL_1MHZ_1200=0x7B,
UBR_1MHZ_1800=0x0246, UMCTL_1MHZ_1800=0x55,
--- 155,159 ----
UBR_32KHZ_4800=0x0006, UMCTL_32KHZ_4800=0x77,
UBR_32KHZ_9600=0x0003, UMCTL_32KHZ_9600=0x29, // (Warning: triggers MSP430 errata US14)
!
UBR_1MHZ_1200=0x0369, UMCTL_1MHZ_1200=0x7B,
UBR_1MHZ_1800=0x0246, UMCTL_1MHZ_1800=0x55,
***************
*** 156,187 ****
} msp430_uart_rate_t;
! msp430_uart_config_t msp430_uart_default_config = {ubr: UBR_1MHZ_57600, umctl: UMCTL_1MHZ_57600, ssel: 0x02, pena: 0, pev: 0, spb: 0, clen: 1, listen: 0, mm: 0, ckpl: 0, urxse: 0, urxeie: 1, urxwie: 0};
typedef struct {
! unsigned int rxdmaen: 1; // Receive DMA enable. 0 = disabled.
! unsigned int txdmaen: 1; // Transmit DMA enable. 0 = disabled.
! unsigned int xa: 1; // Extended addressing. 0 = 7-bit addressing.
! unsigned int listen: 1; // Listen. 0 = disabled.
! unsigned int i2cword : 1; // Word mode. 0 = byte mode.
! unsigned int i2crm : 1; // Repeat mode. 0 = I2CNDAT.
! unsigned int i2cssel : 2; // Clock source select. 0=None, 1=ACLK, 2=SMCLK
! unsigned int i2cpsc : 8; // Clock prescaler.
! unsigned int i2csclh : 8; // Shift clock high register.
! unsigned int i2cscll : 8; // Shift clock low register.
unsigned int i2coa : 10; // Own address register.
} msp430_i2c_config_t;
! msp430_i2c_config_t msp430_i2c_default_config = {
! rxdmaen : 0,
! txdmaen : 0,
! xa : 0,
! listen : 0,
! i2cword : 0,
! i2crm : 1,
! i2cssel : 2,
! i2cpsc : 0,
! i2csclh : 3,
! i2cscll : 3,
! i2coa : 0,
};
--- 169,308 ----
} msp430_uart_rate_t;
! typedef struct {
! unsigned int ubr:16; //Baud rate (use enum msp430_uart_rate_t for predefined rates)
!
! unsigned int umctl: 8; //Modulation (use enum msp430_uart_rate_t for predefined rates)
!
! unsigned int :1;
! unsigned int mm: 1; //Multiprocessor mode (0=idle-line protocol; 1=address-bit protocol)
! unsigned int :1;
! unsigned int listen: 1; //Listen enable (0=disabled; 1=enabled, feed tx back to receiver)
! unsigned int clen: 1; //Character length (0=7-bit data; 1=8-bit data)
! unsigned int spb: 1; //Stop bits (0=one stop bit; 1=two stop bits)
! unsigned int pev: 1; //Parity select (0=odd; 1=even)
! unsigned int pena: 1; //Parity enable (0=disabled; 1=enabled)
! unsigned int :0;
!
! unsigned int :3;
! unsigned int urxse: 1; //Receive start-edge detection (0=disabled; 1=enabled)
! unsigned int ssel: 2; //Clock source (00=UCLKI; 01=ACLK; 10=SMCLK; 11=SMCLK)
! unsigned int ckpl: 1; //Clock polarity (0=normal; 1=inverted)
! unsigned int :1;
!
! unsigned int :2;
! unsigned int urxwie: 1; //Wake-up interrupt-enable (0=all characters set URXIFGx; 1=only address sets URXIFGx)
! unsigned int urxeie: 1; //Erroneous-character receive (0=rejected; 1=recieved and URXIFGx set)
! unsigned int :4;
! unsigned int :0;
!
! unsigned int utxe:1; // 1:enable tx module
! unsigned int urxe:1; // 1:enable rx module
! } msp430_uart_config_t;
typedef struct {
! uint16_t ubr;
! uint8_t umctl;
! uint8_t uctl;
! uint8_t utctl;
! uint8_t urctl;
! uint8_t ume;
! } msp430_uart_registers_t;
!
! typedef union {
! msp430_uart_config_t uartConfig;
! msp430_uart_registers_t uartRegisters;
! } msp430_uart_union_config_t;
!
! msp430_uart_union_config_t msp430_uart_default_config = {
! {
! utxe : 1,
! urxe : 1,
! ubr : UBR_1MHZ_57600,
! umctl : UMCTL_1MHZ_57600,
! ssel : 0x02,
! pena : 0,
! pev : 0,
! spb : 0,
! clen : 1,
! listen : 0,
! mm : 0,
! ckpl : 0,
! urxse : 0,
! urxeie : 1,
! urxwie : 0,
! utxe : 1,
! urxe : 1
! }
! };
!
!
!
! typedef struct {
! unsigned int i2cstt: 1; // I2CSTT Bit 0 START bit. (0=No action; 1=Send START condition)
! unsigned int i2cstp: 1; // I2CSTP Bit 1 STOP bit. (0=No action; 1=Send STOP condition)
! unsigned int i2cstb: 1; // I2CSTB Bit 2 Start byte. (0=No action; 1=Send START condition and start byte (01h))
! unsigned int i2cctrx: 1; //I2CTRX Bit 3 I2C transmit. (0=Receive mode; 1=Transmit mode) pin.
! unsigned int i2cssel: 2; // I2C clock source select. (00=No clock; 01=ACLK; 10=SMCLK; 11=SMCLK)
! unsigned int i2ccrm: 1; // I2C repeat mode
! unsigned int i2cword: 1; // I2C word mode. Selects byte(=0) or word(=1) mode for the I2C data register.
! } __attribute__ ((packed)) msp430_i2ctctl_t;
!
! DEFINE_UNION_CAST(i2ctctl2int,uint8_t,msp430_i2ctctl_t)
! DEFINE_UNION_CAST(int2i2ctctl,msp430_i2ctctl_t,uint8_t)
!
! typedef struct {
! unsigned int :1;
! unsigned int mst: 1; //Master mode (0=slave; 1=master)
! unsigned int :1;
! unsigned int listen: 1; //Listen enable (0=disabled; 1=enabled, feed tx back to receiver)
! unsigned int xa: 1; //Extended addressing (0=7-bit addressing; 1=8-bit addressing)
! unsigned int :1;
! unsigned int txdmaen: 1; //DMA to TX (0=disabled; 1=enabled)
! unsigned int rxdmaen: 1; //RX to DMA (0=disabled; 1=enabled)
!
! unsigned int :4;
! unsigned int i2cssel: 2; //Clock source (00=disabled; 01=ACLK; 10=SMCLK; 11=SMCLK)
! unsigned int i2crm: 1; //Repeat mode (0=use I2CNDAT; 1=count in software)
! unsigned int i2cword: 1; //Word mode (0=byte mode; 1=word mode)
!
! unsigned int i2cpsc: 8; //Clock prescaler (values >0x04 not recomended)
!
! unsigned int i2csclh: 8; //High period (high period=[value+2]*i2cpsc; can not be lower than 5*i2cpsc)
!
! unsigned int i2cscll: 8; //Low period (low period=[value+2]*i2cpsc; can not be lower than 5*i2cpsc)
!
unsigned int i2coa : 10; // Own address register.
+ unsigned int :6;
} msp430_i2c_config_t;
+
+ typedef struct {
+ uint8_t uctl;
+ uint8_t i2ctctl;
+ uint8_t i2cpsc;
+ uint8_t i2csclh;
+ uint8_t i2cscll;
+ uint16_t i2coa;
+ } msp430_i2c_registers_t;
! typedef union {
! msp430_i2c_config_t i2cConfig;
! msp430_i2c_registers_t i2cRegisters;
! } msp430_i2c_union_config_t;
!
! msp430_i2c_union_config_t msp430_i2c_default_config = {
! {
! rxdmaen : 0,
! txdmaen : 0,
! xa : 0,
! listen : 0,
! mst : 1,
! i2cword : 0,
! i2crm : 0,
! i2cssel : 0x2,
! i2cpsc : 0,
! i2csclh : 0x3,
! i2cscll : 0x3,
! i2coa : 0,
! }
};
--- Msp430UartControl.nc DELETED ---
- Previous message: [Tinyos-2-commits]
CVS: tinyos-2.x/tos/platforms/eyesIFX/chips/tda5250
HplTda5250DataIOC.nc, 1.1.2.4, 1.1.2.5 HplTda5250DataIOP.nc,
1.1.2.4, 1.1.2.5 tda5250BusResourceSettings.h, 1.1.4.4, 1.1.4.5
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/platforms/eyesIFX
eyesIFXSerialP.nc, 1.1.2.3, 1.1.2.4 RadioDataLinkC.nc,
1.1.2.10, 1.1.2.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list