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

Copyright 2015, Texas Instruments Incorporated