1 /* -----------------------------------------------------------------------------
2 * Copyright (c) 2013-2014 ARM Limited. All rights reserved.
4 * $Date: 2. January 2014
7 * Project: I2C Driver API
8 * -------------------------------------------------------------------------- */
12 \defgroup i2c_interface_gr I2C Interface
13 \brief Driver API for I2C Bus Peripheral (%Driver_I2C.h)
16 I<sup>2</sup>C (Inter-Integrated Circuit, referred to as I-squared-C, I-two-C, or IIC) is a multi-master serial single-ended bus and is mostly used
17 on single boards, but can also connect to components which are linked via cable.
19 Most significant features of the I<sup>2</sup>C bus include:
20 - Only two bus lines are required
21 - I<sup>2</sup>C is a true multi-master bus. Simple master/slave relationships exist between all components
22 - A baud rate is not required; the master device determines a bus clock
23 - Each connected device is addressable by a unique address
24 - Providing arbitration and collision detection
26 For more information about I<sup>2</sup>C refer to the following web pages:
27 - Wikipedia: <a href="http://en.wikipedia.org/wiki/I%C2%B2C" target="_blank">I<sup>2</sup>C</a>
28 - <a href="http://www.i2c-bus.org" target="_blank">www.i2c-bus.org</a>.
30 Devices can operation in Master or Slave mode:
32 - To operate in Master mode call the functions \ref ARM_I2C_MasterTransmit or \ref ARM_I2C_MasterReceive. These functions get as argument a <em>slave address</em>.
34 - To operate in Slave mode set the <em>slave address</em> using the function \ref ARM_I2C_Control. The functions \ref ARM_I2C_SlaveTransmit or \ref ARM_I2C_SlaveReceive are used to transfer data in Slave mode.
36 **I<sup>2</sup>C Slave Address**
38 Depending on the device, I<sup>2</sup>C supports 7-bit and 10-bit Slaves addresses.
39 The element <em>address_10_bit</em> in \ref ARM_I2C_CAPABILITIES indicates that the driver is able to handle 10-bit addresses.
40 A 10-bit Slave address is ORed with \ref ARM_I2C_ADDRESS_10BIT.
42 I<sup>2</sup>C also supports a General Call to all Slaves by using the slave address value \token{0}.
43 A General Call is recognized by Slaves have a slave address value \ref ARM_I2C_ADDRESS_GC registered with the
44 function \ref ARM_I2C_Control.
48 The I2C driver allows you to connect low-speed peripherals to a motherboard, embedded system, cellphone, or other electronic device.
50 \image html I2C_BlockDiagram.png "Master/Slave connected via I2C interface"
53 **I<sup>2</sup>C API**
55 The following header files define the Application Programming Interface (API) for the I<sup>2</sup>C interface:
56 - \b %Driver_I2C.h : Driver API for I2C Bus Peripheral
58 The driver implementation is a typical part of the Device Family Pack (DFP) that supports the
59 peripherals of the microcontroller family.
64 The driver functions are published in the access struct as explained in \ref DriverFunctions
65 - \ref ARM_DRIVER_I2C : access struct for I2C driver functions
68 \anchor example **Example Code**
70 The following example code shows the usage of the I<sup>2</sup>C interface in Master mode.
75 The following example code shows the usage of the I<sup>2</sup>C interface in Slave mode.
77 Add: Code example that shows usage of slave mode.
86 \struct ARM_DRIVER_I2C
88 The functions of the I2C interface are accessed by function pointers exposed by this structure. Refer to \ref DriverFunctions for
91 Each instance of an I2C provides such an access structure. The instance is indicated by
92 a postfix in the symbol name of the access structure, for example:
93 - \b Driver_I2C0 is the name of the access struct of the first instance (no. 0).
94 - \b Driver_I2C1 is the name of the access struct of the second instance (no. 1).
97 A configuration setting in the middleware allows connecting the middleware to a specific driver instance <b>%Driver_I2C<i>n</i></b>.
98 The default is \token{0}, which connects a middleware to the first instance of a driver.
99 *******************************************************************************************************************/
102 \struct ARM_I2C_CAPABILITIES
104 An I2C driver can be implemented with different capabilities.
105 The data fields of this struct encode the capabilities implemented by this driver.
107 The element \em address_10_bit indicates that the driver is able to handle 10-bit addressing natively.
108 User can still emulate the 10-bit addressing in software if the driver does not support it.
111 - \ref ARM_I2C_GetCapabilities
112 *******************************************************************************************************************/
115 \struct ARM_I2C_STATUS
117 Structure with information about the status of the I2C.
119 The flag \em busy indicates that the driver is busy executing Master/Slave Transmit/Receive operation.
122 - when Master operation starts: after calling \ref ARM_I2C_MasterTransmit or \ref ARM_I2C_MasterReceive
123 - when Slave operation starts: after calling \ref ARM_I2C_SlaveTransmit or \ref ARM_I2C_SlaveReceive and after being addressed by a Master as the Slave
125 It is cleared when Master/Slave operation has finished.
127 The flag \em mode indicates the current mode which is Master when Master Transmit/Receive is active or Slave otherwise.
129 The flag \em direction indicates either Transmitter or Receiver mode. It is updated during Master/Slave operation when the Slave is addressed by a Master.
131 The flag \em general_call indicates a General call (address \token{0}) when in Slave mode.
133 The flag \em arbitration_lost indicates that the Master has lost arbitration. The current Master operation is aborted.
135 The flag \em bus_error indicates that a bus error has been detected. The current Master/Slave operation is aborted.
138 - \ref ARM_I2C_GetStatus
139 *******************************************************************************************************************/
142 \typedef ARM_I2C_SignalEvent_t
144 Provides the typedef for the callback function \ref ARM_I2C_SignalEvent.
146 <b>Parameter for:</b>
147 - \ref ARM_I2C_Initialize
148 *******************************************************************************************************************/
151 \defgroup I2C_events I2C Events
152 \ingroup i2c_interface_gr
153 \brief The I2C driver generates call back events that are notified via the function \ref ARM_I2C_SignalEvent.
155 This section provides the event values for the \ref ARM_I2C_SignalEvent callback function.
157 The following call back notification events are generated:
159 \def ARM_I2C_EVENT_TRANSFER_DONE
160 \def ARM_I2C_EVENT_TRANSFER_INCOMPLETE
161 \def ARM_I2C_EVENT_SLAVE_TRANSMIT
162 \def ARM_I2C_EVENT_SLAVE_RECEIVE
163 \def ARM_I2C_EVENT_ADDRESS_NACK
164 \def ARM_I2C_EVENT_GENERAL_CALL
165 \def ARM_I2C_EVENT_ARBITRATION_LOST
166 \def ARM_I2C_EVENT_BUS_ERROR
167 \def ARM_I2C_EVENT_BUS_CLEAR
176 ARM_DRIVER_VERSION ARM_I2C_GetVersion (void) {
180 \fn ARM_DRIVER_VERSION ARM_I2C_GetVersion (void)
182 The function \b ARM_I2C_GetVersion returns version information of the driver implementation in \ref ARM_DRIVER_VERSION
183 - API version is the version of the CMSIS-Driver specification used to implement this driver.
184 - Driver version is source code version of the actual driver implementation.
188 extern ARM_DRIVER_I2C Driver_I2C0;
189 ARM_DRIVER_I2C *drv_info;
191 void setup_i2c (void) {
192 ARM_DRIVER_VERSION version;
194 drv_info = &Driver_I2C0;
195 version = drv_info->GetVersion ();
196 if (version.api < 0x10A) { // requires at minimum API version 1.10 or higher
202 *******************************************************************************************************************/
204 ARM_I2C_CAPABILITIES ARM_I2C_GetCapabilities (void) {
208 \fn ARM_I2C_CAPABILITIES ARM_I2C_GetCapabilities (void)
210 The function \b ARM_I2C_GetCapabilities returns information about capabilities of this driver implementation.
211 The data fields of the struct \ref ARM_I2C_CAPABILITIES encodes the driver capabilities.
215 extern ARM_DRIVER_I2C Driver_I2C0;
216 ARM_DRIVER_I2C *drv_info;
218 void read_capabilities (void) {
219 ARM_I2C_CAPABILITIES drv_capabilities;
221 drv_info = &Driver_I2C0;
222 drv_capabilities = drv_info->GetCapabilities ();
223 // interrogate capabilities
227 *******************************************************************************************************************/
229 int32_t ARM_I2C_Initialize (ARM_I2C_SignalEvent_t cb_event) {
230 return ARM_DRIVER_OK;
233 \fn int32_t ARM_I2C_Initialize (ARM_I2C_SignalEvent_t cb_event)
235 The function \b ARM_I2C_Initialize initializes the I2C interface.
236 It is called when the middleware component starts operation.
238 The function performs the following operations:
239 - Initializes and the I/O resources for the I2C interface.
240 - Registers the \ref ARM_I2C_SignalEvent callback function.
242 The parameter \em cb_event is a pointer to the \ref ARM_I2C_SignalEvent callback function.
243 Use a NULL pointer when no callback events are required.
245 Can be called multiple times. If the peripheral is already initialized the function performs no operation and
246 returns with \ref ARM_DRIVER_OK. Refer to \ref CallSequence for more information.
248 \sa ARM_I2C_PowerControl
249 \sa ARM_I2C_Uninitialize
252 - refer to \ref example "Example Code"
254 *******************************************************************************************************************/
256 int32_t ARM_I2C_Uninitialize (void) {
257 return ARM_DRIVER_OK;
260 \fn int32_t ARM_I2C_Uninitialize (void)
262 The function \b ARM_I2C_Uninitialize releases the I/O resources of I2C interface.
264 It is called when the middleware component stops operation and releases the I/O resources used by the I2C interface.
265 Refer to \ref CallSequence for more information.
267 \sa ARM_I2C_Initialize
268 \sa ARM_I2C_PowerControl
270 *******************************************************************************************************************/
272 int32_t ARM_I2C_PowerControl (ARM_POWER_STATE state) {
273 return ARM_DRIVER_OK;
276 \fn int32_t ARM_I2C_PowerControl (ARM_POWER_STATE state)
278 The function \b ARM_I2C_PowerControl operates the power modes of the I2C interface.
280 The parameter \em state can have the following values:
281 - \ref ARM_POWER_FULL : set-up peripheral for data transfers, enable interrupts (NVIC) and optionally DMA.
282 Can be called multiple times. If the peripheral is already in this mode,
283 then the function performs no operation and returns with \ref ARM_DRIVER_OK.
284 - \ref ARM_POWER_LOW : may use power saving. Returns \ref ARM_DRIVER_ERROR_UNSUPPORTED when not implemented.
285 - \ref ARM_POWER_OFF : terminates any pending data transfers, disables peripheral, disables related interrupts and DMA.
287 Refer to \ref CallSequence for more information.
289 \sa ARM_I2C_Initialize
290 \sa ARM_I2C_Uninitialize
292 *******************************************************************************************************************/
294 int32_t ARM_I2C_MasterTransmit (uint32_t addr, const uint8_t *data, uint32_t num, bool xfer_pending) {
295 return ARM_DRIVER_OK;
298 \fn int32_t ARM_I2C_MasterTransmit (uint32_t addr, const uint8_t *data, uint32_t num, bool xfer_pending)
300 This function \b ARM_I2C_MasterTransmit transmits data as Master to the selected Slave.
302 The operation consists of:
303 - Master generates START condition
304 - Master addresses the Slave as Master Transmitter
305 - Master transmits data to the addressed Slave
306 - Master generates STOP condition (if \em xfer_pending is "false")
308 The parameter \em addr is the address of the slave to transmit the data to. The value can be ORed with \ref ARM_I2C_ADDRESS_10BIT to
309 identify a 10-bit address value. \n
310 The parameter \em data and \em num specify the address of a data buffer and the number of bytes to transmit. \n
311 Set the parameter \em xfer_pending to 'true' if another transfer operation follows. With \em xfer_pending set to 'false' a STOP condition is generated.
313 The function is non-blocking and returns as soon as the driver has started the operation.
314 During the operation it is not allowed to call any Master function again. Also the data buffer must stay allocated and the contents of data must not be modified.
315 When transmit operation has finished the \ref ARM_I2C_EVENT_TRANSFER_DONE event is generated.
316 When not all the data is transferred then the \ref ARM_I2C_EVENT_TRANSFER_INCOMPLETE flag is set at the same time.
318 Number of data bytes transmitted and acknowledged is returned by the function \ref ARM_I2C_GetDataCount during and after the operation has finished.
320 The operation is aborted in the following cases (\ref ARM_I2C_EVENT_TRANSFER_DONE event is generated together with):
321 - selected slave has not acknowledged the address: \ref ARM_I2C_EVENT_ADDRESS_NACK event
322 - arbitration has been lost: \ref ARM_I2C_EVENT_ARBITRATION_LOST event
323 - bus error has been detected: \ref ARM_I2C_EVENT_BUS_ERROR event
325 Status can be monitored by calling the \ref ARM_I2C_GetStatus and checking the flags.
327 Transmit operation can be aborted also by calling \ref ARM_I2C_Control with the parameter \em control \ref ARM_I2C_ABORT_TRANSFER.
328 *******************************************************************************************************************/
330 int32_t ARM_I2C_MasterReceive (uint32_t addr, uint8_t *data, uint32_t num, bool xfer_pending) {
331 return ARM_DRIVER_OK;
334 \fn int32_t ARM_I2C_MasterReceive (uint32_t addr, uint8_t *data, uint32_t num, bool xfer_pending)
336 This function \b ARM_I2C_MasterReceive is used to receive data as Master from the selected Slave.
338 The operation consists of:
339 - Master generates START condition
340 - Master addresses the Slave as Master Receiver
341 - Master receives data from the addressed Slave
342 - Master generates STOP condition (if \em xfer_pending is "false")
344 The parameter \em addr is the address of the slave to receive the data from. The value can be ORed with \ref ARM_I2C_ADDRESS_10BIT to
345 identify a 10-bit address value. \n
346 The parameter \em data and \em num specify the address of a data buffer and the number of bytes to receive. \n
347 Set the parameter \em xfer_pending to 'true' if another transfer operation follows. With \em xfer_pending set to 'false' a STOP condition is generated.
349 The function is non-blocking and returns as soon as the driver has started the operation.
350 During the operation it is not allowed to call any Master function again. Also the data buffer must stay allocated.
351 When receive operation has finished the \ref ARM_I2C_EVENT_TRANSFER_DONE event is generated.
352 When not all the data is transferred then the \ref ARM_I2C_EVENT_TRANSFER_INCOMPLETE flag is set at the same time.
354 Number of data bytes received is returned by the function \ref ARM_I2C_GetDataCount during and after the operation has finished.
356 The operation is aborted in the following cases (\ref ARM_I2C_EVENT_TRANSFER_DONE event is generated together with):
357 - selected slave has not acknowledged the address: \ref ARM_I2C_EVENT_ADDRESS_NACK event
358 - arbitration has been lost: \ref ARM_I2C_EVENT_ARBITRATION_LOST event
359 - bus error has been detected: \ref ARM_I2C_EVENT_BUS_ERROR event
361 Status can be monitored by calling the \ref ARM_I2C_GetStatus and checking the flags.
363 Receive operation can be aborted also by calling \ref ARM_I2C_Control with the parameter \em control = \ref ARM_I2C_ABORT_TRANSFER.
364 *******************************************************************************************************************/
366 int32_t ARM_I2C_SlaveTransmit (const uint8_t *data, uint32_t num) {
367 return ARM_DRIVER_OK;
370 \fn int32_t ARM_I2C_SlaveTransmit (const uint8_t *data, uint32_t num)
372 This function \b ARM_I2C_SlaveTransmit is used to transmit data as Slave to the Master.
374 The parameter \em data is a pointer to the data to transmit. \n
375 The parameter \em num specifies the number of bytes to transmit.
377 The function is non-blocking and returns as soon as the driver has registered the operation.
378 The actual operation will start after being addressed by the master as a Slave Transmitter. If the operation has not been registered at that point the \ref ARM_I2C_EVENT_SLAVE_TRANSMIT event is generated.
379 The same event is also generated if the operation has finished (specified number of bytes transmitted) but more data is requested by the master.
381 It is not allowed to call this function again if the operation has started until it finishes. Also the data buffer must stay allocated and the contents of data must not be modified.
382 When transmit operation has finished the \ref ARM_I2C_EVENT_TRANSFER_DONE event is generated.
383 When not all the data is transferred then the \ref ARM_I2C_EVENT_TRANSFER_INCOMPLETE flag is set at the same time.
385 Number of data bytes transmitted is returned by the function \ref ARM_I2C_GetDataCount during and after the operation has finished.
387 In case that a General call has been detected the \ref ARM_I2C_EVENT_GENERAL_CALL flag is indicated together with the \ref ARM_I2C_EVENT_TRANSFER_DONE event (also with \ref ARM_I2C_EVENT_SLAVE_TRANSMIT event).
389 In case that bus error has been detected then the operation is aborted and the \ref ARM_I2C_EVENT_BUS_ERROR event is generated together with \ref ARM_I2C_EVENT_TRANSFER_DONE.
391 Slave will only respond to its own address (or General call if enabled) that is specified by calling \ref ARM_I2C_Control with \ref ARM_I2C_OWN_ADDRESS as control parameter.
392 Using address \token{0} disables the slave.
394 Status can be monitored by calling the \ref ARM_I2C_GetStatus and checking the flags.
396 Transmit operation can be canceled or aborted by calling \ref ARM_I2C_Control with the parameter \em control = \ref ARM_I2C_ABORT_TRANSFER.
397 *******************************************************************************************************************/
399 int32_t ARM_I2C_SlaveReceive (uint8_t *data, uint32_t num) {
400 return ARM_DRIVER_OK;
403 \fn int32_t ARM_I2C_SlaveReceive (uint8_t *data, uint32_t num)
405 This function \b ARM_I2C_SlaveReceive receives data as Slave from the Master.
407 The parameter \em data is a pointer to the data to receive. \n
408 The parameter \em num specifies the number of bytes to receive.
410 The function is non-blocking and returns as soon as the driver has registered the operation.
411 The actual operation will start after being addressed by the master as a Slave Receiver. If the operation has not been registered at that point the \ref ARM_I2C_EVENT_SLAVE_RECEIVE event is generated.
413 It is not allowed to call this function again if the operation has started until it finishes. Also the data buffer must stay allocated.
414 When receive operation has finished the \ref ARM_I2C_EVENT_TRANSFER_DONE event is generated.
415 When not all the data is transferred then the \ref ARM_I2C_EVENT_TRANSFER_INCOMPLETE flag is set at the same time.
417 Number of data bytes received and acknowledged is returned by the function \ref ARM_I2C_GetDataCount during and after the operation has finished.
419 In case that a General call has been detected the \ref ARM_I2C_EVENT_GENERAL_CALL flag is indicated together with the \ref ARM_I2C_EVENT_TRANSFER_DONE event (also with \ref ARM_I2C_EVENT_SLAVE_RECEIVE event).
421 In case that bus error has been detected then the operation is aborted and the \ref ARM_I2C_EVENT_BUS_ERROR event is generated together with \ref ARM_I2C_EVENT_TRANSFER_DONE.
423 Slave will only respond to its own address (or General call if enabled) that is specified by calling \ref ARM_I2C_Control with \ref ARM_I2C_OWN_ADDRESS as control parameter.
424 Using address \token{0} disables the slave.
426 Status can be monitored by calling the \ref ARM_I2C_GetStatus and checking the flags.
428 Receive operation can be canceled or aborted by calling \ref ARM_I2C_Control with the parameter \em control = \ref ARM_I2C_ABORT_TRANSFER.
429 *******************************************************************************************************************/
431 int32_t ARM_I2C_GetDataCount (void) {
435 \fn int32_t ARM_I2C_GetDataCount (void)
437 The function \b ARM_I2C_GetDataCount returns the number of currently transferred data bytes during and after:
438 - \ref ARM_I2C_MasterTransmit : number of data bytes transmitted and acknowledged
439 - \ref ARM_I2C_MasterReceive : number of data bytes received
440 - \ref ARM_I2C_SlaveTransmit : number of data bytes transmitted
441 - \ref ARM_I2C_SlaveReceive : number of data bytes received and acknowledged
443 When the Slave is not yet addressed by the Master then \token{-1} is returned.
444 *****************************************************************************************************************/
446 int32_t ARM_I2C_Control (uint32_t control, uint32_t arg) {
447 return ARM_DRIVER_OK;
450 \fn int32_t ARM_I2C_Control (uint32_t control, uint32_t arg)
452 The function \b ARM_I2C_Control operates the I2C interface and executes various operations.
454 The parameter \em control specifies various operations as listed in the table below. \n
455 The parameter \em arg provides, depending on the operation, additional information. \n
457 Parameter \em control | Operation
458 :--------------------------------|:--------------------------------------------
459 \ref ARM_I2C_OWN_ADDRESS | Set Own Slave Address; \em arg = slave address
460 \ref ARM_I2C_BUS_SPEED | Set Bus Speed; \em arg = bus speed
461 \ref ARM_I2C_BUS_CLEAR | Clear the bus by sending nine clock pulses
462 \ref ARM_I2C_ABORT_TRANSFER | Aborts the data transfer between Master and Slave for Transmit or Receive
464 <b>Set Own Slave Address</b>
466 After initialization, the I2C Device has no slave address assigned and does not accept any requests from
469 The \em control operation \ref ARM_I2C_OWN_ADDRESS sets the slave address with the parameter \em arg.
470 The slave address can be ORed with \ref ARM_I2C_ADDRESS_10BIT to indicate a 10-bit address.
472 The slave address can be ORed with \ref ARM_I2C_ADDRESS_GC to indicate that the slave accepts a General Call.
473 If the slave address value is only \ref ARM_I2C_ADDRESS_GC, then the slave only accepts a General Call.
475 The slave address value \token{0} disables Slave mode and clears any assigned slave address.
479 Set the Slave address value \token{0x45} as 7-bit address.
481 I2Cdrv->Control (ARM_I2C_OWN_ADDRESS, 0x45);
484 Set the Slave address value \token{0x135} as 10-bit address and accept a General Call.
486 I2Cdrv->Control (ARM_I2C_OWN_ADDRESS, 0x135 | ARM_I2C_ADDRESS_10BIT | ARM_I2C_ADDRESS_GC);
491 The \em control operation \ref ARM_I2C_BUS_SPEED sets the bus speed using the parameter \em arg.
493 Parameter \em arg | Bus Speed
494 :--------------------------------|:--------------------------------------------
495 \ref ARM_I2C_BUS_SPEED_STANDARD | Standard Speed to (\token{100 kHz})
496 \ref ARM_I2C_BUS_SPEED_FAST | Fast Speed (\token{400kHz})
497 \ref ARM_I2C_BUS_SPEED_FAST_PLUS | Fast + Speed (\token{1MHz})
498 \ref ARM_I2C_BUS_SPEED_HIGH | High Speed (\token{3.4MHz})
503 I2Cdrv->Control (ARM_I2C_BUS_SPEED, I2C_BUS_SPEED_FAST);
505 *****************************************************************************************************************/
507 ARM_I2C_STATUS ARM_I2C_GetStatus (void) {
511 \fn ARM_I2C_STATUS ARM_I2C_GetStatus (void)
513 The function \b ARM_I2C_GetStatus returns the current I2C interface status.
515 Refer to \ref ARM_I2C_STATUS for details.
516 *****************************************************************************************************************/
518 void ARM_I2C_SignalEvent (uint32_t event) {
522 \fn void ARM_I2C_SignalEvent (uint32_t event)
524 The function \b ARM_I2C_SignalEvent is a callback function registered by the function \ref ARM_I2C_Initialize..
525 It is called by the I2C driver to notify the application about \ref I2C_events occured during operation.
527 The parameter \a event indicates one or more events that occurred during driver operation.
528 Each event is encoded in a separate bit and therefore it is possible to signal multiple events within the same call.
530 The following events can be generated:
532 Parameter \em event | Bit | Description
533 :---------------------------------------- |:---------:|:----------------------------------------------------------
534 \ref ARM_I2C_EVENT_TRANSFER_DONE | 1UL << 0 | Occurs after Master/Slave Transmit/Receive operation has finished.
535 \ref ARM_I2C_EVENT_TRANSFER_INCOMPLETE | 1UL << 1 | Occurs together with \ref ARM_I2C_EVENT_TRANSFER_DONE when less data is transferred then requested.
536 \ref ARM_I2C_EVENT_SLAVE_TRANSMIT | 1UL << 2 | Occurs when addressed as Slave Transmitter and \ref ARM_I2C_SlaveTransmit has not been started.
537 \ref ARM_I2C_EVENT_SLAVE_RECEIVE | 1UL << 3 | Occurs when addressed as Slave Receiver and \ref ARM_I2C_SlaveReceive has not been started.
538 \ref ARM_I2C_EVENT_ADDRESS_NACK | 1UL << 4 | Occurs in master mode when address is not acknowledged from slave.
539 \ref ARM_I2C_EVENT_GENERAL_CALL | 1UL << 5 | Indicates General Call in slave mode together with \ref ARM_I2C_EVENT_TRANSFER_DONE, \ref ARM_I2C_EVENT_SLAVE_TRANSMIT and \ref ARM_I2C_EVENT_SLAVE_RECEIVE.
540 \ref ARM_I2C_EVENT_ARBITRATION_LOST | 1UL << 6 | Occurs in master mode when arbitration is lost.
541 \ref ARM_I2C_EVENT_BUS_ERROR | 1UL << 7 | Occurs when bus error is detected.
542 \ref ARM_I2C_EVENT_BUS_CLEAR | 1UL << 8 | Occurs after \ref ARM_I2C_BUS_CLEAR Control operation has finished.
544 **************************************************************************************************************************/
548 \defgroup i2c_control_gr I2C Control Codes
549 \ingroup i2c_interface_gr
550 \brief Many parameters of the I2C driver are configured using the \ref ARM_I2C_Control function.
553 The various I2C control codes define:
554 - \ref i2c_control_codes specify operation parameters and various controls
555 - \ref i2c_bus_speed_ctrls specify the I2C bus speed
557 Refer to the \ref ARM_I2C_Control function for further details.
561 \defgroup i2c_control_codes I2C Control Codes
562 \ingroup i2c_control_gr
563 \brief Specify operation parameters and various controls.
566 \def ARM_I2C_OWN_ADDRESS
568 \def ARM_I2C_BUS_SPEED
569 Speed is specified using the following values: \ref i2c_bus_speed_ctrls
571 \def ARM_I2C_BUS_CLEAR
573 \def ARM_I2C_ABORT_TRANSFER
579 \defgroup i2c_bus_speed_ctrls I2C Bus Speed
580 \ingroup i2c_control_gr
581 \brief Specify the I2C bus speed.
584 \def ARM_I2C_BUS_SPEED_STANDARD
586 \def ARM_I2C_BUS_SPEED_FAST
588 \def ARM_I2C_BUS_SPEED_FAST_PLUS
590 \def ARM_I2C_BUS_SPEED_HIGH
599 \defgroup i2c_address_flags I2C Address Flags
600 \ingroup i2c_interface_gr
601 \brief Specify address flags
603 Specifies the address type for the functions \ref ARM_I2C_MasterReceive, \ref ARM_I2C_MasterTransmit and \ref ARM_I2C_OWN_ADDRESS.
605 \def ARM_I2C_ADDRESS_10BIT
606 \sa ARM_I2C_OWN_ADDRESS
607 \sa ARM_I2C_MasterTransmit
608 \sa ARM_I2C_MasterReceive
609 \def ARM_I2C_ADDRESS_GC
610 \sa ARM_I2C_OWN_ADDRESS