AM261x MCU+ SDK  26.00.00
i2c_lld.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
54 #ifndef I2C_LLD_H_
55 #define I2C_LLD_H_
56 
57 /* ========================================================================== */
58 /* Include Files */
59 /* ========================================================================== */
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 #include <stdint.h>
66 #include <stdbool.h>
67 #include <stdlib.h>
68 #include <stddef.h>
69 #include <drivers/i2c/v1/cslr_i2c.h>
70 #include <drivers/hw_include/hw_types.h>
71 #include <drivers/hw_include/cslr_i2c.h>
72 
73 /* ========================================================================== */
74 /* Macros & Typedefs */
75 /* ========================================================================== */
76 
84 #define I2C_STS_SUCCESS ((int32_t) 0)
85 
87 #define I2C_STS_ERR ((int32_t)-1)
88 
90 #define I2C_STS_ERR_TIMEOUT ((int32_t)-2)
91 
92 #define I2C_STS_ERR_INVALID_PARAM ((int32_t)-3)
93 
94 #define I2C_STS_ERR_BUS_BUSY ((int32_t)-4)
95 
97 #define I2C_STS_ERR_NO_ACK ((int32_t)-5)
98 
100 #define I2C_STS_ERR_ARBITRATION_LOST ((int32_t)-6)
101 
102 #define I2C_STS_RESTART ((int32_t)-7)
103 
114 #define I2C_NO_WAIT ((uint32_t)0)
115 
117 #define I2C_WAIT_FOREVER ((uint32_t)-1)
118 
127 #define I2C_STATE_RESET ((uint8_t) 0U)
128 
130 #define I2C_STATE_IDLE ((uint8_t) 1U)
131 
133 #define I2C_STATE_BUSY ((uint8_t) 2U)
134 
136 #define I2C_STATE_ERROR ((uint8_t) 3U)
137 
148 #define I2C_100KHZ ((uint8_t) 0U)
149 
150 #define I2C_400KHZ ((uint8_t) 1U)
151 
161 #define I2C_MEM_ADDR_SIZE_8_BITS ((uint8_t) 1U)
162 
163 #define I2C_MEM_ADDR_SIZE_16_BITS ((uint8_t) 2U)
164 
174 #define I2C_WRITE_STATE ((uint8_t) 10U)
175 
176 #define I2C_READ_STATE ((uint8_t) 11U)
177 
178 #define I2C_TARGET_XFER_STATE ((uint8_t) 12U)
179 
180 #define I2C_TARGET_RESTART_STATE ((uint8_t) 13U)
181 
190 #define I2C_CFG_MASK_TX (CSL_I2C_ICMDR_TRX_MASK)
191 #define I2C_CFG_MASK_RX (CSL_I2C_ICMDR_TRX_MASK)
192 #define I2C_CFG_MASK_STOP (CSL_I2C_ICMDR_STP_MASK)
193 #define I2C_CFG_MASK_START (CSL_I2C_ICMDR_STT_MASK)
194 #define I2C_CFG_MASK_RUN_FREE (CSL_I2C_ICMDR_FREE_MASK)
195 #define I2C_CFG_MASK_REPEAT_MODE (CSL_I2C_ICMDR_RM_MASK)
196 #define I2C_CFG_MASK_LOOP_BACK (CSL_I2C_ICMDR_DLB_MASK)
197 #define I2C_CFG_MASK_XA (CSL_I2C_ICMDR_XA_MASK)
198 
199 #define I2C_CFG_CMD_TX (CSL_I2C_ICMDR_TRX_MASK)
200 #define I2C_CFG_CMD_RX (0U)
201 #define I2C_CFG_CMD_STOP (CSL_I2C_ICMDR_STP_MASK)
202 #define I2C_CFG_CMD_START (CSL_I2C_ICMDR_STT_MASK)
203 #define I2C_CFG_CMD_RUN_FREE_ON (CSL_I2C_ICMDR_FREE_MASK)
204 #define I2C_CFG_CMD_RUN_FREE_OFF (0U)
205 #define I2C_CFG_CMD_REPEAT_MODE_ON (CSL_I2C_ICMDR_RM_MASK)
206 #define I2C_CFG_CMD_REPEAT_MODE_OFF (0U)
207 #define I2C_CFG_CMD_LOOP_BACK_ON (CSL_I2C_ICMDR_DLB_MASK)
208 #define I2C_CFG_CMD_LOOP_BACK_OFF (0U)
209 #define I2C_CFG_CMD_10BIT_ADDRESS (I2C_CFG_MASK_XA)
210 #define I2C_CFG_CMD_7BIT_ADDRESS (0U)
211 
221 #define I2C_INT_ARBITRATION_LOST (CSL_I2C_ICSTR_AL_MASK)
222 #define I2C_INT_NO_ACK (CSL_I2C_ICSTR_NACK_MASK)
223 #define I2C_INT_ADRR_READY_ACESS (CSL_I2C_ICSTR_ARDY_MASK)
224 #define I2C_INT_RECV_READY (CSL_I2C_ICSTR_ICRRDY_MASK)
225 #define I2C_INT_TRANSMIT_READY (CSL_I2C_ICSTR_ICXRDY_MASK)
226 #define I2C_INT_STOP_CONDITION (CSL_I2C_ICSTR_SCD_MASK)
227 #define I2C_INT_ADRR_ZERO (CSL_I2C_ICSTR_AD0_MASK)
228 #define I2C_INT_ADRR_TARGET (CSL_I2C_ICSTR_AAS_MASK)
229 #define I2C_INT_TRANSMIT_UNDER_FLOW (CSL_I2C_ICSTR_XSMT_MASK)
230 #define I2C_INT_RECV_OVER_RUN (CSL_I2C_ICSTR_RSFULL_MASK)
231 #define I2C_INT_BUS_BUSY (CSL_I2C_ICSTR_BB_MASK)
232 #define I2C_INT_NO_ACK_SENT (CSL_I2C_ICSTR_NACKSNT_MASK)
233 #define I2C_INT_TARGET_DIRECTION (CSL_I2C_ICSTR_SDIR_MASK)
234 
235 #define I2C_ALL_INTS ( I2C_INT_ARBITRATION_LOST | \
236  I2C_INT_NO_ACK | \
237  I2C_INT_ADRR_READY_ACESS | \
238  I2C_INT_RECV_READY | \
239  I2C_INT_TRANSMIT_READY | \
240  I2C_INT_STOP_CONDITION | \
241  I2C_INT_ADRR_ZERO | \
242  I2C_INT_ADRR_TARGET | \
243  I2C_INT_TRANSMIT_UNDER_FLOW | \
244  I2C_INT_RECV_OVER_RUN | \
245  I2C_INT_BUS_BUSY | \
246  I2C_INT_NO_ACK_SENT | \
247  I2C_INT_TARGET_DIRECTION \
248  )
249 
250 #define I2C_INT_MASK_ARBITRATION_LOST (CSL_I2C_ICIMR_AL_MASK)
251 #define I2C_INT_MASK_NO_ACK (CSL_I2C_ICIMR_NACK_MASK)
252 #define I2C_INT_MASK_ADRR_READY_ACESS (CSL_I2C_ICIMR_ARDY_MASK)
253 #define I2C_INT_MASK_RECV_READY (CSL_I2C_ICIMR_ICRRDY_MASK)
254 #define I2C_INT_MASK_TRANSMIT_READY (CSL_I2C_ICIMR_ICXRDY_MASK)
255 #define I2C_INT_MASK_STOP_CONDITION (CSL_I2C_ICIMR_SCD_MASK)
256 #define I2C_INT_MASK_ADRR_TARGET (CSL_I2C_ICIMR_AAS_MASK)
257 
258 #define I2C_ALL_INTS_MASK ( I2C_INT_MASK_ARBITRATION_LOST | \
259  I2C_INT_MASK_NO_ACK | \
260  I2C_INT_MASK_ADRR_READY_ACESS | \
261  I2C_INT_MASK_RECV_READY | \
262  I2C_INT_MASK_TRANSMIT_READY | \
263  I2C_INT_MASK_STOP_CONDITION | \
264  I2C_INT_MASK_ADRR_TARGET \
265  )
266 
269 /* ========================================================================== */
270 /* Structure Declarations */
271 /* ========================================================================== */
272 
283 typedef struct {
284 
286  uint8_t *writeBuf;
288  uint32_t writeCount;
290  uint8_t *readBuf;
292  uint32_t readCount;
293 
295 
305 typedef struct {
306 
310  uint32_t txnCount;
315  uint32_t targetAddress;
317  void *arg;
319  uint32_t timeout;
324  bool expandSA;
325 
327 
332 typedef struct {
333 
334  uint32_t deviceAddress;
336  uint8_t *buffer;
338  uint32_t size;
340  bool expandSA;
345 
350 typedef struct {
351 
354  uint32_t memAddr;
356  uint8_t memAddrSize;
360 
361 
378 typedef struct {
379 
381  uint8_t *writeBuf;
383  uint32_t writeCount;
385  uint8_t *readBuf;
387  uint32_t readCount;
389  uint32_t timeout;
392  bool expandSA;
393 
395 
396 /* ========================================================================== */
397 /* Function pointers Declarations */
398 /* ========================================================================== */
399 
407 typedef uint32_t (*I2C_Clock_getTicks) (void);
408 
418 typedef uint32_t (*I2C_Clock_usecToTicks) (uint64_t usecs);
419 
427 typedef void (*I2C_Clock_uSleep) (uint32_t usec);
428 
437 typedef void (*I2C_lld_transferCompleteCallback) (void *args,
438  const I2CLLD_Message *msg,
439  int32_t transferStatus);
440 
451  const I2CLLD_targetTransaction * targetTxn,
452  int32_t transferStatus);
453 
454 /* ========================================================================== */
455 /* Structure Declarations */
456 /* ========================================================================== */
457 
461 typedef struct {
462 
468  uint32_t baseAddr;
470  uint32_t intrNum;
472  uint8_t bitRate;
474  uint32_t funcClk;
476  uint32_t ownTargetAddr;
487 
493  uint8_t state;
495  uint32_t intStatusErr;
496 
506  uint8_t *writeBufIdx;
508  uint32_t writeCountIdx;
510  uint8_t *readBufIdx;
512  uint32_t readCountIdx;
514  uint32_t startTicks;
516  uint32_t currentTxnCount;
522  uint8_t *dataArray;
524  uint8_t addBuff[2];
526  uint8_t memAddrSize;
533  void* args;
534 
536 
537 /* ========================================================================== */
538 /* Function Declarations */
539 /* ========================================================================== */
540 
548 int32_t I2C_lld_init(I2CLLD_Handle handle);
549 
558 
567 
576 
589  I2C_ExtendedParams *extendedParams,
590  uint32_t timeout);
591 
604  I2C_ExtendedParams *extendedParams,
605  uint32_t timeout);
606 
617  I2C_ExtendedParams *extendedParams);
618 
629  I2C_ExtendedParams *extendedParams);
630 
643  I2C_ExtendedParams *extendedParams,
644  uint32_t timeout);
645 
658  I2C_ExtendedParams *extendedParams,
659  uint32_t timeout);
660 
671  I2C_ExtendedParams *extendedParams);
672 
683  I2C_ExtendedParams *extendedParams);
684 
697  I2C_Memory_ExtendedParams * mem_extendedParams,
698  uint32_t timeout);
699 
710  I2C_Memory_ExtendedParams * mem_extendedParams);
711 
724  I2C_Memory_ExtendedParams * mem_extendedParams,
725  uint32_t timeout);
726 
737  I2C_Memory_ExtendedParams * mem_extendedParams);
738 
750 
762 
775 
784 int32_t I2C_lld_probe(I2CLLD_Handle handle, uint32_t targetAddr);
785 
794 int32_t I2C_lld_setBusFrequency(I2CLLD_Handle handle, uint32_t busFrequency);
795 
796 /* ========================================================================== */
797 /* ISR Function Declarations */
798 /* ========================================================================== */
799 
807 
815 
816 /* ========================================================================== */
817 /* Low-level hardware function declarations */
818 /* ========================================================================== */
819 
820 void I2CControllerControl(uint32_t baseAddr, uint32_t ctrlMask, uint32_t ctrlCmds);
821 void I2CSetDataCount(uint32_t baseAddr, uint32_t count);
822 void I2CControllerStart(uint32_t baseAddr);
823 void I2CControllerIntEnableEx(uint32_t baseAddr, uint32_t intFlag);
824 void I2CControllerTargetAddrSet(uint32_t baseAddr, uint32_t targetAddr);
825 void I2CControllerIntClearEx(uint32_t baseAddr, uint32_t intFlag);
826 void I2CModeControl(uint32_t baseAddr, uint32_t ctrlMask, uint32_t ctrlCmds);
827 void I2CTargetEnable(uint32_t baseAddr);
828 
829 #ifdef __cplusplus
830 }
831 #endif
832 
833 #endif /* I2C_LLD_H_ */
834 
I2CLLD_Object::Clock_getTicks
I2C_Clock_getTicks Clock_getTicks
Definition: i2c_lld.h:478
I2C_lld_target_readIntr
int32_t I2C_lld_target_readIntr(I2CLLD_Handle handle, I2C_ExtendedParams *extendedParams)
API to initiate an I2C read operation in interrupt mode as I2C Target.
I2CControllerStart
void I2CControllerStart(uint32_t baseAddr)
I2CTargetEnable
void I2CTargetEnable(uint32_t baseAddr)
args
void * args
Definition: hsmclient_msg.h:4
I2CLLD_Object::startTicks
uint32_t startTicks
Definition: i2c_lld.h:514
I2CLLD_Message::txn
I2CLLD_Transaction * txn
Definition: i2c_lld.h:308
I2CLLD_Transaction::readCount
uint32_t readCount
Definition: i2c_lld.h:292
I2C_lld_Transaction_init
int32_t I2C_lld_Transaction_init(I2CLLD_Transaction *transaction)
API to set default values of I2CLLD_Transaction in transaction.
I2CLLD_Object::currentTargetTransaction
I2CLLD_targetTransaction * currentTargetTransaction
Definition: i2c_lld.h:504
I2CControllerControl
void I2CControllerControl(uint32_t baseAddr, uint32_t ctrlMask, uint32_t ctrlCmds)
I2CLLD_Object::writeCountIdx
uint32_t writeCountIdx
Definition: i2c_lld.h:508
I2CLLD_targetTransaction::writeBuf
uint8_t * writeBuf
Definition: i2c_lld.h:381
I2CLLD_Object::writeBufIdx
uint8_t * writeBufIdx
Definition: i2c_lld.h:506
I2CLLD_targetTransaction::writeCount
uint32_t writeCount
Definition: i2c_lld.h:383
I2C_lld_Message_init
int32_t I2C_lld_Message_init(I2CLLD_Message *msg)
API to set default values of I2CLLD_Message in msg.
I2CLLD_targetTransaction::readCount
uint32_t readCount
Definition: i2c_lld.h:387
I2CControllerTargetAddrSet
void I2CControllerTargetAddrSet(uint32_t baseAddr, uint32_t targetAddr)
I2CLLD_Message::targetAddress
uint32_t targetAddress
Definition: i2c_lld.h:315
I2C_lld_targetTransferCompleteCallback
void(* I2C_lld_targetTransferCompleteCallback)(void *args, const I2CLLD_targetTransaction *targetTxn, int32_t transferStatus)
The definition of a transfer completion callback function used by the I2C driver when used in Target ...
Definition: i2c_lld.h:450
I2C_lld_write
int32_t I2C_lld_write(I2CLLD_Handle handle, I2C_ExtendedParams *extendedParams, uint32_t timeout)
API to initiate an I2C write operation in polled mode as I2C Controller.
I2CLLD_Object::funcClk
uint32_t funcClk
Definition: i2c_lld.h:474
I2CModeControl
void I2CModeControl(uint32_t baseAddr, uint32_t ctrlMask, uint32_t ctrlCmds)
I2CLLD_Message
I2C Message.
Definition: i2c_lld.h:305
I2CLLD_Object::Clock_uSleep
I2C_Clock_uSleep Clock_uSleep
Definition: i2c_lld.h:482
I2CControllerIntEnableEx
void I2CControllerIntEnableEx(uint32_t baseAddr, uint32_t intFlag)
I2C_Memory_ExtendedParams::memAddr
uint32_t memAddr
Definition: i2c_lld.h:354
I2CLLD_Message::arg
void * arg
Definition: i2c_lld.h:317
I2CLLD_targetTransaction::readBuf
uint8_t * readBuf
Definition: i2c_lld.h:385
I2C_lld_read
int32_t I2C_lld_read(I2CLLD_Handle handle, I2C_ExtendedParams *extendedParams, uint32_t timeout)
API to initiate an I2C read operation in polled mode as I2C Controller.
I2C_lld_target_writeIntr
int32_t I2C_lld_target_writeIntr(I2CLLD_Handle handle, I2C_ExtendedParams *extendedParams)
API to Initiate an I2C write operation in interrupt mode as I2C Target.
I2CLLD_Transaction::writeBuf
uint8_t * writeBuf
Definition: i2c_lld.h:286
I2C_lld_transferCompleteCallback
void(* I2C_lld_transferCompleteCallback)(void *args, const I2CLLD_Message *msg, int32_t transferStatus)
The definition of a transfer completion callback function used by the I2C driver when used in Control...
Definition: i2c_lld.h:437
I2CLLD_Transaction::readBuf
uint8_t * readBuf
Definition: i2c_lld.h:290
I2CLLD_Message::timeout
uint32_t timeout
Definition: i2c_lld.h:319
I2CLLD_Object::i2ctxn
I2CLLD_Transaction i2ctxn
Definition: i2c_lld.h:520
I2CLLD_Object::ownTargetAddr
uint32_t ownTargetAddr
Definition: i2c_lld.h:476
I2CLLD_Message::expandSA
bool expandSA
Definition: i2c_lld.h:324
I2C_lld_readIntr
int32_t I2C_lld_readIntr(I2CLLD_Handle handle, I2C_ExtendedParams *extendedParams)
API to initiate an I2C read operation in interrupt mode as I2C Controller.
I2C_ExtendedParams::expandSA
bool expandSA
Definition: i2c_lld.h:340
I2CLLD_Object::currentMsg
I2CLLD_Message * currentMsg
Definition: i2c_lld.h:502
I2CLLD_Transaction
I2C Transaction.
Definition: i2c_lld.h:283
I2C_ExtendedParams::buffer
uint8_t * buffer
Definition: i2c_lld.h:336
I2C_lld_mem_read
int32_t I2C_lld_mem_read(I2CLLD_Handle handle, I2C_Memory_ExtendedParams *mem_extendedParams, uint32_t timeout)
API to initiate a Memory read operation in Polled mode.
I2C_lld_mem_write
int32_t I2C_lld_mem_write(I2CLLD_Handle handle, I2C_Memory_ExtendedParams *mem_extendedParams, uint32_t timeout)
API to initiate a Memory write Operation in polling Mode.
I2CLLD_targetTransaction::timeout
uint32_t timeout
Definition: i2c_lld.h:389
I2CLLD_Object::dataArray
uint8_t * dataArray
Definition: i2c_lld.h:522
I2CLLD_Object::intrNum
uint32_t intrNum
Definition: i2c_lld.h:470
I2CControllerIntClearEx
void I2CControllerIntClearEx(uint32_t baseAddr, uint32_t intFlag)
I2CLLD_Object::baseAddr
uint32_t baseAddr
Definition: i2c_lld.h:468
I2C_lld_transferIntr
int32_t I2C_lld_transferIntr(I2CLLD_Handle handle, I2CLLD_Message *msg)
API to initiate a transfer from I2C in interrupt mode.
I2CLLD_targetTransaction::expandSA
bool expandSA
Definition: i2c_lld.h:392
I2C_lld_targetIsr
void I2C_lld_targetIsr(void *args)
I2C Target ISR, can be used as IRQ handler in Target mode.
I2CLLD_Message::txnCount
uint32_t txnCount
Definition: i2c_lld.h:310
I2C_lld_transferPoll
int32_t I2C_lld_transferPoll(I2CLLD_Handle handle, I2CLLD_Message *msg)
API to initiate a transfer from I2C in polled mode.
I2CLLD_Object::readCountIdx
uint32_t readCountIdx
Definition: i2c_lld.h:512
I2C_lld_init
int32_t I2C_lld_init(I2CLLD_Handle handle)
API to Initializes the I2C instance.
I2CLLD_Object::transferCompleteCallback
I2C_lld_transferCompleteCallback transferCompleteCallback
Definition: i2c_lld.h:484
I2C_Memory_ExtendedParams::extendedParams
I2C_ExtendedParams extendedParams
Definition: i2c_lld.h:352
I2CLLD_Transaction::writeCount
uint32_t writeCount
Definition: i2c_lld.h:288
I2C_Clock_getTicks
uint32_t(* I2C_Clock_getTicks)(void)
The definition of a get System Tick function used by the I2C driver to keep track of time.
Definition: i2c_lld.h:407
I2CLLD_Object::memTxnActive
bool memTxnActive
Definition: i2c_lld.h:529
I2CLLD_Object::memAddrSize
uint8_t memAddrSize
Definition: i2c_lld.h:526
I2CLLD_Message::controllerMode
bool controllerMode
Definition: i2c_lld.h:321
I2C_Clock_usecToTicks
uint32_t(* I2C_Clock_usecToTicks)(uint64_t usecs)
The definition of a micro seconds to ticks function used by the I2C driver to get ticks from microsec...
Definition: i2c_lld.h:418
I2C_Memory_ExtendedParams
Data structure used with I2C_lld_mem_write(), I2C_lld_mem_writeIntr(), I2C_lld_mem_read(),...
Definition: i2c_lld.h:350
I2C_ExtendedParams::deviceAddress
uint32_t deviceAddress
Definition: i2c_lld.h:334
I2C_lld_writeIntr
int32_t I2C_lld_writeIntr(I2CLLD_Handle handle, I2C_ExtendedParams *extendedParams)
API to initiate an I2C write operation in interrupt mode as I2C Controller.
I2C_Clock_uSleep
void(* I2C_Clock_uSleep)(uint32_t usec)
The definition of a sleep function used by the I2C driver for delay.
Definition: i2c_lld.h:427
I2CLLD_Object::intStatusErr
uint32_t intStatusErr
Definition: i2c_lld.h:495
I2C_ExtendedParams
Data structure used with I2C_lld_write(), I2C_lld_writeIntr(), I2C_lld_read(), I2C_lld_readIntr()
Definition: i2c_lld.h:332
I2CSetDataCount
void I2CSetDataCount(uint32_t baseAddr, uint32_t count)
I2C_lld_mem_readIntr
int32_t I2C_lld_mem_readIntr(I2CLLD_Handle handle, I2C_Memory_ExtendedParams *mem_extendedParams)
API to initiate a Memory read operation in interrupt mode.
I2CLLD_Object::readBufIdx
uint8_t * readBufIdx
Definition: i2c_lld.h:510
I2CLLD_Object::bitRate
uint8_t bitRate
Definition: i2c_lld.h:472
I2C_lld_probe
int32_t I2C_lld_probe(I2CLLD_Handle handle, uint32_t targetAddr)
API to probe I2C.
I2C_lld_setBusFrequency
int32_t I2C_lld_setBusFrequency(I2CLLD_Handle handle, uint32_t busFrequency)
API to set the bus frequency.
I2C_lld_mem_writeIntr
int32_t I2C_lld_mem_writeIntr(I2CLLD_Handle handle, I2C_Memory_ExtendedParams *mem_extendedParams)
API to initiate a Memory write operation in interrupt Mode.
I2C_lld_controllerIsr
void I2C_lld_controllerIsr(void *args)
I2C Controller ISR, can be used as IRQ handler in Controller mode.
I2CLLD_Object::targetTransferCompleteCallback
I2C_lld_targetTransferCompleteCallback targetTransferCompleteCallback
Definition: i2c_lld.h:486
I2C_lld_deInit
int32_t I2C_lld_deInit(I2CLLD_Handle handle)
API to De-Initializes the I2C instance.
I2CLLD_Object::state
uint8_t state
Definition: i2c_lld.h:493
I2C_ExtendedParams::size
uint32_t size
Definition: i2c_lld.h:338
I2CLLD_Object::i2cTargetTransaction
I2CLLD_targetTransaction i2cTargetTransaction
Definition: i2c_lld.h:531
I2CLLD_Object
I2C Driver Object.
Definition: i2c_lld.h:461
I2C_lld_target_write
int32_t I2C_lld_target_write(I2CLLD_Handle handle, I2C_ExtendedParams *extendedParams, uint32_t timeout)
API to initiate an I2C write operation in polled mode as I2C Target.
I2CLLD_Object::Clock_usecToTicks
I2C_Clock_usecToTicks Clock_usecToTicks
Definition: i2c_lld.h:480
I2CLLD_Object::i2cMsg
I2CLLD_Message i2cMsg
Definition: i2c_lld.h:518
I2CLLD_targetTransaction
I2C Target Transaction.
Definition: i2c_lld.h:378
I2C_lld_target_read
int32_t I2C_lld_target_read(I2CLLD_Handle handle, I2C_ExtendedParams *extendedParams, uint32_t timeout)
API to initiate an I2C read Operation in polled mode as I2C Target.
I2CLLD_Object::args
void * args
Definition: i2c_lld.h:533
I2CLLD_Handle
struct I2CLLD_Object * I2CLLD_Handle
I2C_lld_targetTransferIntr
int32_t I2C_lld_targetTransferIntr(I2CLLD_Handle handle, I2CLLD_targetTransaction *txn)
API to initiate a transfer from I2C in interrupt mode as target.
I2C_Memory_ExtendedParams::memAddrSize
uint8_t memAddrSize
Definition: i2c_lld.h:356
I2CLLD_Object::currentTxnCount
uint32_t currentTxnCount
Definition: i2c_lld.h:516