1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32
33 import ti.catalog.msp430.peripherals.clock.IClock;
34
35 /*!
36 * Universal Serial Communication Interface B0 I2C 2xx
37 */
38 metaonly module USCI_B0_I2C_2xx inherits IUSCI_B0_I2C {
39
40 41 42
43 create(IClock.Instance clock);
44
45 /*! Not-acknowledge interrupt enable */
46 enum UCNACKIE_t {
47 UCNACKIE_OFF = 0x00, /*! Interrupt disabled */
48 UCNACKIE = 0x80 /*! Interrupt enabled */
49 };
50
51 /*! Stop condition interrupt enable */
52 enum UCSTPIE_t {
53 UCSTPIE_OFF = 0x00, /*! Interrupt disabled */
54 UCSTPIE = 0x80 /*! Interrupt enabled */
55 };
56
57 /*! Start condition interrupt enable */
58 enum UCSTTIE_t {
59 UCSTTIE_OFF = 0x00, /*! Interrupt disabled */
60 UCSTTIE = 0x80 /*! Interrupt enabled */
61 };
62
63 /*! Arbitration lost interrupt enable */
64 enum UCALIE_t {
65 UCALIE_OFF = 0x00, /*! Interrupt disabled */
66 UCALIE = 0x80 /*! Interrupt enabled */
67 };
68
69 /*! USCI_Bx I2C Interrupt Enable Register */
70 struct UCBxI2CIE_t {
71 UCNACKIE_t UCNACKIE; /*! Not-acknowledge interrupt enable
72 * 0 Interrupt disabled
73 * 1 Interrupt enabled */
74 UCSTPIE_t UCSTPIE; /*! Stop condition interrupt enable
75 * 0 Interrupt disabled
76 * 1 Interrupt enabled */
77 UCSTTIE_t UCSTTIE; /*! Start condition interrupt enable
78 * 0 Interrupt disabled
79 * 1 Interrupt enabled */
80 UCALIE_t UCALIE; /*! Arbitration lost interrupt enable
81 * 0 Interrupt disabled
82 * 1 Interrupt enabled */
83 }
84
85 instance:
86 /*! @_nodoc */
87 config IClock.Instance clock;
88
89 /*! USCI_Bx I2C Interrupt Enable Register */
90 config UCBxI2CIE_t UCB0I2CIE = {
91 UCNACKIE : UCNACKIE_OFF,
92 UCSTPIE : UCSTPIE_OFF,
93 UCSTTIE : UCSTTIE_OFF,
94 UCALIE : UCALIE_OFF,
95 };
96
97 /*!
98 * ======== setUCNACKIE ========
99 * Sets UCNACKIE bit
100 *
101 * @see #setUCNACKIE
102 */
103 Bool setUCNACKIE(Bool set);
104
105 /*!
106 * ======== getUCNACKIE ========
107 * Gets UCNACKIE bit
108 *
109 * @see #getUCNACKIE
110 */
111 Bool getUCNACKIE();
112
113 /*!
114 * ======== setUCSTPIE ========
115 * Sets UCSTPIE bit
116 *
117 * @see #setUCSTPIE
118 */
119 Bool setUCSTPIE(Bool set);
120
121 /*!
122 * ======== getUCSTPIE ========
123 * Gets UCSTPIE bit
124 *
125 * @see #getUCSTPIE
126 */
127 Bool getUCSTPIE();
128
129 /*!
130 * ======== setUCSTTIE ========
131 * Sets UCSTTIE bit
132 *
133 * @see #setUCSTTIE
134 */
135 Bool setUCSTTIE(Bool set);
136
137 /*!
138 * ======== getUCSTTIE ========
139 * Gets UCSTTIE bit
140 *
141 * @see #getUCSTTIE
142 */
143 Bool getUCSTTIE();
144
145 /*!
146 * ======== setUCALIE ========
147 * Sets UCALIE bit
148 *
149 * @see #setUCALIE
150 */
151 Bool setUCALIE(Bool set);
152
153 /*!
154 * ======== getUCALIE ========
155 * Gets UCALIE bit
156 *
157 * @see #getUCALIE
158 */
159 Bool getUCALIE();
160
161 /*! USCI_B0 I2C interrupt enables */
162 config regIntVect_t interruptSource[4];
163
164 /*! Determine if each Register needs to be forced set or not */
165 readonly config ForceSetDefaultRegister_t forceSetDefaultRegister[] =
166 [
167 { register : "UCB0CTL0" , regForceSet : false },
168 { register : "UCB0CTL1" , regForceSet : false },
169 { register : "UCB0BR0" , regForceSet : false },
170 { register : "UCB0BR1" , regForceSet : false },
171 { register : "UCB0STAT" , regForceSet : false },
172 { register : "UCB0RXBUF" , regForceSet : false },
173 { register : "UCB0TXBUF" , regForceSet : false },
174 { register : "UCB0I2COA" , regForceSet : false },
175 { register : "UCB0I2CSA" , regForceSet : false },
176 { register : "UCB0I2CIE" , regForceSet : false }
177 ];
178 }