X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fmsp430%2Fusci%2FMsp430Usci.h;h=88e4c90198b48e7470c6ea56f09d2cc6d503dfdb;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=50a0ca72e5bb6f37f4d8eff30dd1876dee2b365f;hpb=b83aa91d0424245008bc68cecceac8b12efda682;p=tinyos-2.x.git diff --git a/tos/chips/msp430/usci/Msp430Usci.h b/tos/chips/msp430/usci/Msp430Usci.h index 50a0ca72..88e4c901 100644 --- a/tos/chips/msp430/usci/Msp430Usci.h +++ b/tos/chips/msp430/usci/Msp430Usci.h @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + /** * Header definitions for the USCI peripheral in newer msp430 processors. * A USCI peripheral provides two communications devices, denoted A and B. @@ -38,10 +38,10 @@ * * A devices offer UART, LIN, IrDA and SPI modes of operation. B parts are * limited to SPI and I2C modes. - * - * @author R. Steve McKown + * + * @author R. Steve McKown */ - + #ifndef MSP430_USCI_h #define MSP430_USCI_h @@ -60,13 +60,35 @@ typedef enum typedef enum { USCI_REN_NONE = 0, - USCI_REN_RX = 0x08, - USCI_REN_RX_PULLUP = USCI_REN_RX + 0x01, - USCI_REN_RX_PULLDOWN = USCI_REN_RX + 0x02, + /* For use in UART mode */ + USCI_REN_TX = 0x03, + USCI_REN_TX_PULLUP = 0x01, + USCI_REN_TX_PULLDOWN = 0x02, + USCI_REN_RX = 0x0c, + USCI_REN_RX_PULLUP = 0x04, + USCI_REN_RX_PULLDOWN = 0x08, + + /* For use in SPI mode */ + USCI_REN_STE = 0x30, + USCI_REN_STE_PULLUP = 0x10, + USCI_REN_STE_PULLDOWN = 0x20, + USCI_REN_SIMO = USCI_REN_TX, + USCI_REN_SIMO_PULLUP = USCI_REN_TX_PULLUP, + USCI_REN_SIMO_PULLDOWN = USCI_REN_TX_PULLDOWN, + USCI_REN_SOMI = USCI_REN_RX, + USCI_REN_SOMI_PULLUP = USCI_REN_RX_PULLUP, + USCI_REN_SOMI_PULLDOWN = USCI_REN_RX_PULLDOWN, + USCI_REN_CLK = 0xc0, + USCI_REN_CLK_PULLUP = 0x40, + USCI_REN_CLK_PULLDOWN = 0x80, - USCI_REN_TX = 0x80, - USCI_REN_TX_PULLUP = USCI_REN_TX + 0x10, - USCI_REN_TX_PULLDOWN = USCI_REN_TX + 0x20 + /* For use in I2C mode */ + USCI_REN_SDA = USCI_REN_TX, + USCI_REN_SDA_PULLUP = USCI_REN_TX_PULLUP, + USCI_REN_SDA_PULLDOWN = USCI_REN_TX_PULLDOWN, + USCI_REN_SCL = USCI_REN_RX, + USCI_REN_SCL_PULLUP = USCI_REN_RX_PULLUP, + USCI_REN_SCL_PULLDOWN = USCI_REN_RX_PULLDOWN } msp430_ren_t; /* Baud rates for UART mode. Only 32KHz modes work right now. */ @@ -91,16 +113,17 @@ typedef struct { uint8_t irtctl; uint8_t irrctl; uint8_t abctl; + bool uclisten; msp430_ren_t ren; -} __attribute__ ((packed)) msp430_usci_uart_t; +} msp430_usci_uart_t; typedef struct { uint8_t ctl0; uint8_t ctl1; uint16_t brx; - uint8_t mctl; /* ??? */ + bool uclisten; msp430_ren_t ren; -} __attribute__ ((packed)) msp430_usci_spi_t; +} msp430_usci_spi_t; typedef struct { uint8_t ctl0; @@ -109,7 +132,8 @@ typedef struct { uint8_t i2cie; uint8_t i2coa; uint8_t i2csa; + bool uclisten; msp430_ren_t ren; -} __attribute__ ((packed)) msp430_usci_i2c_t; +} msp430_usci_i2c_t; #endif