]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430FR5969_LaunchPad/driverlib/MSP430FR5xx_6xx/eusci_b_i2c.h
4b101b07b28876e908ad9f19413968704300f6da
[freertos] / FreeRTOS / Demo / MSP430FR5969_LaunchPad / driverlib / MSP430FR5xx_6xx / eusci_b_i2c.h
1 /* --COPYRIGHT--,BSD\r
2  * Copyright (c) 2014, Texas Instruments Incorporated\r
3  * All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  *\r
9  * *  Redistributions of source code must retain the above copyright\r
10  *    notice, this list of conditions and the following disclaimer.\r
11  *\r
12  * *  Redistributions in binary form must reproduce the above copyright\r
13  *    notice, this list of conditions and the following disclaimer in the\r
14  *    documentation and/or other materials provided with the distribution.\r
15  *\r
16  * *  Neither the name of Texas Instruments Incorporated nor the names of\r
17  *    its contributors may be used to endorse or promote products derived\r
18  *    from this software without specific prior written permission.\r
19  *\r
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31  * --/COPYRIGHT--*/\r
32 //*****************************************************************************\r
33 //\r
34 // eusci_b_i2c.h - Driver for the EUSCI_B_I2C Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_EUSCI_B_I2C_H__\r
39 #define __MSP430WARE_EUSCI_B_I2C_H__\r
40 \r
41 #include "inc/hw_memmap.h"\r
42 \r
43 #ifdef __MSP430_HAS_EUSCI_Bx__\r
44 \r
45 //*****************************************************************************\r
46 //\r
47 // If building with a C++ compiler, make all of the definitions in this header\r
48 // have a C binding.\r
49 //\r
50 //*****************************************************************************\r
51 #ifdef __cplusplus\r
52 extern "C"\r
53 {\r
54 #endif\r
55 \r
56 #include "inc/hw_regaccess.h"\r
57 //*****************************************************************************\r
58 //\r
59 //! \brief Used in the EUSCI_B_I2C_initMaster() function as the param\r
60 //! parameter.\r
61 //\r
62 //*****************************************************************************\r
63 typedef struct EUSCI_B_I2C_initMasterParam\r
64 {\r
65     //! Is the clocksource.\r
66     //! \n Valid values are:\r
67     //! - \b EUSCI_B_I2C_CLOCKSOURCE_ACLK\r
68     //! - \b EUSCI_B_I2C_CLOCKSOURCE_SMCLK\r
69     uint8_t selectClockSource;\r
70     //! Is the rate of the clock supplied to the I2C module (the frequency in\r
71     //! Hz of the clock source specified in selectClockSource).\r
72     uint32_t i2cClk;\r
73     //! Setup for selecting data transfer rate.\r
74     //! \n Valid values are:\r
75     //! - \b EUSCI_B_I2C_SET_DATA_RATE_400KBPS\r
76     //! - \b EUSCI_B_I2C_SET_DATA_RATE_100KBPS\r
77     uint32_t dataRate;\r
78     //! Sets threshold for automatic STOP or UCSTPIFG\r
79     uint8_t byteCounterThreshold;\r
80     //! Sets up the STOP condition generation.\r
81     //! \n Valid values are:\r
82     //! - \b EUSCI_B_I2C_NO_AUTO_STOP\r
83     //! - \b EUSCI_B_I2C_SET_BYTECOUNT_THRESHOLD_FLAG\r
84     //! - \b EUSCI_B_I2C_SEND_STOP_AUTOMATICALLY_ON_BYTECOUNT_THRESHOLD\r
85     uint8_t autoSTOPGeneration;\r
86 } EUSCI_B_I2C_initMasterParam;\r
87 \r
88 //*****************************************************************************\r
89 //\r
90 //! \brief Used in the EUSCI_B_I2C_initSlave() function as the param parameter.\r
91 //\r
92 //*****************************************************************************\r
93 typedef struct EUSCI_B_I2C_initSlaveParam\r
94 {\r
95     //! 7-bit slave address\r
96     uint8_t slaveAddress;\r
97     //! Own address Offset referred to- 'x' value of UCBxI2COAx.\r
98     //! \n Valid values are:\r
99     //! - \b EUSCI_B_I2C_OWN_ADDRESS_OFFSET0\r
100     //! - \b EUSCI_B_I2C_OWN_ADDRESS_OFFSET1\r
101     //! - \b EUSCI_B_I2C_OWN_ADDRESS_OFFSET2\r
102     //! - \b EUSCI_B_I2C_OWN_ADDRESS_OFFSET3\r
103     uint8_t slaveAddressOffset;\r
104     //! Selects if the specified address is enabled or disabled.\r
105     //! \n Valid values are:\r
106     //! - \b EUSCI_B_I2C_OWN_ADDRESS_DISABLE\r
107     //! - \b EUSCI_B_I2C_OWN_ADDRESS_ENABLE\r
108     uint32_t slaveOwnAddressEnable;\r
109 } EUSCI_B_I2C_initSlaveParam;\r
110 \r
111 //*****************************************************************************\r
112 //\r
113 // The following are values that can be passed to the param parameter for\r
114 // functions: EUSCI_B_I2C_initMaster().\r
115 //\r
116 //*****************************************************************************\r
117 #define EUSCI_B_I2C_NO_AUTO_STOP                                       UCASTP_0\r
118 #define EUSCI_B_I2C_SET_BYTECOUNT_THRESHOLD_FLAG                       UCASTP_1\r
119 #define EUSCI_B_I2C_SEND_STOP_AUTOMATICALLY_ON_BYTECOUNT_THRESHOLD     UCASTP_2\r
120 \r
121 //*****************************************************************************\r
122 //\r
123 // The following are values that can be passed to the param parameter for\r
124 // functions: EUSCI_B_I2C_initMaster().\r
125 //\r
126 //*****************************************************************************\r
127 #define EUSCI_B_I2C_SET_DATA_RATE_400KBPS                                400000\r
128 #define EUSCI_B_I2C_SET_DATA_RATE_100KBPS                                100000\r
129 \r
130 //*****************************************************************************\r
131 //\r
132 // The following are values that can be passed to the param parameter for\r
133 // functions: EUSCI_B_I2C_initMaster().\r
134 //\r
135 //*****************************************************************************\r
136 #define EUSCI_B_I2C_CLOCKSOURCE_ACLK                               UCSSEL__ACLK\r
137 #define EUSCI_B_I2C_CLOCKSOURCE_SMCLK                             UCSSEL__SMCLK\r
138 \r
139 //*****************************************************************************\r
140 //\r
141 // The following are values that can be passed to the param parameter for\r
142 // functions: EUSCI_B_I2C_initSlave().\r
143 //\r
144 //*****************************************************************************\r
145 #define EUSCI_B_I2C_OWN_ADDRESS_OFFSET0                                    0x00\r
146 #define EUSCI_B_I2C_OWN_ADDRESS_OFFSET1                                    0x02\r
147 #define EUSCI_B_I2C_OWN_ADDRESS_OFFSET2                                    0x04\r
148 #define EUSCI_B_I2C_OWN_ADDRESS_OFFSET3                                    0x06\r
149 \r
150 //*****************************************************************************\r
151 //\r
152 // The following are values that can be passed to the param parameter for\r
153 // functions: EUSCI_B_I2C_initSlave().\r
154 //\r
155 //*****************************************************************************\r
156 #define EUSCI_B_I2C_OWN_ADDRESS_DISABLE                                    0x00\r
157 #define EUSCI_B_I2C_OWN_ADDRESS_ENABLE                                   UCOAEN\r
158 \r
159 //*****************************************************************************\r
160 //\r
161 // The following are values that can be passed to the mode parameter for\r
162 // functions: EUSCI_B_I2C_setMode() as well as returned by the\r
163 // EUSCI_B_I2C_getMode() function.\r
164 //\r
165 //*****************************************************************************\r
166 #define EUSCI_B_I2C_TRANSMIT_MODE                                          UCTR\r
167 #define EUSCI_B_I2C_RECEIVE_MODE                                           0x00\r
168 \r
169 //*****************************************************************************\r
170 //\r
171 // The following are values that can be passed to the mask parameter for\r
172 // functions: EUSCI_B_I2C_enableInterrupt(), EUSCI_B_I2C_disableInterrupt(),\r
173 // EUSCI_B_I2C_clearInterrupt(), and EUSCI_B_I2C_getInterruptStatus() as well\r
174 // as returned by the EUSCI_B_I2C_getInterruptStatus() function.\r
175 //\r
176 //*****************************************************************************\r
177 #define EUSCI_B_I2C_NAK_INTERRUPT                                      UCNACKIE\r
178 #define EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT                            UCALIE\r
179 #define EUSCI_B_I2C_STOP_INTERRUPT                                      UCSTPIE\r
180 #define EUSCI_B_I2C_START_INTERRUPT                                     UCSTTIE\r
181 #define EUSCI_B_I2C_TRANSMIT_INTERRUPT0                                 UCTXIE0\r
182 #define EUSCI_B_I2C_TRANSMIT_INTERRUPT1                                 UCTXIE1\r
183 #define EUSCI_B_I2C_TRANSMIT_INTERRUPT2                                 UCTXIE2\r
184 #define EUSCI_B_I2C_TRANSMIT_INTERRUPT3                                 UCTXIE3\r
185 #define EUSCI_B_I2C_RECEIVE_INTERRUPT0                                  UCRXIE0\r
186 #define EUSCI_B_I2C_RECEIVE_INTERRUPT1                                  UCRXIE1\r
187 #define EUSCI_B_I2C_RECEIVE_INTERRUPT2                                  UCRXIE2\r
188 #define EUSCI_B_I2C_RECEIVE_INTERRUPT3                                  UCRXIE3\r
189 #define EUSCI_B_I2C_BIT9_POSITION_INTERRUPT                            UCBIT9IE\r
190 #define EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT                        UCCLTOIE\r
191 #define EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT                             UCBCNTIE\r
192 \r
193 //*****************************************************************************\r
194 //\r
195 // The following are values that can be passed toThe following are values that\r
196 // can be returned by the EUSCI_B_I2C_isBusBusy() function.\r
197 //\r
198 //*****************************************************************************\r
199 #define EUSCI_B_I2C_BUS_BUSY                                            UCBBUSY\r
200 #define EUSCI_B_I2C_BUS_NOT_BUSY                                           0x00\r
201 \r
202 //*****************************************************************************\r
203 //\r
204 // The following are values that can be passed toThe following are values that\r
205 // can be returned by the EUSCI_B_I2C_masterIsStopSent() function.\r
206 //\r
207 //*****************************************************************************\r
208 #define EUSCI_B_I2C_STOP_SEND_COMPLETE                                     0x00\r
209 #define EUSCI_B_I2C_SENDING_STOP                                        UCTXSTP\r
210 \r
211 //*****************************************************************************\r
212 //\r
213 // The following are values that can be passed toThe following are values that\r
214 // can be returned by the EUSCI_B_I2C_masterIsStartSent() function.\r
215 //\r
216 //*****************************************************************************\r
217 #define EUSCI_B_I2C_START_SEND_COMPLETE                                    0x00\r
218 #define EUSCI_B_I2C_SENDING_START                                       UCTXSTT\r
219 \r
220 //*****************************************************************************\r
221 //\r
222 // Prototypes for the APIs.\r
223 //\r
224 //*****************************************************************************\r
225 \r
226 //*****************************************************************************\r
227 //\r
228 //! \brief Initializes the I2C Master block.\r
229 //!\r
230 //! This function initializes operation of the I2C Master block. Upon\r
231 //! successful initialization of the I2C block, this function will have set the\r
232 //! bus speed for the master; however I2C module is still disabled till\r
233 //! EUSCI_B_I2C_enable is invoked.\r
234 //!\r
235 //! \param baseAddress is the base address of the I2C Master module.\r
236 //! \param param is the pointer to the struct for master initialization.\r
237 //!\r
238 //! \return None\r
239 //\r
240 //*****************************************************************************\r
241 extern void EUSCI_B_I2C_initMaster(uint16_t baseAddress,\r
242                                    EUSCI_B_I2C_initMasterParam *param);\r
243 \r
244 //*****************************************************************************\r
245 //\r
246 //! \brief Initializes the I2C Slave block.\r
247 //!\r
248 //! This function initializes operation of the I2C as a Slave mode. Upon\r
249 //! successful initialization of the I2C blocks, this function will have set\r
250 //! the slave address but the I2C module is still disabled till\r
251 //! EUSCI_B_I2C_enable is invoked.\r
252 //!\r
253 //! \param baseAddress is the base address of the I2C Slave module.\r
254 //! \param param is the pointer to the struct for slave initialization.\r
255 //!\r
256 //! \return None\r
257 //\r
258 //*****************************************************************************\r
259 extern void EUSCI_B_I2C_initSlave(uint16_t baseAddress,\r
260                                   EUSCI_B_I2C_initSlaveParam *param);\r
261 \r
262 //*****************************************************************************\r
263 //\r
264 //! \brief Enables the I2C block.\r
265 //!\r
266 //! This will enable operation of the I2C block.\r
267 //!\r
268 //! \param baseAddress is the base address of the USCI I2C module.\r
269 //!\r
270 //! Modified bits are \b UCSWRST of \b UCBxCTLW0 register.\r
271 //!\r
272 //! \return None\r
273 //\r
274 //*****************************************************************************\r
275 extern void EUSCI_B_I2C_enable(uint16_t baseAddress);\r
276 \r
277 //*****************************************************************************\r
278 //\r
279 //! \brief Disables the I2C block.\r
280 //!\r
281 //! This will disable operation of the I2C block.\r
282 //!\r
283 //! \param baseAddress is the base address of the USCI I2C module.\r
284 //!\r
285 //! Modified bits are \b UCSWRST of \b UCBxCTLW0 register.\r
286 //!\r
287 //! \return None\r
288 //\r
289 //*****************************************************************************\r
290 extern void EUSCI_B_I2C_disable(uint16_t baseAddress);\r
291 \r
292 //*****************************************************************************\r
293 //\r
294 //! \brief Sets the address that the I2C Master will place on the bus.\r
295 //!\r
296 //! This function will set the address that the I2C Master will place on the\r
297 //! bus when initiating a transaction.\r
298 //!\r
299 //! \param baseAddress is the base address of the USCI I2C module.\r
300 //! \param slaveAddress 7-bit slave address\r
301 //!\r
302 //! Modified bits of \b UCBxI2CSA register.\r
303 //!\r
304 //! \return None\r
305 //\r
306 //*****************************************************************************\r
307 extern void EUSCI_B_I2C_setSlaveAddress(uint16_t baseAddress,\r
308                                         uint8_t slaveAddress);\r
309 \r
310 //*****************************************************************************\r
311 //\r
312 //! \brief Sets the mode of the I2C device\r
313 //!\r
314 //! When the receive parameter is set to EUSCI_B_I2C_TRANSMIT_MODE, the address\r
315 //! will indicate that the I2C module is in receive mode; otherwise, the I2C\r
316 //! module is in send mode.\r
317 //!\r
318 //! \param baseAddress is the base address of the USCI I2C module.\r
319 //! \param mode Mode for the EUSCI_B_I2C module\r
320 //!        Valid values are:\r
321 //!        - \b EUSCI_B_I2C_TRANSMIT_MODE [Default]\r
322 //!        - \b EUSCI_B_I2C_RECEIVE_MODE\r
323 //!\r
324 //! Modified bits are \b UCTR of \b UCBxCTLW0 register.\r
325 //!\r
326 //! \return None\r
327 //\r
328 //*****************************************************************************\r
329 extern void EUSCI_B_I2C_setMode(uint16_t baseAddress,\r
330                                 uint8_t mode);\r
331 \r
332 //*****************************************************************************\r
333 //\r
334 //! \brief Gets the mode of the I2C device\r
335 //!\r
336 //! Current I2C transmit/receive mode.\r
337 //!\r
338 //! \param baseAddress is the base address of the I2C module.\r
339 //!\r
340 //! Modified bits are \b UCTR of \b UCBxCTLW0 register.\r
341 //!\r
342 //! \return One of the following:\r
343 //!         - \b EUSCI_B_I2C_TRANSMIT_MODE\r
344 //!         - \b EUSCI_B_I2C_RECEIVE_MODE\r
345 //!         \n indicating the current mode\r
346 //\r
347 //*****************************************************************************\r
348 extern uint8_t EUSCI_B_I2C_getMode(uint16_t baseAddress);\r
349 \r
350 //*****************************************************************************\r
351 //\r
352 //! \brief Transmits a byte from the I2C Module.\r
353 //!\r
354 //! This function will place the supplied data into I2C transmit data register\r
355 //! to start transmission.\r
356 //!\r
357 //! \param baseAddress is the base address of the I2C Slave module.\r
358 //! \param transmitData data to be transmitted from the I2C module\r
359 //!\r
360 //! Modified bits of \b UCBxTXBUF register.\r
361 //!\r
362 //! \return None\r
363 //\r
364 //*****************************************************************************\r
365 extern void EUSCI_B_I2C_slavePutData(uint16_t baseAddress,\r
366                                      uint8_t transmitData);\r
367 \r
368 //*****************************************************************************\r
369 //\r
370 //! \brief Receives a byte that has been sent to the I2C Module.\r
371 //!\r
372 //! This function reads a byte of data from the I2C receive data Register.\r
373 //!\r
374 //! \param baseAddress is the base address of the I2C Slave module.\r
375 //!\r
376 //! \return Returns the byte received from by the I2C module, cast as an\r
377 //!         uint8_t.\r
378 //\r
379 //*****************************************************************************\r
380 extern uint8_t EUSCI_B_I2C_slaveGetData(uint16_t baseAddress);\r
381 \r
382 //*****************************************************************************\r
383 //\r
384 //! \brief Indicates whether or not the I2C bus is busy.\r
385 //!\r
386 //! This function returns an indication of whether or not the I2C bus is busy.\r
387 //! This function checks the status of the bus via UCBBUSY bit in UCBxSTAT\r
388 //! register.\r
389 //!\r
390 //! \param baseAddress is the base address of the I2C module.\r
391 //!\r
392 //! \return One of the following:\r
393 //!         - \b EUSCI_B_I2C_BUS_BUSY\r
394 //!         - \b EUSCI_B_I2C_BUS_NOT_BUSY\r
395 //!         \n indicating whether the bus is busy\r
396 //\r
397 //*****************************************************************************\r
398 extern uint16_t EUSCI_B_I2C_isBusBusy(uint16_t baseAddress);\r
399 \r
400 //*****************************************************************************\r
401 //\r
402 //! \brief Indicates whether STOP got sent.\r
403 //!\r
404 //! This function returns an indication of whether or not STOP got sent This\r
405 //! function checks the status of the bus via UCTXSTP bit in UCBxCTL1 register.\r
406 //!\r
407 //! \param baseAddress is the base address of the I2C Master module.\r
408 //!\r
409 //! \return One of the following:\r
410 //!         - \b EUSCI_B_I2C_STOP_SEND_COMPLETE\r
411 //!         - \b EUSCI_B_I2C_SENDING_STOP\r
412 //!         \n indicating whether the stop was sent\r
413 //\r
414 //*****************************************************************************\r
415 extern uint16_t EUSCI_B_I2C_masterIsStopSent(uint16_t baseAddress);\r
416 \r
417 //*****************************************************************************\r
418 //\r
419 //! \brief Indicates whether Start got sent.\r
420 //!\r
421 //! This function returns an indication of whether or not Start got sent This\r
422 //! function checks the status of the bus via UCTXSTT bit in UCBxCTL1 register.\r
423 //!\r
424 //! \param baseAddress is the base address of the I2C Master module.\r
425 //!\r
426 //! \return One of the following:\r
427 //!         - \b EUSCI_B_I2C_START_SEND_COMPLETE\r
428 //!         - \b EUSCI_B_I2C_SENDING_START\r
429 //!         \n indicating whether the start was sent\r
430 //\r
431 //*****************************************************************************\r
432 extern uint16_t EUSCI_B_I2C_masterIsStartSent(uint16_t baseAddress);\r
433 \r
434 //*****************************************************************************\r
435 //\r
436 //! \brief Enables individual I2C interrupt sources.\r
437 //!\r
438 //! Enables the indicated I2C interrupt sources. Only the sources that are\r
439 //! enabled can be reflected to the processor interrupt; disabled sources have\r
440 //! no effect on the processor.\r
441 //!\r
442 //! \param baseAddress is the base address of the I2C module.\r
443 //! \param mask is the bit mask of the interrupt sources to be enabled.\r
444 //!        Mask value is the logical OR of any of the following:\r
445 //!        - \b EUSCI_B_I2C_NAK_INTERRUPT - Not-acknowledge interrupt\r
446 //!        - \b EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT - Arbitration lost\r
447 //!           interrupt\r
448 //!        - \b EUSCI_B_I2C_STOP_INTERRUPT - STOP condition interrupt\r
449 //!        - \b EUSCI_B_I2C_START_INTERRUPT - START condition interrupt\r
450 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT0 - Transmit interrupt0\r
451 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT1 - Transmit interrupt1\r
452 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT2 - Transmit interrupt2\r
453 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT3 - Transmit interrupt3\r
454 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT0 - Receive interrupt0\r
455 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT1 - Receive interrupt1\r
456 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT2 - Receive interrupt2\r
457 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT3 - Receive interrupt3\r
458 //!        - \b EUSCI_B_I2C_BIT9_POSITION_INTERRUPT - Bit position 9 interrupt\r
459 //!        - \b EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT - Clock low timeout\r
460 //!           interrupt enable\r
461 //!        - \b EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT - Byte counter interrupt\r
462 //!           enable\r
463 //!\r
464 //! Modified bits of \b UCBxIE register.\r
465 //!\r
466 //! \return None\r
467 //\r
468 //*****************************************************************************\r
469 extern void EUSCI_B_I2C_enableInterrupt(uint16_t baseAddress,\r
470                                         uint16_t mask);\r
471 \r
472 //*****************************************************************************\r
473 //\r
474 //! \brief Disables individual I2C interrupt sources.\r
475 //!\r
476 //! Disables the indicated I2C interrupt sources. Only the sources that are\r
477 //! enabled can be reflected to the processor interrupt; disabled sources have\r
478 //! no effect on the processor.\r
479 //!\r
480 //! \param baseAddress is the base address of the I2C module.\r
481 //! \param mask is the bit mask of the interrupt sources to be disabled.\r
482 //!        Mask value is the logical OR of any of the following:\r
483 //!        - \b EUSCI_B_I2C_NAK_INTERRUPT - Not-acknowledge interrupt\r
484 //!        - \b EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT - Arbitration lost\r
485 //!           interrupt\r
486 //!        - \b EUSCI_B_I2C_STOP_INTERRUPT - STOP condition interrupt\r
487 //!        - \b EUSCI_B_I2C_START_INTERRUPT - START condition interrupt\r
488 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT0 - Transmit interrupt0\r
489 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT1 - Transmit interrupt1\r
490 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT2 - Transmit interrupt2\r
491 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT3 - Transmit interrupt3\r
492 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT0 - Receive interrupt0\r
493 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT1 - Receive interrupt1\r
494 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT2 - Receive interrupt2\r
495 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT3 - Receive interrupt3\r
496 //!        - \b EUSCI_B_I2C_BIT9_POSITION_INTERRUPT - Bit position 9 interrupt\r
497 //!        - \b EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT - Clock low timeout\r
498 //!           interrupt enable\r
499 //!        - \b EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT - Byte counter interrupt\r
500 //!           enable\r
501 //!\r
502 //! Modified bits of \b UCBxIE register.\r
503 //!\r
504 //! \return None\r
505 //\r
506 //*****************************************************************************\r
507 extern void EUSCI_B_I2C_disableInterrupt(uint16_t baseAddress,\r
508                                          uint16_t mask);\r
509 \r
510 //*****************************************************************************\r
511 //\r
512 //! \brief Clears I2C interrupt sources.\r
513 //!\r
514 //! The I2C interrupt source is cleared, so that it no longer asserts. The\r
515 //! highest interrupt flag is automatically cleared when an interrupt vector\r
516 //! generator is used.\r
517 //!\r
518 //! \param baseAddress is the base address of the I2C module.\r
519 //! \param mask is a bit mask of the interrupt sources to be cleared.\r
520 //!        Mask value is the logical OR of any of the following:\r
521 //!        - \b EUSCI_B_I2C_NAK_INTERRUPT - Not-acknowledge interrupt\r
522 //!        - \b EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT - Arbitration lost\r
523 //!           interrupt\r
524 //!        - \b EUSCI_B_I2C_STOP_INTERRUPT - STOP condition interrupt\r
525 //!        - \b EUSCI_B_I2C_START_INTERRUPT - START condition interrupt\r
526 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT0 - Transmit interrupt0\r
527 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT1 - Transmit interrupt1\r
528 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT2 - Transmit interrupt2\r
529 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT3 - Transmit interrupt3\r
530 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT0 - Receive interrupt0\r
531 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT1 - Receive interrupt1\r
532 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT2 - Receive interrupt2\r
533 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT3 - Receive interrupt3\r
534 //!        - \b EUSCI_B_I2C_BIT9_POSITION_INTERRUPT - Bit position 9 interrupt\r
535 //!        - \b EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT - Clock low timeout\r
536 //!           interrupt enable\r
537 //!        - \b EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT - Byte counter interrupt\r
538 //!           enable\r
539 //!\r
540 //! Modified bits of \b UCBxIFG register.\r
541 //!\r
542 //! \return None\r
543 //\r
544 //*****************************************************************************\r
545 extern void EUSCI_B_I2C_clearInterrupt(uint16_t baseAddress,\r
546                                        uint16_t mask);\r
547 \r
548 //*****************************************************************************\r
549 //\r
550 //! \brief Gets the current I2C interrupt status.\r
551 //!\r
552 //! This returns the interrupt status for the I2C module based on which flag is\r
553 //! passed.\r
554 //!\r
555 //! \param baseAddress is the base address of the I2C module.\r
556 //! \param mask is the masked interrupt flag status to be returned.\r
557 //!        Mask value is the logical OR of any of the following:\r
558 //!        - \b EUSCI_B_I2C_NAK_INTERRUPT - Not-acknowledge interrupt\r
559 //!        - \b EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT - Arbitration lost\r
560 //!           interrupt\r
561 //!        - \b EUSCI_B_I2C_STOP_INTERRUPT - STOP condition interrupt\r
562 //!        - \b EUSCI_B_I2C_START_INTERRUPT - START condition interrupt\r
563 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT0 - Transmit interrupt0\r
564 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT1 - Transmit interrupt1\r
565 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT2 - Transmit interrupt2\r
566 //!        - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT3 - Transmit interrupt3\r
567 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT0 - Receive interrupt0\r
568 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT1 - Receive interrupt1\r
569 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT2 - Receive interrupt2\r
570 //!        - \b EUSCI_B_I2C_RECEIVE_INTERRUPT3 - Receive interrupt3\r
571 //!        - \b EUSCI_B_I2C_BIT9_POSITION_INTERRUPT - Bit position 9 interrupt\r
572 //!        - \b EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT - Clock low timeout\r
573 //!           interrupt enable\r
574 //!        - \b EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT - Byte counter interrupt\r
575 //!           enable\r
576 //!\r
577 //! \return Logical OR of any of the following:\r
578 //!         - \b EUSCI_B_I2C_NAK_INTERRUPT Not-acknowledge interrupt\r
579 //!         - \b EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT Arbitration lost\r
580 //!         interrupt\r
581 //!         - \b EUSCI_B_I2C_STOP_INTERRUPT STOP condition interrupt\r
582 //!         - \b EUSCI_B_I2C_START_INTERRUPT START condition interrupt\r
583 //!         - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT0 Transmit interrupt0\r
584 //!         - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT1 Transmit interrupt1\r
585 //!         - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT2 Transmit interrupt2\r
586 //!         - \b EUSCI_B_I2C_TRANSMIT_INTERRUPT3 Transmit interrupt3\r
587 //!         - \b EUSCI_B_I2C_RECEIVE_INTERRUPT0 Receive interrupt0\r
588 //!         - \b EUSCI_B_I2C_RECEIVE_INTERRUPT1 Receive interrupt1\r
589 //!         - \b EUSCI_B_I2C_RECEIVE_INTERRUPT2 Receive interrupt2\r
590 //!         - \b EUSCI_B_I2C_RECEIVE_INTERRUPT3 Receive interrupt3\r
591 //!         - \b EUSCI_B_I2C_BIT9_POSITION_INTERRUPT Bit position 9 interrupt\r
592 //!         - \b EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT Clock low timeout\r
593 //!         interrupt enable\r
594 //!         - \b EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT Byte counter interrupt\r
595 //!         enable\r
596 //!         \n indicating the status of the masked interrupts\r
597 //\r
598 //*****************************************************************************\r
599 extern uint16_t EUSCI_B_I2C_getInterruptStatus(uint16_t baseAddress,\r
600                                                uint16_t mask);\r
601 \r
602 //*****************************************************************************\r
603 //\r
604 //! \brief Does single byte transmission from Master to Slave\r
605 //!\r
606 //! This function is used by the Master module to send a single byte. This\r
607 //! function sends a start, then transmits the byte to the slave and then sends\r
608 //! a stop.\r
609 //!\r
610 //! \param baseAddress is the base address of the I2C Master module.\r
611 //! \param txData is the data byte to be transmitted\r
612 //!\r
613 //! Modified bits of \b UCBxTXBUF register, bits of \b UCBxCTLW0 register, bits\r
614 //! of \b UCBxIE register and bits of \b UCBxIFG register.\r
615 //!\r
616 //! \return None\r
617 //\r
618 //*****************************************************************************\r
619 extern void EUSCI_B_I2C_masterSendSingleByte(uint16_t baseAddress,\r
620                                              uint8_t txData);\r
621 \r
622 //*****************************************************************************\r
623 //\r
624 //! \brief Does single byte reception from Slave\r
625 //!\r
626 //! This function is used by the Master module to receive a single byte. This\r
627 //! function sends start and stop, waits for data reception and then receives\r
628 //! the data from the slave\r
629 //!\r
630 //! \param baseAddress is the base address of the I2C Master module.\r
631 //!\r
632 //! Modified bits of \b UCBxTXBUF register, bits of \b UCBxCTLW0 register, bits\r
633 //! of \b UCBxIE register and bits of \b UCBxIFG register.\r
634 //!\r
635 //! \return STATUS_SUCCESS or STATUS_FAILURE of the transmission process.\r
636 //\r
637 //*****************************************************************************\r
638 extern uint8_t EUSCI_B_I2C_masterReceiveSingleByte(uint16_t baseAddress);\r
639 \r
640 //*****************************************************************************\r
641 //\r
642 //! \brief Does single byte transmission from Master to Slave with timeout\r
643 //!\r
644 //! This function is used by the Master module to send a single byte. This\r
645 //! function sends a start, then transmits the byte to the slave and then sends\r
646 //! a stop.\r
647 //!\r
648 //! \param baseAddress is the base address of the I2C Master module.\r
649 //! \param txData is the data byte to be transmitted\r
650 //! \param timeout is the amount of time to wait until giving up\r
651 //!\r
652 //! Modified bits of \b UCBxTXBUF register, bits of \b UCBxCTLW0 register, bits\r
653 //! of \b UCBxIE register and bits of \b UCBxIFG register.\r
654 //!\r
655 //! \return STATUS_SUCCESS or STATUS_FAILURE of the transmission process.\r
656 //\r
657 //*****************************************************************************\r
658 extern bool EUSCI_B_I2C_masterSendSingleByteWithTimeout(uint16_t baseAddress,\r
659                                                         uint8_t txData,\r
660                                                         uint32_t timeout);\r
661 \r
662 //*****************************************************************************\r
663 //\r
664 //! \brief Starts multi-byte transmission from Master to Slave\r
665 //!\r
666 //! This function is used by the master module to start a multi byte\r
667 //! transaction.\r
668 //!\r
669 //! \param baseAddress is the base address of the I2C Master module.\r
670 //! \param txData is the first data byte to be transmitted\r
671 //!\r
672 //! Modified bits of \b UCBxTXBUF register, bits of \b UCBxCTLW0 register, bits\r
673 //! of \b UCBxIE register and bits of \b UCBxIFG register.\r
674 //!\r
675 //! \return None\r
676 //\r
677 //*****************************************************************************\r
678 extern void EUSCI_B_I2C_masterSendMultiByteStart(uint16_t baseAddress,\r
679                                                  uint8_t txData);\r
680 \r
681 //*****************************************************************************\r
682 //\r
683 //! \brief Starts multi-byte transmission from Master to Slave with timeout\r
684 //!\r
685 //! This function is used by the master module to start a multi byte\r
686 //! transaction.\r
687 //!\r
688 //! \param baseAddress is the base address of the I2C Master module.\r
689 //! \param txData is the first data byte to be transmitted\r
690 //! \param timeout is the amount of time to wait until giving up\r
691 //!\r
692 //! Modified bits of \b UCBxTXBUF register, bits of \b UCBxCTLW0 register, bits\r
693 //! of \b UCBxIE register and bits of \b UCBxIFG register.\r
694 //!\r
695 //! \return STATUS_SUCCESS or STATUS_FAILURE of the transmission process.\r
696 //\r
697 //*****************************************************************************\r
698 extern bool EUSCI_B_I2C_masterSendMultiByteStartWithTimeout(\r
699     uint16_t baseAddress,\r
700     uint8_t txData,\r
701     uint32_t timeout);\r
702 \r
703 //*****************************************************************************\r
704 //\r
705 //! \brief Continues multi-byte transmission from Master to Slave\r
706 //!\r
707 //! This function is used by the Master module continue each byte of a multi-\r
708 //! byte transmission. This function transmits each data byte of a multi-byte\r
709 //! transmission to the slave.\r
710 //!\r
711 //! \param baseAddress is the base address of the I2C Master module.\r
712 //! \param txData is the next data byte to be transmitted\r
713 //!\r
714 //! Modified bits of \b UCBxTXBUF register.\r
715 //!\r
716 //! \return None\r
717 //\r
718 //*****************************************************************************\r
719 extern void EUSCI_B_I2C_masterSendMultiByteNext(uint16_t baseAddress,\r
720                                                 uint8_t txData);\r
721 \r
722 //*****************************************************************************\r
723 //\r
724 //! \brief Continues multi-byte transmission from Master to Slave with timeout\r
725 //!\r
726 //! This function is used by the Master module continue each byte of a multi-\r
727 //! byte transmission. This function transmits each data byte of a multi-byte\r
728 //! transmission to the slave.\r
729 //!\r
730 //! \param baseAddress is the base address of the I2C Master module.\r
731 //! \param txData is the next data byte to be transmitted\r
732 //! \param timeout is the amount of time to wait until giving up\r
733 //!\r
734 //! Modified bits of \b UCBxTXBUF register.\r
735 //!\r
736 //! \return STATUS_SUCCESS or STATUS_FAILURE of the transmission process.\r
737 //\r
738 //*****************************************************************************\r
739 extern bool EUSCI_B_I2C_masterSendMultiByteNextWithTimeout(uint16_t baseAddress,\r
740                                                            uint8_t txData,\r
741                                                            uint32_t timeout);\r
742 \r
743 //*****************************************************************************\r
744 //\r
745 //! \brief Finishes multi-byte transmission from Master to Slave\r
746 //!\r
747 //! This function is used by the Master module to send the last byte and STOP.\r
748 //! This function transmits the last data byte of a multi-byte transmission to\r
749 //! the slave and then sends a stop.\r
750 //!\r
751 //! \param baseAddress is the base address of the I2C Master module.\r
752 //! \param txData is the last data byte to be transmitted in a multi-byte\r
753 //!        transmission\r
754 //!\r
755 //! Modified bits of \b UCBxTXBUF register and bits of \b UCBxCTLW0 register.\r
756 //!\r
757 //! \return None\r
758 //\r
759 //*****************************************************************************\r
760 extern void EUSCI_B_I2C_masterSendMultiByteFinish(uint16_t baseAddress,\r
761                                                   uint8_t txData);\r
762 \r
763 //*****************************************************************************\r
764 //\r
765 //! \brief Finishes multi-byte transmission from Master to Slave with timeout\r
766 //!\r
767 //! This function is used by the Master module to send the last byte and STOP.\r
768 //! This function transmits the last data byte of a multi-byte transmission to\r
769 //! the slave and then sends a stop.\r
770 //!\r
771 //! \param baseAddress is the base address of the I2C Master module.\r
772 //! \param txData is the last data byte to be transmitted in a multi-byte\r
773 //!        transmission\r
774 //! \param timeout is the amount of time to wait until giving up\r
775 //!\r
776 //! Modified bits of \b UCBxTXBUF register and bits of \b UCBxCTLW0 register.\r
777 //!\r
778 //! \return STATUS_SUCCESS or STATUS_FAILURE of the transmission process.\r
779 //\r
780 //*****************************************************************************\r
781 extern bool EUSCI_B_I2C_masterSendMultiByteFinishWithTimeout(\r
782     uint16_t baseAddress,\r
783     uint8_t txData,\r
784     uint32_t timeout);\r
785 \r
786 //*****************************************************************************\r
787 //\r
788 //! \brief This function is used by the Master module to initiate START\r
789 //!\r
790 //! This function is used by the Master module to initiate START\r
791 //!\r
792 //! \param baseAddress is the base address of the I2C Master module.\r
793 //!\r
794 //! Modified bits are \b UCTXSTT of \b UCBxCTLW0 register.\r
795 //!\r
796 //! \return None\r
797 //\r
798 //*****************************************************************************\r
799 extern void EUSCI_B_I2C_masterSendStart(uint16_t baseAddress);\r
800 \r
801 //*****************************************************************************\r
802 //\r
803 //! \brief Send STOP byte at the end of a multi-byte transmission from Master\r
804 //! to Slave\r
805 //!\r
806 //! This function is used by the Master module send STOP at the end of a multi-\r
807 //! byte transmission. This function sends a stop after current transmission is\r
808 //! complete.\r
809 //!\r
810 //! \param baseAddress is the base address of the I2C Master module.\r
811 //!\r
812 //! Modified bits are \b UCTXSTP of \b UCBxCTLW0 register.\r
813 //!\r
814 //! \return None\r
815 //\r
816 //*****************************************************************************\r
817 extern void EUSCI_B_I2C_masterSendMultiByteStop(uint16_t baseAddress);\r
818 \r
819 //*****************************************************************************\r
820 //\r
821 //! \brief Send STOP byte at the end of a multi-byte transmission from Master\r
822 //! to Slave with timeout\r
823 //!\r
824 //! This function is used by the Master module send STOP at the end of a multi-\r
825 //! byte transmission. This function sends a stop after current transmission is\r
826 //! complete.\r
827 //!\r
828 //! \param baseAddress is the base address of the I2C Master module.\r
829 //! \param timeout is the amount of time to wait until giving up\r
830 //!\r
831 //! Modified bits are \b UCTXSTP of \b UCBxCTLW0 register.\r
832 //!\r
833 //! \return STATUS_SUCCESS or STATUS_FAILURE of the transmission process.\r
834 //\r
835 //*****************************************************************************\r
836 extern bool EUSCI_B_I2C_masterSendMultiByteStopWithTimeout(uint16_t baseAddress,\r
837                                                            uint32_t timeout);\r
838 \r
839 //*****************************************************************************\r
840 //\r
841 //! \brief Starts reception at the Master end\r
842 //!\r
843 //! This function is used by the Master module initiate reception of a single\r
844 //! byte. This function sends a start.\r
845 //!\r
846 //! \param baseAddress is the base address of the I2C Master module.\r
847 //!\r
848 //! Modified bits are \b UCTXSTT of \b UCBxCTLW0 register.\r
849 //!\r
850 //! \return None\r
851 //\r
852 //*****************************************************************************\r
853 extern void EUSCI_B_I2C_masterReceiveStart(uint16_t baseAddress);\r
854 \r
855 //*****************************************************************************\r
856 //\r
857 //! \brief Starts multi-byte reception at the Master end one byte at a time\r
858 //!\r
859 //! This function is used by the Master module to receive each byte of a multi-\r
860 //! byte reception. This function reads currently received byte.\r
861 //!\r
862 //! \param baseAddress is the base address of the I2C Master module.\r
863 //!\r
864 //! \return Received byte at Master end.\r
865 //\r
866 //*****************************************************************************\r
867 extern uint8_t EUSCI_B_I2C_masterReceiveMultiByteNext(uint16_t baseAddress);\r
868 \r
869 //*****************************************************************************\r
870 //\r
871 //! \brief Finishes multi-byte reception at the Master end\r
872 //!\r
873 //! This function is used by the Master module to initiate completion of a\r
874 //! multi-byte reception. This function receives the current byte and initiates\r
875 //! the STOP from master to slave.\r
876 //!\r
877 //! \param baseAddress is the base address of the I2C Master module.\r
878 //!\r
879 //! Modified bits are \b UCTXSTP of \b UCBxCTLW0 register.\r
880 //!\r
881 //! \return Received byte at Master end.\r
882 //\r
883 //*****************************************************************************\r
884 extern uint8_t EUSCI_B_I2C_masterReceiveMultiByteFinish(uint16_t baseAddress);\r
885 \r
886 //*****************************************************************************\r
887 //\r
888 //! \brief Finishes multi-byte reception at the Master end with timeout\r
889 //!\r
890 //! This function is used by the Master module to initiate completion of a\r
891 //! multi-byte reception. This function receives the current byte and initiates\r
892 //! the STOP from master to slave.\r
893 //!\r
894 //! \param baseAddress is the base address of the I2C Master module.\r
895 //! \param txData is a pointer to the location to store the received byte at\r
896 //!        master end\r
897 //! \param timeout is the amount of time to wait until giving up\r
898 //!\r
899 //! Modified bits are \b UCTXSTP of \b UCBxCTLW0 register.\r
900 //!\r
901 //! \return STATUS_SUCCESS or STATUS_FAILURE of the reception process\r
902 //\r
903 //*****************************************************************************\r
904 extern bool EUSCI_B_I2C_masterReceiveMultiByteFinishWithTimeout(\r
905     uint16_t baseAddress,\r
906     uint8_t *txData,\r
907     uint32_t timeout);\r
908 \r
909 //*****************************************************************************\r
910 //\r
911 //! \brief Sends the STOP at the end of a multi-byte reception at the Master\r
912 //! end\r
913 //!\r
914 //! This function is used by the Master module to initiate STOP\r
915 //!\r
916 //! \param baseAddress is the base address of the I2C Master module.\r
917 //!\r
918 //! Modified bits are \b UCTXSTP of \b UCBxCTLW0 register.\r
919 //!\r
920 //! \return None\r
921 //\r
922 //*****************************************************************************\r
923 extern void EUSCI_B_I2C_masterReceiveMultiByteStop(uint16_t baseAddress);\r
924 \r
925 //*****************************************************************************\r
926 //\r
927 //! \brief Enables Multi Master Mode\r
928 //!\r
929 //! At the end of this function, the I2C module is still disabled till\r
930 //! EUSCI_B_I2C_enable is invoked\r
931 //!\r
932 //! \param baseAddress is the base address of the I2C module.\r
933 //!\r
934 //! Modified bits are \b UCSWRST and \b UCMM of \b UCBxCTLW0 register.\r
935 //!\r
936 //! \return None\r
937 //\r
938 //*****************************************************************************\r
939 extern void EUSCI_B_I2C_enableMultiMasterMode(uint16_t baseAddress);\r
940 \r
941 //*****************************************************************************\r
942 //\r
943 //! \brief Disables Multi Master Mode\r
944 //!\r
945 //! At the end of this function, the I2C module is still disabled till\r
946 //! EUSCI_B_I2C_enable is invoked\r
947 //!\r
948 //! \param baseAddress is the base address of the I2C module.\r
949 //!\r
950 //! Modified bits are \b UCSWRST and \b UCMM of \b UCBxCTLW0 register.\r
951 //!\r
952 //! \return None\r
953 //\r
954 //*****************************************************************************\r
955 extern void EUSCI_B_I2C_disableMultiMasterMode(uint16_t baseAddress);\r
956 \r
957 //*****************************************************************************\r
958 //\r
959 //! \brief receives a byte that has been sent to the I2C Master Module.\r
960 //!\r
961 //! This function reads a byte of data from the I2C receive data Register.\r
962 //!\r
963 //! \param baseAddress is the base address of the I2C Master module.\r
964 //!\r
965 //! \return Returns the byte received from by the I2C module, cast as an\r
966 //!         uint8_t.\r
967 //\r
968 //*****************************************************************************\r
969 extern uint8_t EUSCI_B_I2C_masterReceiveSingle(uint16_t baseAddress);\r
970 \r
971 //*****************************************************************************\r
972 //\r
973 //! \brief Returns the address of the RX Buffer of the I2C for the DMA module.\r
974 //!\r
975 //! Returns the address of the I2C RX Buffer. This can be used in conjunction\r
976 //! with the DMA to store the received data directly to memory.\r
977 //!\r
978 //! \param baseAddress is the base address of the I2C module.\r
979 //!\r
980 //! \return The address of the I2C RX Buffer\r
981 //\r
982 //*****************************************************************************\r
983 extern uint32_t EUSCI_B_I2C_getReceiveBufferAddress(uint16_t baseAddress);\r
984 \r
985 //*****************************************************************************\r
986 //\r
987 //! \brief Returns the address of the TX Buffer of the I2C for the DMA module.\r
988 //!\r
989 //! Returns the address of the I2C TX Buffer. This can be used in conjunction\r
990 //! with the DMA to obtain transmitted data directly from memory.\r
991 //!\r
992 //! \param baseAddress is the base address of the I2C module.\r
993 //!\r
994 //! \return The address of the I2C TX Buffer\r
995 //\r
996 //*****************************************************************************\r
997 extern uint32_t EUSCI_B_I2C_getTransmitBufferAddress(uint16_t baseAddress);\r
998 \r
999 //*****************************************************************************\r
1000 //\r
1001 // Mark the end of the C bindings section for C++ compilers.\r
1002 //\r
1003 //*****************************************************************************\r
1004 #ifdef __cplusplus\r
1005 }\r
1006 #endif\r
1007 \r
1008 #endif\r
1009 #endif // __MSP430WARE_EUSCI_B_I2C_H__\r