STM32F2 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F2 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
stm32f2xx_i2c.h
Go to the documentation of this file.
1 
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F2xx_I2C_H
31 #define __STM32F2xx_I2C_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f2xx.h"
39 
48 /* Exported types ------------------------------------------------------------*/
49 
54 typedef struct
55 {
56  uint32_t I2C_ClockSpeed;
59  uint16_t I2C_Mode;
62  uint16_t I2C_DutyCycle;
65  uint16_t I2C_OwnAddress1;
68  uint16_t I2C_Ack;
71  uint16_t I2C_AcknowledgedAddress;
74 
75 /* Exported constants --------------------------------------------------------*/
76 
77 
82 #define IS_I2C_ALL_PERIPH(PERIPH) (((PERIPH) == I2C1) || \
83  ((PERIPH) == I2C2) || \
84  ((PERIPH) == I2C3))
85 
89 #define I2C_Mode_I2C ((uint16_t)0x0000)
90 #define I2C_Mode_SMBusDevice ((uint16_t)0x0002)
91 #define I2C_Mode_SMBusHost ((uint16_t)0x000A)
92 #define IS_I2C_MODE(MODE) (((MODE) == I2C_Mode_I2C) || \
93  ((MODE) == I2C_Mode_SMBusDevice) || \
94  ((MODE) == I2C_Mode_SMBusHost))
95 
103 #define I2C_DutyCycle_16_9 ((uint16_t)0x4000)
104 #define I2C_DutyCycle_2 ((uint16_t)0xBFFF)
105 #define IS_I2C_DUTY_CYCLE(CYCLE) (((CYCLE) == I2C_DutyCycle_16_9) || \
106  ((CYCLE) == I2C_DutyCycle_2))
107 
115 #define I2C_Ack_Enable ((uint16_t)0x0400)
116 #define I2C_Ack_Disable ((uint16_t)0x0000)
117 #define IS_I2C_ACK_STATE(STATE) (((STATE) == I2C_Ack_Enable) || \
118  ((STATE) == I2C_Ack_Disable))
119 
127 #define I2C_Direction_Transmitter ((uint8_t)0x00)
128 #define I2C_Direction_Receiver ((uint8_t)0x01)
129 #define IS_I2C_DIRECTION(DIRECTION) (((DIRECTION) == I2C_Direction_Transmitter) || \
130  ((DIRECTION) == I2C_Direction_Receiver))
131 
139 #define I2C_AcknowledgedAddress_7bit ((uint16_t)0x4000)
140 #define I2C_AcknowledgedAddress_10bit ((uint16_t)0xC000)
141 #define IS_I2C_ACKNOWLEDGE_ADDRESS(ADDRESS) (((ADDRESS) == I2C_AcknowledgedAddress_7bit) || \
142  ((ADDRESS) == I2C_AcknowledgedAddress_10bit))
143 
151 #define I2C_Register_CR1 ((uint8_t)0x00)
152 #define I2C_Register_CR2 ((uint8_t)0x04)
153 #define I2C_Register_OAR1 ((uint8_t)0x08)
154 #define I2C_Register_OAR2 ((uint8_t)0x0C)
155 #define I2C_Register_DR ((uint8_t)0x10)
156 #define I2C_Register_SR1 ((uint8_t)0x14)
157 #define I2C_Register_SR2 ((uint8_t)0x18)
158 #define I2C_Register_CCR ((uint8_t)0x1C)
159 #define I2C_Register_TRISE ((uint8_t)0x20)
160 #define IS_I2C_REGISTER(REGISTER) (((REGISTER) == I2C_Register_CR1) || \
161  ((REGISTER) == I2C_Register_CR2) || \
162  ((REGISTER) == I2C_Register_OAR1) || \
163  ((REGISTER) == I2C_Register_OAR2) || \
164  ((REGISTER) == I2C_Register_DR) || \
165  ((REGISTER) == I2C_Register_SR1) || \
166  ((REGISTER) == I2C_Register_SR2) || \
167  ((REGISTER) == I2C_Register_CCR) || \
168  ((REGISTER) == I2C_Register_TRISE))
169 
177 #define I2C_NACKPosition_Next ((uint16_t)0x0800)
178 #define I2C_NACKPosition_Current ((uint16_t)0xF7FF)
179 #define IS_I2C_NACK_POSITION(POSITION) (((POSITION) == I2C_NACKPosition_Next) || \
180  ((POSITION) == I2C_NACKPosition_Current))
181 
189 #define I2C_SMBusAlert_Low ((uint16_t)0x2000)
190 #define I2C_SMBusAlert_High ((uint16_t)0xDFFF)
191 #define IS_I2C_SMBUS_ALERT(ALERT) (((ALERT) == I2C_SMBusAlert_Low) || \
192  ((ALERT) == I2C_SMBusAlert_High))
193 
201 #define I2C_PECPosition_Next ((uint16_t)0x0800)
202 #define I2C_PECPosition_Current ((uint16_t)0xF7FF)
203 #define IS_I2C_PEC_POSITION(POSITION) (((POSITION) == I2C_PECPosition_Next) || \
204  ((POSITION) == I2C_PECPosition_Current))
205 
213 #define I2C_IT_BUF ((uint16_t)0x0400)
214 #define I2C_IT_EVT ((uint16_t)0x0200)
215 #define I2C_IT_ERR ((uint16_t)0x0100)
216 #define IS_I2C_CONFIG_IT(IT) ((((IT) & (uint16_t)0xF8FF) == 0x00) && ((IT) != 0x00))
217 
225 #define I2C_IT_SMBALERT ((uint32_t)0x01008000)
226 #define I2C_IT_TIMEOUT ((uint32_t)0x01004000)
227 #define I2C_IT_PECERR ((uint32_t)0x01001000)
228 #define I2C_IT_OVR ((uint32_t)0x01000800)
229 #define I2C_IT_AF ((uint32_t)0x01000400)
230 #define I2C_IT_ARLO ((uint32_t)0x01000200)
231 #define I2C_IT_BERR ((uint32_t)0x01000100)
232 #define I2C_IT_TXE ((uint32_t)0x06000080)
233 #define I2C_IT_RXNE ((uint32_t)0x06000040)
234 #define I2C_IT_STOPF ((uint32_t)0x02000010)
235 #define I2C_IT_ADD10 ((uint32_t)0x02000008)
236 #define I2C_IT_BTF ((uint32_t)0x02000004)
237 #define I2C_IT_ADDR ((uint32_t)0x02000002)
238 #define I2C_IT_SB ((uint32_t)0x02000001)
239 
240 #define IS_I2C_CLEAR_IT(IT) ((((IT) & (uint16_t)0x20FF) == 0x00) && ((IT) != (uint16_t)0x00))
241 
242 #define IS_I2C_GET_IT(IT) (((IT) == I2C_IT_SMBALERT) || ((IT) == I2C_IT_TIMEOUT) || \
243  ((IT) == I2C_IT_PECERR) || ((IT) == I2C_IT_OVR) || \
244  ((IT) == I2C_IT_AF) || ((IT) == I2C_IT_ARLO) || \
245  ((IT) == I2C_IT_BERR) || ((IT) == I2C_IT_TXE) || \
246  ((IT) == I2C_IT_RXNE) || ((IT) == I2C_IT_STOPF) || \
247  ((IT) == I2C_IT_ADD10) || ((IT) == I2C_IT_BTF) || \
248  ((IT) == I2C_IT_ADDR) || ((IT) == I2C_IT_SB))
249 
261 #define I2C_FLAG_DUALF ((uint32_t)0x00800000)
262 #define I2C_FLAG_SMBHOST ((uint32_t)0x00400000)
263 #define I2C_FLAG_SMBDEFAULT ((uint32_t)0x00200000)
264 #define I2C_FLAG_GENCALL ((uint32_t)0x00100000)
265 #define I2C_FLAG_TRA ((uint32_t)0x00040000)
266 #define I2C_FLAG_BUSY ((uint32_t)0x00020000)
267 #define I2C_FLAG_MSL ((uint32_t)0x00010000)
268 
273 #define I2C_FLAG_SMBALERT ((uint32_t)0x10008000)
274 #define I2C_FLAG_TIMEOUT ((uint32_t)0x10004000)
275 #define I2C_FLAG_PECERR ((uint32_t)0x10001000)
276 #define I2C_FLAG_OVR ((uint32_t)0x10000800)
277 #define I2C_FLAG_AF ((uint32_t)0x10000400)
278 #define I2C_FLAG_ARLO ((uint32_t)0x10000200)
279 #define I2C_FLAG_BERR ((uint32_t)0x10000100)
280 #define I2C_FLAG_TXE ((uint32_t)0x10000080)
281 #define I2C_FLAG_RXNE ((uint32_t)0x10000040)
282 #define I2C_FLAG_STOPF ((uint32_t)0x10000010)
283 #define I2C_FLAG_ADD10 ((uint32_t)0x10000008)
284 #define I2C_FLAG_BTF ((uint32_t)0x10000004)
285 #define I2C_FLAG_ADDR ((uint32_t)0x10000002)
286 #define I2C_FLAG_SB ((uint32_t)0x10000001)
287 
288 #define IS_I2C_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0x20FF) == 0x00) && ((FLAG) != (uint16_t)0x00))
289 
290 #define IS_I2C_GET_FLAG(FLAG) (((FLAG) == I2C_FLAG_DUALF) || ((FLAG) == I2C_FLAG_SMBHOST) || \
291  ((FLAG) == I2C_FLAG_SMBDEFAULT) || ((FLAG) == I2C_FLAG_GENCALL) || \
292  ((FLAG) == I2C_FLAG_TRA) || ((FLAG) == I2C_FLAG_BUSY) || \
293  ((FLAG) == I2C_FLAG_MSL) || ((FLAG) == I2C_FLAG_SMBALERT) || \
294  ((FLAG) == I2C_FLAG_TIMEOUT) || ((FLAG) == I2C_FLAG_PECERR) || \
295  ((FLAG) == I2C_FLAG_OVR) || ((FLAG) == I2C_FLAG_AF) || \
296  ((FLAG) == I2C_FLAG_ARLO) || ((FLAG) == I2C_FLAG_BERR) || \
297  ((FLAG) == I2C_FLAG_TXE) || ((FLAG) == I2C_FLAG_RXNE) || \
298  ((FLAG) == I2C_FLAG_STOPF) || ((FLAG) == I2C_FLAG_ADD10) || \
299  ((FLAG) == I2C_FLAG_BTF) || ((FLAG) == I2C_FLAG_ADDR) || \
300  ((FLAG) == I2C_FLAG_SB))
301 
323 /* --EV5 */
324 #define I2C_EVENT_MASTER_MODE_SELECT ((uint32_t)0x00030001) /* BUSY, MSL and SB flag */
325 
351 /* --EV6 */
352 #define I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED ((uint32_t)0x00070082) /* BUSY, MSL, ADDR, TXE and TRA flags */
353 #define I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED ((uint32_t)0x00030002) /* BUSY, MSL and ADDR flags */
354 /* --EV9 */
355 #define I2C_EVENT_MASTER_MODE_ADDRESS10 ((uint32_t)0x00030008) /* BUSY, MSL and ADD10 flags */
356 
386 /* Master RECEIVER mode -----------------------------*/
387 /* --EV7 */
388 #define I2C_EVENT_MASTER_BYTE_RECEIVED ((uint32_t)0x00030040) /* BUSY, MSL and RXNE flags */
389 
390 /* Master TRANSMITTER mode --------------------------*/
391 /* --EV8 */
392 #define I2C_EVENT_MASTER_BYTE_TRANSMITTING ((uint32_t)0x00070080) /* TRA, BUSY, MSL, TXE flags */
393 /* --EV8_2 */
394 #define I2C_EVENT_MASTER_BYTE_TRANSMITTED ((uint32_t)0x00070084) /* TRA, BUSY, MSL, TXE and BTF flags */
395 
396 
429 /* --EV1 (all the events below are variants of EV1) */
430 /* 1) Case of One Single Address managed by the slave */
431 #define I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED ((uint32_t)0x00020002) /* BUSY and ADDR flags */
432 #define I2C_EVENT_SLAVE_TRANSMITTER_ADDRESS_MATCHED ((uint32_t)0x00060082) /* TRA, BUSY, TXE and ADDR flags */
433 
434 /* 2) Case of Dual address managed by the slave */
435 #define I2C_EVENT_SLAVE_RECEIVER_SECONDADDRESS_MATCHED ((uint32_t)0x00820000) /* DUALF and BUSY flags */
436 #define I2C_EVENT_SLAVE_TRANSMITTER_SECONDADDRESS_MATCHED ((uint32_t)0x00860080) /* DUALF, TRA, BUSY and TXE flags */
437 
438 /* 3) Case of General Call enabled for the slave */
439 #define I2C_EVENT_SLAVE_GENERALCALLADDRESS_MATCHED ((uint32_t)0x00120000) /* GENCALL and BUSY flags */
440 
468 /* Slave RECEIVER mode --------------------------*/
469 /* --EV2 */
470 #define I2C_EVENT_SLAVE_BYTE_RECEIVED ((uint32_t)0x00020040) /* BUSY and RXNE flags */
471 /* --EV4 */
472 #define I2C_EVENT_SLAVE_STOP_DETECTED ((uint32_t)0x00000010) /* STOPF flag */
473 
474 /* Slave TRANSMITTER mode -----------------------*/
475 /* --EV3 */
476 #define I2C_EVENT_SLAVE_BYTE_TRANSMITTED ((uint32_t)0x00060084) /* TRA, BUSY, TXE and BTF flags */
477 #define I2C_EVENT_SLAVE_BYTE_TRANSMITTING ((uint32_t)0x00060080) /* TRA, BUSY and TXE flags */
478 /* --EV3_2 */
479 #define I2C_EVENT_SLAVE_ACK_FAILURE ((uint32_t)0x00000400) /* AF flag */
480 
481 /*
482  ===============================================================================
483  End of Events Description
484  ===============================================================================
485  */
486 
487 #define IS_I2C_EVENT(EVENT) (((EVENT) == I2C_EVENT_SLAVE_TRANSMITTER_ADDRESS_MATCHED) || \
488  ((EVENT) == I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED) || \
489  ((EVENT) == I2C_EVENT_SLAVE_TRANSMITTER_SECONDADDRESS_MATCHED) || \
490  ((EVENT) == I2C_EVENT_SLAVE_RECEIVER_SECONDADDRESS_MATCHED) || \
491  ((EVENT) == I2C_EVENT_SLAVE_GENERALCALLADDRESS_MATCHED) || \
492  ((EVENT) == I2C_EVENT_SLAVE_BYTE_RECEIVED) || \
493  ((EVENT) == (I2C_EVENT_SLAVE_BYTE_RECEIVED | I2C_FLAG_DUALF)) || \
494  ((EVENT) == (I2C_EVENT_SLAVE_BYTE_RECEIVED | I2C_FLAG_GENCALL)) || \
495  ((EVENT) == I2C_EVENT_SLAVE_BYTE_TRANSMITTED) || \
496  ((EVENT) == (I2C_EVENT_SLAVE_BYTE_TRANSMITTED | I2C_FLAG_DUALF)) || \
497  ((EVENT) == (I2C_EVENT_SLAVE_BYTE_TRANSMITTED | I2C_FLAG_GENCALL)) || \
498  ((EVENT) == I2C_EVENT_SLAVE_STOP_DETECTED) || \
499  ((EVENT) == I2C_EVENT_MASTER_MODE_SELECT) || \
500  ((EVENT) == I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED) || \
501  ((EVENT) == I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED) || \
502  ((EVENT) == I2C_EVENT_MASTER_BYTE_RECEIVED) || \
503  ((EVENT) == I2C_EVENT_MASTER_BYTE_TRANSMITTED) || \
504  ((EVENT) == I2C_EVENT_MASTER_BYTE_TRANSMITTING) || \
505  ((EVENT) == I2C_EVENT_MASTER_MODE_ADDRESS10) || \
506  ((EVENT) == I2C_EVENT_SLAVE_ACK_FAILURE))
507 
515 #define IS_I2C_OWN_ADDRESS1(ADDRESS1) ((ADDRESS1) <= 0x3FF)
516 
524 #define IS_I2C_CLOCK_SPEED(SPEED) (((SPEED) >= 0x1) && ((SPEED) <= 400000))
525 
533 /* Exported macro ------------------------------------------------------------*/
534 /* Exported functions --------------------------------------------------------*/
535 
536 /* Function used to set the I2C configuration to the default reset state *****/
537 void I2C_DeInit(I2C_TypeDef* I2Cx);
538 
539 /* Initialization and Configuration functions *********************************/
540 void I2C_Init(I2C_TypeDef* I2Cx, I2C_InitTypeDef* I2C_InitStruct);
541 void I2C_StructInit(I2C_InitTypeDef* I2C_InitStruct);
542 void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
543 void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState);
544 void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState);
545 void I2C_Send7bitAddress(I2C_TypeDef* I2Cx, uint8_t Address, uint8_t I2C_Direction);
546 void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState);
547 void I2C_OwnAddress2Config(I2C_TypeDef* I2Cx, uint8_t Address);
548 void I2C_DualAddressCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
549 void I2C_GeneralCallCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
550 void I2C_SoftwareResetCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
551 void I2C_StretchClockCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
552 void I2C_FastModeDutyCycleConfig(I2C_TypeDef* I2Cx, uint16_t I2C_DutyCycle);
553 void I2C_NACKPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_NACKPosition);
554 void I2C_SMBusAlertConfig(I2C_TypeDef* I2Cx, uint16_t I2C_SMBusAlert);
555 void I2C_ARPCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
556 
557 /* Data transfers functions ***************************************************/
558 void I2C_SendData(I2C_TypeDef* I2Cx, uint8_t Data);
559 uint8_t I2C_ReceiveData(I2C_TypeDef* I2Cx);
560 
561 /* PEC management functions ***************************************************/
562 void I2C_TransmitPEC(I2C_TypeDef* I2Cx, FunctionalState NewState);
563 void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_PECPosition);
564 void I2C_CalculatePEC(I2C_TypeDef* I2Cx, FunctionalState NewState);
565 uint8_t I2C_GetPEC(I2C_TypeDef* I2Cx);
566 
567 /* DMA transfers management functions *****************************************/
568 void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
569 void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
570 
571 /* Interrupts, events and flags management functions **************************/
572 uint16_t I2C_ReadRegister(I2C_TypeDef* I2Cx, uint8_t I2C_Register);
573 void I2C_ITConfig(I2C_TypeDef* I2Cx, uint16_t I2C_IT, FunctionalState NewState);
574 
575 /*
576  ===============================================================================
577  I2C State Monitoring Functions
578  ===============================================================================
579  This I2C driver provides three different ways for I2C state monitoring
580  depending on the application requirements and constraints:
581 
582 
583  1. Basic state monitoring (Using I2C_CheckEvent() function)
584  -----------------------------------------------------------
585  It compares the status registers (SR1 and SR2) content to a given event
586  (can be the combination of one or more flags).
587  It returns SUCCESS if the current status includes the given flags
588  and returns ERROR if one or more flags are missing in the current status.
589 
590  - When to use
591  - This function is suitable for most applications as well as for startup
592  activity since the events are fully described in the product reference
593  manual (RM0033).
594  - It is also suitable for users who need to define their own events.
595 
596  - Limitations
597  - If an error occurs (ie. error flags are set besides to the monitored
598  flags), the I2C_CheckEvent() function may return SUCCESS despite
599  the communication hold or corrupted real state.
600  In this case, it is advised to use error interrupts to monitor
601  the error events and handle them in the interrupt IRQ handler.
602 
603  Note
604  For error management, it is advised to use the following functions:
605  - I2C_ITConfig() to configure and enable the error interrupts (I2C_IT_ERR).
606  - I2Cx_ER_IRQHandler() which is called when the error interrupt occurs.
607  Where x is the peripheral instance (I2C1, I2C2 ...)
608  - I2C_GetFlagStatus() or I2C_GetITStatus() to be called into the
609  I2Cx_ER_IRQHandler() function in order to determine which error occurred.
610  - I2C_ClearFlag() or I2C_ClearITPendingBit() and/or I2C_SoftwareResetCmd()
611  and/or I2C_GenerateStop() in order to clear the error flag and source
612  and return to correct communication status.
613 
614 
615  2. Advanced state monitoring (Using the function I2C_GetLastEvent())
616  --------------------------------------------------------------------
617  Using the function I2C_GetLastEvent() which returns the image of both status
618  registers in a single word (uint32_t) (Status Register 2 value is shifted left
619  by 16 bits and concatenated to Status Register 1).
620 
621  - When to use
622  - This function is suitable for the same applications above but it
623  allows to overcome the mentioned limitation of I2C_GetFlagStatus()
624  function.
625  - The returned value could be compared to events already defined in
626  this file or to custom values defined by user.
627  This function is suitable when multiple flags are monitored at the
628  same time.
629  - At the opposite of I2C_CheckEvent() function, this function allows
630  user to choose when an event is accepted (when all events flags are
631  set and no other flags are set or just when the needed flags are set
632  like I2C_CheckEvent() function.
633 
634  - Limitations
635  - User may need to define his own events.
636  - Same remark concerning the error management is applicable for this
637  function if user decides to check only regular communication flags
638  (and ignores error flags).
639 
640 
641  3. Flag-based state monitoring (Using the function I2C_GetFlagStatus())
642  -----------------------------------------------------------------------
643 
644  Using the function I2C_GetFlagStatus() which simply returns the status of
645  one single flag (ie. I2C_FLAG_RXNE ...).
646 
647  - When to use
648  - This function could be used for specific applications or in debug
649  phase.
650  - It is suitable when only one flag checking is needed (most I2C
651  events are monitored through multiple flags).
652  - Limitations:
653  - When calling this function, the Status register is accessed.
654  Some flags are cleared when the status register is accessed.
655  So checking the status of one Flag, may clear other ones.
656  - Function may need to be called twice or more in order to monitor
657  one single event.
658  */
659 
660 /*
661  ===============================================================================
662  1. Basic state monitoring
663  ===============================================================================
664  */
665 ErrorStatus I2C_CheckEvent(I2C_TypeDef* I2Cx, uint32_t I2C_EVENT);
666 /*
667  ===============================================================================
668  2. Advanced state monitoring
669  ===============================================================================
670  */
671 uint32_t I2C_GetLastEvent(I2C_TypeDef* I2Cx);
672 /*
673  ===============================================================================
674  3. Flag-based state monitoring
675  ===============================================================================
676  */
677 FlagStatus I2C_GetFlagStatus(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG);
678 
679 
680 void I2C_ClearFlag(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG);
681 ITStatus I2C_GetITStatus(I2C_TypeDef* I2Cx, uint32_t I2C_IT);
682 void I2C_ClearITPendingBit(I2C_TypeDef* I2Cx, uint32_t I2C_IT);
683 
684 #ifdef __cplusplus
685 }
686 #endif
687 
688 #endif /*__STM32F2xx_I2C_H */
689 
698 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/