SmartSnippets DA1459x SDK
hw_i2c.h
Go to the documentation of this file.
1 
42 #ifndef HW_I2C_H_
43 #define HW_I2C_H_
44 
45 
46 #if dg_configUSE_HW_I2C
47 
48 #include <stdbool.h>
49 #include <stdint.h>
50 #include "sdk_defs.h"
51 
58 #define HW_I2C_DMA_SUPPORT dg_configI2C_DMA_SUPPORT
59 
60 #if HW_I2C_DMA_SUPPORT
61 #include "hw_dma.h"
62 #endif
63 
70 #ifndef HW_I2C_SLAVE_SUPPORT
71 #define HW_I2C_SLAVE_SUPPORT ( 1 )
72 #endif
73 
74 /* I2C Base Address */
75 #define IBA(id) ((I2C_Type *)id)
76 
81 #define I2C_FIFO_DEPTH (4)
82 
90 #define I2C_SETUP(id, seq) \
91  do { \
92  hw_i2c_disable(id); \
93  seq; \
94  hw_i2c_enable(id); \
95  } while (0);
96 
101 #define HW_I2C1 ((void *)I2C_BASE)
102 #if defined(I2C2)
103 #define HW_I2C2 ((void *)I2C2_BASE)
104 #endif
105 #if defined(I2C3)
106 #define HW_I2C3 ((void *)I2C3_BASE)
107 #endif
108 typedef void * HW_I2C_ID;
109 
110 /*
111  * Flags passed to read/write operations
112  */
113 #define HW_I2C_F_NONE 0x00000000
114 #define HW_I2C_F_WAIT_FOR_STOP 0x00000001
115 #define HW_I2C_F_ADD_STOP 0x00000002
116 #define HW_I2C_F_ADD_RESTART 0x00000004
131 #define HW_I2C_I2C1_MADDR 0x01
132 #if defined(HW_I2C2)
133 #define HW_I2C_I2C2_MADDR 0x05
134 #endif
135 #if defined(HW_I2C3)
136 #define HW_I2C_I2C3_MADDR 0x07
137 #endif
138 
142 typedef enum {
160 
165 typedef enum {
169 } HW_I2C_SPEED;
170 
175 typedef enum {
178 } HW_I2C_MODE;
179 
184 typedef enum {
188 
189 #if (HW_I2C_SLAVE_SUPPORT == 1)
190 
194 typedef enum {
200 } HW_I2C_EVENT;
201 #endif /* HW_I2C_SLAVE_SUPPORT */
202 
209 typedef enum {
222 } HW_I2C_INT;
223 
224 #if (HW_I2C_DMA_SUPPORT == 1)
225 
229 typedef enum {
230  HW_I2C_DMA_TRANSFER_WRITE,
231  HW_I2C_DMA_TRANSFER_MASTER_READ,
232 #if (HW_I2C_SLAVE_SUPPORT == 1)
233  HW_I2C_DMA_TRANSFER_SLAVE_READ,
234 #endif
236 
244 #endif /* HW_I2C_DMA_SUPPORT */
245 
253 typedef void (*hw_i2c_interrupt_cb)(HW_I2C_ID id, uint16_t mask);
254 
265 typedef void (*hw_i2c_complete_cb)(HW_I2C_ID id, void *cb_data, uint16_t len, bool success);
266 
267 #if (HW_I2C_SLAVE_SUPPORT == 1)
268 
275 typedef void (*hw_i2c_event_cb)(HW_I2C_ID id, HW_I2C_EVENT event);
276 #endif /* HW_I2C_SLAVE_SUPPORT */
277 
282 typedef struct {
284  struct {
285  uint16_t ss_hcnt;
286  uint16_t ss_lcnt;
287  uint16_t fs_hcnt;
288  uint16_t fs_lcnt;
289  uint16_t hs_hcnt;
290  uint16_t hs_lcnt;
291  } clock_cfg;
292 
296  uint16_t address;
297 #if (HW_I2C_SLAVE_SUPPORT == 1)
299 #endif /* HW_I2C_SLAVE_SUPPORT */
300 #if (HW_I2C_DMA_SUPPORT == 1)
302 #endif /* HW_I2C_DMA_SUPPORT */
303 } i2c_config;
304 
316 #define HW_I2C_REG_SETF(id, reg, field, val) \
317  IBA(id)->reg##_REG = ((IBA(id)->reg##_REG & ~(I2C_##reg##_REG_##field##_Msk)) | \
318  ((I2C_##reg##_REG_##field##_Msk) & ((val) << (I2C_##reg##_REG_##field##_Pos))))
319 
330 #define HW_I2C_REG_GETF(id, reg, field) \
331  ((IBA(id)->reg##_REG & (I2C_##reg##_REG_##field##_Msk)) >> (I2C_##reg##_REG_##field##_Pos))
332 
341 #define HW_I2C_REG_SET_FIELD(reg, field, var, val) \
342  REG_SET_FIELD(I2C, reg##_REG, field, var, val)
343 
352 void hw_i2c_enable_clk(const HW_I2C_ID id);
353 
362 void hw_i2c_disable_clk(const HW_I2C_ID id);
363 
373 bool hw_i2c_is_clk_enabled(const HW_I2C_ID id);
374 
389 void hw_i2c_init(HW_I2C_ID id, const i2c_config *cfg);
390 
397 void hw_i2c_deinit(HW_I2C_ID id);
398 
412 void hw_i2c_configure(HW_I2C_ID id, const i2c_config *cfg);
413 
422 __STATIC_INLINE void hw_i2c_enable(HW_I2C_ID id)
423 {
424  HW_I2C_REG_SETF(id, I2C_ENABLE, I2C_EN, 1);
425 }
426 
433 void hw_i2c_disable(HW_I2C_ID id);
434 
444 __STATIC_INLINE bool hw_i2c_is_enabled(HW_I2C_ID id)
445 {
446  return (!!(HW_I2C_REG_GETF(id, I2C_ENABLE_STATUS, IC_EN)));
447 }
448 
455 __STATIC_INLINE uint16_t hw_i2c_get_enable_status(HW_I2C_ID id)
456 {
457  return IBA(id)->I2C_ENABLE_STATUS_REG;
458 }
459 
460 #if (HW_I2C_DMA_SUPPORT == 1)
461 
469 void hw_i2c_reset_dma_cb(HW_I2C_ID id);
470 #endif
471 
483 bool hw_i2c_is_occupied(HW_I2C_ID id);
484 
495 void hw_i2c_register_int(HW_I2C_ID id, hw_i2c_interrupt_cb cb, uint16_t mask);
496 
507 void hw_i2c_unregister_int(HW_I2C_ID id);
508 
518 void hw_i2c_set_int_mask(HW_I2C_ID id, uint16_t mask);
519 
530 uint16_t hw_i2c_get_int_mask(HW_I2C_ID id);
531 
541 __STATIC_INLINE void hw_i2c_set_mode(HW_I2C_ID id, HW_I2C_MODE mode)
542 {
543  // default to master mode, if incorrect value specified
544  bool set_master = (mode != HW_I2C_MODE_SLAVE) ? 1 : 0;
545 #if (HW_I2C_SLAVE_SUPPORT == 0)
546  ASSERT_WARNING(set_master);
547 #endif
548  uint32_t tmp = IBA(id)->I2C_CON_REG;
549  HW_I2C_REG_SET_FIELD(I2C_CON, I2C_MASTER_MODE, tmp, set_master ? 1 : 0);
550  HW_I2C_REG_SET_FIELD(I2C_CON, I2C_SLAVE_DISABLE, tmp, set_master ? 1 : 0);
551  IBA(id)->I2C_CON_REG = tmp;
552 }
553 
554 
563 __STATIC_INLINE uint8_t hw_i2c_is_master(HW_I2C_ID id)
564 {
565  return HW_I2C_REG_GETF(id, I2C_CON, I2C_MASTER_MODE);
566 }
567 
577 __STATIC_INLINE void hw_i2c_set_speed(HW_I2C_ID id, HW_I2C_SPEED speed)
578 {
579  // default to standard mode (100kbit/s), if incorrect value specified
580  switch (speed) {
581  case HW_I2C_SPEED_HIGH:
582  HW_I2C_REG_SETF(id, I2C_CON, I2C_SPEED, 3);
583  break;
584  case HW_I2C_SPEED_FAST:
585  HW_I2C_REG_SETF(id, I2C_CON, I2C_SPEED, 2);
586  break;
588  default:
589  HW_I2C_REG_SETF(id, I2C_CON, I2C_SPEED, 1);
590  break;
591  }
592 }
593 
601 __STATIC_INLINE void hw_i2c_set_restart_enabled(HW_I2C_ID id, bool enabled)
602 {
603  HW_I2C_REG_SETF(id, I2C_CON, I2C_RESTART_EN, !!enabled);
604 }
605 
615 __STATIC_INLINE void hw_i2c_set_general_call_enabled(HW_I2C_ID id, bool enabled)
616 {
617  uint32_t tmp = IBA(id)->I2C_TAR_REG;
618  HW_I2C_REG_SET_FIELD(I2C_TAR, SPECIAL, tmp, !!enabled);
619  HW_I2C_REG_SET_FIELD(I2C_TAR, GC_OR_START, tmp, !enabled);
620  IBA(id)->I2C_TAR_REG = tmp;
621 }
622 
632 __STATIC_INLINE void hw_i2c_set_target_addressing_mode(HW_I2C_ID id, HW_I2C_ADDRESSING addr_mode)
633 {
634  // default to 7b addressing, if incorrect value specified
635  HW_I2C_REG_SETF(id, I2C_CON, I2C_10BITADDR_MASTER, (addr_mode == HW_I2C_ADDRESSING_10B) ? 1 : 0);
636 }
637 
638 #if (HW_I2C_SLAVE_SUPPORT == 1)
639 
648 __STATIC_INLINE void hw_i2c_set_slave_addressing_mode(HW_I2C_ID id, HW_I2C_ADDRESSING addr_mode)
649 {
650  // default to 7b addressing, if incorrect value specified
651  HW_I2C_REG_SETF(id, I2C_CON, I2C_10BITADDR_SLAVE, (addr_mode == HW_I2C_ADDRESSING_10B) ? 1 : 0);
652 }
653 
663 __STATIC_INLINE void hw_i2c_set_slave_address(HW_I2C_ID id, uint16_t address)
664 {
665  HW_I2C_REG_SETF(id, I2C_SAR, IC_SAR, address);
666 }
667 
679 __STATIC_INLINE void hw_i2c_set_general_call_ack_enabled(HW_I2C_ID id, bool ack)
680 {
681  HW_I2C_REG_SETF(id, I2C_ACK_GENERAL_CALL, ACK_GEN_CALL, !!ack);
682 }
683 #endif /* HW_I2C_SLAVE_SUPPORT */
684 
698 void hw_i2c_setup_master(HW_I2C_ID id, HW_I2C_ADDRESSING addr_mode, uint16_t address);
699 
700 #if (HW_I2C_SLAVE_SUPPORT == 1)
701 
708 void hw_i2c_set_slave_callback(HW_I2C_ID id, hw_i2c_event_cb cb);
709 
710 #if (HW_I2C_DMA_SUPPORT == 1)
711 
722 void hw_i2c_register_slave_dma_read_callback(HW_I2C_ID id);
723 #endif /* HW_I2C_DMA_SUPPORT */
724 
741 void hw_i2c_setup_slave(HW_I2C_ID id, HW_I2C_ADDRESSING addr_mode,
742  uint16_t address, hw_i2c_event_cb cb);
743 #endif /* HW_I2C_SLAVE_SUPPORT */
744 
753 __STATIC_INLINE bool hw_i2c_is_master_busy(HW_I2C_ID id)
754 {
755  return (!!(HW_I2C_REG_GETF(id, I2C_STATUS, MST_ACTIVITY)));
756 }
757 
758 #if (HW_I2C_SLAVE_SUPPORT == 1)
759 
767 __STATIC_INLINE bool hw_i2c_is_slave_busy(HW_I2C_ID id)
768 {
769  return (!!(HW_I2C_REG_GETF(id, I2C_STATUS, SLV_ACTIVITY)));
770 }
771 #endif /* HW_I2C_SLAVE_SUPPORT */
772 
781 __STATIC_INLINE bool hw_i2c_controler_is_busy(HW_I2C_ID id)
782 {
783  return (!!(HW_I2C_REG_GETF(id, I2C_STATUS, I2C_ACTIVITY)));
784 }
785 
796 __STATIC_INLINE bool hw_i2c_is_tx_fifo_empty(HW_I2C_ID id)
797 {
798  return (!!(HW_I2C_REG_GETF(id, I2C_STATUS, TFE)));
799 }
800 
811 __STATIC_INLINE bool hw_i2c_is_tx_fifo_not_full(HW_I2C_ID id)
812 {
813  return (!!(HW_I2C_REG_GETF(id, I2C_STATUS, TFNF)));
814 }
815 
827 __STATIC_INLINE bool hw_i2c_is_rx_fifo_full(HW_I2C_ID id)
828 {
829  return (!!(HW_I2C_REG_GETF(id, I2C_STATUS, RFF)));
830 }
831 
842 __STATIC_INLINE bool hw_i2c_is_rx_fifo_not_empty(HW_I2C_ID id)
843 {
844  return (!!(HW_I2C_REG_GETF(id, I2C_STATUS, RFNE)));
845 }
846 
854 __STATIC_INLINE void hw_i2c_set_target_address(HW_I2C_ID id, uint16_t address)
855 {
856  if (hw_i2c_is_enabled(id)) {
857  /* Wait for the master to become IDLE */
858  while (hw_i2c_is_master_busy(id));
859 
860  /* Now is safe to disable the I2C to change the Target Address */
861  hw_i2c_disable(id);
862 
863  /* Change the Target Address */
864  HW_I2C_REG_SETF(id, I2C_TAR, IC_TAR, address);
865 
866  /* Enable again the I2C to use the new address */
867  hw_i2c_enable(id);
868 
869  } else {
870  /* Change the Target Address */
871  HW_I2C_REG_SETF(id, I2C_TAR, IC_TAR, address);
872  }
873 }
874 
891 __STATIC_INLINE void hw_i2c_write_byte(HW_I2C_ID id, uint8_t byte)
892 {
893  IBA(id)->I2C_DATA_CMD_REG = byte & (I2C_I2C_DATA_CMD_REG_I2C_CMD_Msk | I2C_I2C_DATA_CMD_REG_I2C_DAT_Msk);
894 }
895 
934 size_t hw_i2c_write_buffer_sync(HW_I2C_ID id, const uint8_t *data, uint16_t len,
935  HW_I2C_ABORT_SOURCE *abrt_code, uint32_t flags);
936 
978 int hw_i2c_write_buffer_async(HW_I2C_ID id, const uint8_t *data, uint16_t len,
979  hw_i2c_complete_cb cb, void *cb_data, uint32_t flags);
980 
994 __STATIC_INLINE void hw_i2c_read_byte_trigger(HW_I2C_ID id)
995 {
996  IBA(id)->I2C_DATA_CMD_REG = I2C_I2C_DATA_CMD_REG_I2C_CMD_Msk;
997 }
998 
1029 size_t hw_i2c_read_buffer_sync(HW_I2C_ID id, uint8_t *data, uint16_t len,
1030  HW_I2C_ABORT_SOURCE *abrt_code, uint32_t flags);
1031 
1069 int hw_i2c_read_buffer_async(HW_I2C_ID id, uint8_t *data, uint16_t len,
1070  hw_i2c_complete_cb cb, void *cb_data, uint32_t flags);
1071 
1109 int hw_i2c_write_then_read_async(HW_I2C_ID id, const uint8_t *w_data, uint16_t w_len,
1110  uint8_t *r_data, uint16_t r_len, hw_i2c_complete_cb cb,
1111  void *cb_data, uint32_t flags);
1112 
1129 __STATIC_INLINE uint8_t hw_i2c_read_byte(HW_I2C_ID id)
1130 {
1131  return HW_I2C_REG_GETF(id, I2C_DATA_CMD, I2C_DAT);
1132 }
1133 
1144 __STATIC_INLINE void hw_i2c_set_tx_fifo_threshold(HW_I2C_ID id, uint8_t level)
1145 {
1146  HW_I2C_REG_SETF(id, I2C_TX_TL, TX_TL, level);
1147 }
1148 
1159 __STATIC_INLINE void hw_i2c_set_rx_fifo_threshold(HW_I2C_ID id, uint8_t level)
1160 {
1161  HW_I2C_REG_SETF(id, I2C_RX_TL, RX_TL, level);
1162 }
1163 
1170 __STATIC_INLINE uint8_t hw_i2c_get_tx_fifo_threshold(HW_I2C_ID id)
1171 {
1172  return HW_I2C_REG_GETF(id, I2C_TX_TL, TX_TL);
1173 }
1174 
1181 __STATIC_INLINE uint8_t hw_i2c_get_rx_fifo_threshold(HW_I2C_ID id)
1182 {
1183  return HW_I2C_REG_GETF(id, I2C_RX_TL, RX_TL);
1184 }
1185 
1194 __STATIC_INLINE uint8_t hw_i2c_get_tx_fifo_level(HW_I2C_ID id)
1195 {
1196  return HW_I2C_REG_GETF(id, I2C_TXFLR, TXFLR);
1197 }
1198 
1207 __STATIC_INLINE uint8_t hw_i2c_get_rx_fifo_level(HW_I2C_ID id)
1208 {
1209  return HW_I2C_REG_GETF(id, I2C_RXFLR, RXFLR);
1210 }
1211 
1218 __STATIC_INLINE void hw_i2c_flush_rx_fifo(HW_I2C_ID id)
1219 {
1220  while (hw_i2c_get_rx_fifo_level(id)) {
1221  hw_i2c_read_byte(id);
1222  }
1223 }
1224 
1240 __STATIC_INLINE uint16_t hw_i2c_get_int_state(HW_I2C_ID id)
1241 {
1242  return IBA(id)->I2C_INTR_STAT_REG;
1243 }
1244 
1256 __STATIC_INLINE uint16_t hw_i2c_get_raw_int_state(HW_I2C_ID id)
1257 {
1258  return IBA(id)->I2C_RAW_INTR_STAT_REG;
1259 }
1260 
1274 __STATIC_INLINE void hw_i2c_reset_int_all(HW_I2C_ID id)
1275 {
1276  (void) IBA(id)->I2C_CLR_INTR_REG;
1277 }
1278 
1287 __STATIC_INLINE void hw_i2c_reset_int_rx_underflow(HW_I2C_ID id)
1288 {
1289  (void) IBA(id)->I2C_CLR_RX_UNDER_REG;
1290 }
1291 
1300 __STATIC_INLINE void hw_i2c_reset_int_rx_overflow(HW_I2C_ID id)
1301 {
1302  (void) IBA(id)->I2C_CLR_RX_OVER_REG;
1303 }
1304 
1313 __STATIC_INLINE void hw_i2c_reset_int_tx_overflow(HW_I2C_ID id)
1314 {
1315  (void) IBA(id)->I2C_CLR_TX_OVER_REG;
1316 }
1317 
1326 __STATIC_INLINE void hw_i2c_reset_int_read_request(HW_I2C_ID id)
1327 {
1328  (void) IBA(id)->I2C_CLR_RD_REQ_REG;
1329 }
1330 
1339 __STATIC_INLINE void hw_i2c_reset_int_tx_abort(HW_I2C_ID id)
1340 {
1341  (void) IBA(id)->I2C_CLR_TX_ABRT_REG;
1342 }
1343 
1352 __STATIC_INLINE void hw_i2c_reset_int_rx_done(HW_I2C_ID id)
1353 {
1354  (void) IBA(id)->I2C_CLR_RX_DONE_REG;
1355 }
1356 
1365 __STATIC_INLINE void hw_i2c_reset_int_activity(HW_I2C_ID id)
1366 {
1367  (void) IBA(id)->I2C_CLR_ACTIVITY_REG;
1368 }
1369 
1378 __STATIC_INLINE void hw_i2c_reset_int_start_detected(HW_I2C_ID id)
1379 {
1380  (void) IBA(id)->I2C_CLR_START_DET_REG;
1381 }
1382 
1391 __STATIC_INLINE void hw_i2c_reset_int_stop_detected(HW_I2C_ID id)
1392 {
1393  (void) IBA(id)->I2C_CLR_STOP_DET_REG;
1394 }
1395 
1404 __STATIC_INLINE void hw_i2c_reset_int_gen_call(HW_I2C_ID id)
1405 {
1406  (void) IBA(id)->I2C_CLR_GEN_CALL_REG;
1407 }
1408 
1423 __STATIC_INLINE uint32_t hw_i2c_get_abort_source(HW_I2C_ID id)
1424 {
1425  return IBA(id)->I2C_TX_ABRT_SOURCE_REG & 0x1FFFF;
1426 }
1427 
1441 __STATIC_INLINE void hw_i2c_reset_abort_source(HW_I2C_ID id)
1442 {
1444 }
1445 
1456 __STATIC_INLINE void hw_i2c_master_abort_transfer(HW_I2C_ID id)
1457 {
1458  if (hw_i2c_is_master(id)) {
1459  HW_I2C_REG_SETF(id, I2C_ENABLE, I2C_ABORT, 1);
1460  }
1461 }
1462 
1463 
1464 #if (HW_I2C_DMA_SUPPORT == 1)
1465 
1512 void hw_i2c_prepare_dma(HW_I2C_ID id, uint8_t channel, void *data, uint16_t len,
1513  HW_I2C_DMA_TRANSFER type, hw_i2c_complete_cb cb, void *cb_data,
1514  uint32_t flags);
1515 
1516 
1528 void hw_i2c_dma_start(HW_I2C_ID id);
1529 
1563 void hw_i2c_write_buffer_dma(HW_I2C_ID id, uint8_t channel, const uint16_t *data, uint16_t len,
1564  hw_i2c_complete_cb cb, void *cb_data, uint32_t flags);
1565 
1566 
1598 void hw_i2c_read_buffer_dma(HW_I2C_ID id, uint8_t channel, uint8_t *data, uint16_t len,
1599  hw_i2c_complete_cb cb, void *cb_data, uint32_t flags);
1600 
1601 
1602 #endif /* HW_I2C_DMA_SUPPORT */
1603 
1604 #endif /* dg_configUSE_HW_I2C */
1605 #endif /* HW_I2C_H_ */
1606 
i2c_config::fs_lcnt
uint16_t fs_lcnt
Definition: hw_i2c.h:288
hw_dma.h
Definition of API for the DMA Low Level Driver.
hw_i2c_get_abort_source
__STATIC_INLINE uint32_t hw_i2c_get_abort_source(HW_I2C_ID id)
Get abort source.
Definition: hw_i2c.h:1423
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_7B_ADDR_NOACK_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_7B_ADDR_NOACK_Msk
Definition: DA1459x-00.h:3600
HW_I2C_ABORT_SLAVE_FLUSH_TX_FIFO
Definition: hw_i2c.h:154
HW_I2C_ABORT_SW_ERROR
Definition: hw_i2c.h:158
hw_i2c_set_speed
__STATIC_INLINE void hw_i2c_set_speed(HW_I2C_ID id, HW_I2C_SPEED speed)
Set I2C interface bus speed.
Definition: hw_i2c.h:577
HW_I2C_EVENT_READ_REQUEST
Definition: hw_i2c.h:195
hw_i2c_is_enabled
__STATIC_INLINE bool hw_i2c_is_enabled(HW_I2C_ID id)
Get I2C controller enable status.
Definition: hw_i2c.h:444
HW_I2C_INT_RX_FULL
Definition: hw_i2c.h:212
hw_i2c_set_rx_fifo_threshold
__STATIC_INLINE void hw_i2c_set_rx_fifo_threshold(HW_I2C_ID id, uint8_t level)
Set threshold level on RX FIFO.
Definition: hw_i2c.h:1159
I2C_I2C_INTR_STAT_REG_R_RD_REQ_Msk
#define I2C_I2C_INTR_STAT_REG_R_RD_REQ_Msk
Definition: DA1459x-00.h:3468
hw_i2c_write_byte
__STATIC_INLINE void hw_i2c_write_byte(HW_I2C_ID id, uint8_t byte)
Write single byte into TX FIFO.
Definition: hw_i2c.h:891
i2c_config::speed
HW_I2C_SPEED speed
Definition: hw_i2c.h:293
HW_I2C_INT
HW_I2C_INT
I2C interrupt source.
Definition: hw_i2c.h:209
HW_I2C_SPEED_FAST
Definition: hw_i2c.h:167
hw_i2c_is_occupied
bool hw_i2c_is_occupied(HW_I2C_ID id)
Get I2C controller occupied status.
HW_I2C_INT_TX_EMPTY
Definition: hw_i2c.h:214
hw_i2c_setup_slave
void hw_i2c_setup_slave(HW_I2C_ID id, HW_I2C_ADDRESSING addr_mode, uint16_t address, hw_i2c_event_cb cb)
Setup controller for operation in slave mode.
i2c_config::dma_prio
hw_i2c_dma_prio_t dma_prio
Definition: hw_i2c.h:301
HW_I2C_DMA_TRANSFER
HW_I2C_DMA_TRANSFER
DMA transfer type.
Definition: hw_i2c.h:229
hw_i2c_is_master
__STATIC_INLINE uint8_t hw_i2c_is_master(HW_I2C_ID id)
Get I2C controller master mode status.
Definition: hw_i2c.h:563
hw_i2c_init
void hw_i2c_init(HW_I2C_ID id, const i2c_config *cfg)
Initialize I2C controller.
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10B_RD_NORSTRT_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10B_RD_NORSTRT_Msk
Definition: DA1459x-00.h:3580
hw_i2c_reset_int_start_detected
__STATIC_INLINE void hw_i2c_reset_int_start_detected(HW_I2C_ID id)
Reset START_DETECTED interrupt state.
Definition: hw_i2c.h:1378
hw_i2c_reset_int_tx_overflow
__STATIC_INLINE void hw_i2c_reset_int_tx_overflow(HW_I2C_ID id)
Reset TX_OVERFLOW interrupt state.
Definition: hw_i2c.h:1313
HW_I2C_EVENT_TX_ABORT
Definition: hw_i2c.h:197
hw_i2c_is_master_busy
__STATIC_INLINE bool hw_i2c_is_master_busy(HW_I2C_ID id)
Check if controller is busy when operating in master mode.
Definition: hw_i2c.h:753
HW_I2C_ABORT_NONE
Definition: hw_i2c.h:143
I2C_I2C_INTR_STAT_REG_R_TX_OVER_Msk
#define I2C_I2C_INTR_STAT_REG_R_TX_OVER_Msk
Definition: DA1459x-00.h:3472
i2c_config::fs_hcnt
uint16_t fs_hcnt
Definition: hw_i2c.h:287
HW_I2C_INT_TX_OVERFLOW
Definition: hw_i2c.h:213
hw_i2c_set_restart_enabled
__STATIC_INLINE void hw_i2c_set_restart_enabled(HW_I2C_ID id, bool enabled)
Set whether RESTART conditions may be sent when acting as master.
Definition: hw_i2c.h:601
hw_i2c_read_buffer_sync
size_t hw_i2c_read_buffer_sync(HW_I2C_ID id, uint8_t *data, uint16_t len, HW_I2C_ABORT_SOURCE *abrt_code, uint32_t flags)
Read multiple bytes from I2C slave synchronously.
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_USER_ABRT_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_USER_ABRT_Msk
Definition: DA1459x-00.h:3568
hw_i2c_deinit
void hw_i2c_deinit(HW_I2C_ID id)
DeInitialize I2C controller.
HW_I2C_EVENT_RX_OVERFLOW
Definition: hw_i2c.h:198
HW_I2C_ADDRESSING
HW_I2C_ADDRESSING
I2C addressing mode.
Definition: hw_i2c.h:184
I2C_I2C_INTR_STAT_REG_R_START_DET_Msk
#define I2C_I2C_INTR_STAT_REG_R_START_DET_Msk
Definition: DA1459x-00.h:3458
HW_I2C_INT_START_DETECTED
Definition: hw_i2c.h:220
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLV_ARBLOST_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLV_ARBLOST_Msk
Definition: DA1459x-00.h:3572
sdk_defs.h
Central include header file with platform definitions.
hw_i2c_set_slave_callback
void hw_i2c_set_slave_callback(HW_I2C_ID id, hw_i2c_event_cb cb)
Setup callback function for operation in slave mode.
I2C_I2C_INTR_STAT_REG_R_STOP_DET_Msk
#define I2C_I2C_INTR_STAT_REG_R_STOP_DET_Msk
Definition: DA1459x-00.h:3460
hw_i2c_disable
void hw_i2c_disable(HW_I2C_ID id)
Disable I2C controller.
hw_dma_periph_prio_t
DMA peripherals priority structure.
Definition: hw_dma.h:275
hw_i2c_register_slave_dma_read_callback
void hw_i2c_register_slave_dma_read_callback(HW_I2C_ID id)
Register proper handling for DMA read in slave mode.
hw_i2c_write_buffer_sync
size_t hw_i2c_write_buffer_sync(HW_I2C_ID id, const uint8_t *data, uint16_t len, HW_I2C_ABORT_SOURCE *abrt_code, uint32_t flags)
Write multiple bytes to I2C slave synchronously.
i2c_config::event_cb
hw_i2c_event_cb event_cb
Definition: hw_i2c.h:298
I2C_I2C_INTR_STAT_REG_R_TX_EMPTY_Msk
#define I2C_I2C_INTR_STAT_REG_R_TX_EMPTY_Msk
Definition: DA1459x-00.h:3470
HW_I2C_ABORT_SLAVE_IN_TX
Definition: hw_i2c.h:156
hw_i2c_get_int_mask
uint16_t hw_i2c_get_int_mask(HW_I2C_ID id)
Get current bitmask of requested interrupt events.
HW_I2C_INT_READ_REQUEST
Definition: hw_i2c.h:215
I2C_I2C_DATA_CMD_REG_I2C_CMD_Msk
#define I2C_I2C_DATA_CMD_REG_I2C_CMD_Msk
Definition: DA1459x-00.h:3368
I2C_I2C_INTR_STAT_REG_R_TX_ABRT_Msk
#define I2C_I2C_INTR_STAT_REG_R_TX_ABRT_Msk
Definition: DA1459x-00.h:3466
HW_I2C_ABORT_10B_ADDR2_NO_ACK
Definition: hw_i2c.h:146
I2C_I2C_INTR_STAT_REG_R_ACTIVITY_Msk
#define I2C_I2C_INTR_STAT_REG_R_ACTIVITY_Msk
Definition: DA1459x-00.h:3462
hw_i2c_unregister_int
void hw_i2c_unregister_int(HW_I2C_ID id)
Unregister interrupt handler.
hw_i2c_read_byte
__STATIC_INLINE uint8_t hw_i2c_read_byte(HW_I2C_ID id)
Read single byte from RX FIFO.
Definition: hw_i2c.h:1129
HW_I2C_ABORT_MASTER_DISABLED
Definition: hw_i2c.h:152
hw_i2c_write_buffer_async
int hw_i2c_write_buffer_async(HW_I2C_ID id, const uint8_t *data, uint16_t len, hw_i2c_complete_cb cb, void *cb_data, uint32_t flags)
Write multiple bytes to I2C slave asynchronously.
hw_i2c_reset_int_stop_detected
__STATIC_INLINE void hw_i2c_reset_int_stop_detected(HW_I2C_ID id)
Reset STOP_DETECTED interrupt state.
Definition: hw_i2c.h:1391
hw_i2c_set_mode
__STATIC_INLINE void hw_i2c_set_mode(HW_I2C_ID id, HW_I2C_MODE mode)
Set I2C controller mode.
Definition: hw_i2c.h:541
HW_I2C_ABORT_10B_READ_NO_RESTART
Definition: hw_i2c.h:151
hw_i2c_set_target_address
__STATIC_INLINE void hw_i2c_set_target_address(HW_I2C_ID id, uint16_t address)
Set target slave address in master mode.
Definition: hw_i2c.h:854
hw_i2c_flush_rx_fifo
__STATIC_INLINE void hw_i2c_flush_rx_fifo(HW_I2C_ID id)
Flushing RX FIFO.
Definition: hw_i2c.h:1218
hw_i2c_complete_cb
void(* hw_i2c_complete_cb)(HW_I2C_ID id, void *cb_data, uint16_t len, bool success)
Callback called upon completion of read or write in non-blocking mode (FIFO or DMA)
Definition: hw_i2c.h:265
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10ADDR2_NOACK_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10ADDR2_NOACK_Msk
Definition: DA1459x-00.h:3596
HW_I2C_INT_RX_OVERFLOW
Definition: hw_i2c.h:211
hw_i2c_interrupt_cb
void(* hw_i2c_interrupt_cb)(HW_I2C_ID id, uint16_t mask)
Callback called on interrupt from I2C controller.
Definition: hw_i2c.h:253
hw_i2c_set_general_call_enabled
__STATIC_INLINE void hw_i2c_set_general_call_enabled(HW_I2C_ID id, bool enabled)
Set whether General Call should be used to address slaves.
Definition: hw_i2c.h:615
hw_i2c_is_slave_busy
__STATIC_INLINE bool hw_i2c_is_slave_busy(HW_I2C_ID id)
Check if controller is busy when operating in slave mode.
Definition: hw_i2c.h:767
hw_i2c_reset_int_read_request
__STATIC_INLINE void hw_i2c_reset_int_read_request(HW_I2C_ID id)
Reset READ_REQUEST interrupt state.
Definition: hw_i2c.h:1326
hw_i2c_get_int_state
__STATIC_INLINE uint16_t hw_i2c_get_int_state(HW_I2C_ID id)
Get interrupt state.
Definition: hw_i2c.h:1240
HW_I2C_INT_GENERAL_CALL
Definition: hw_i2c.h:221
hw_i2c_reset_abort_source
__STATIC_INLINE void hw_i2c_reset_abort_source(HW_I2C_ID id)
Reset abort source.
Definition: hw_i2c.h:1441
HW_I2C_ABORT_SOURCE
HW_I2C_ABORT_SOURCE
I2C abort source.
Definition: hw_i2c.h:142
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_MASTER_DIS_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_MASTER_DIS_Msk
Definition: DA1459x-00.h:3578
HW_I2C_MODE_SLAVE
Definition: hw_i2c.h:177
HW_I2C_ABORT_START_BYTE_ACK
Definition: hw_i2c.h:150
hw_i2c_register_int
void hw_i2c_register_int(HW_I2C_ID id, hw_i2c_interrupt_cb cb, uint16_t mask)
Register interrupt handler.
HW_I2C_INT_TX_ABORT
Definition: hw_i2c.h:216
hw_i2c_get_raw_int_state
__STATIC_INLINE uint16_t hw_i2c_get_raw_int_state(HW_I2C_ID id)
Get raw interrupt state.
Definition: hw_i2c.h:1256
hw_i2c_get_rx_fifo_threshold
__STATIC_INLINE uint8_t hw_i2c_get_rx_fifo_threshold(HW_I2C_ID id)
Get threshold level on RX FIFO.
Definition: hw_i2c.h:1181
hw_i2c_get_tx_fifo_threshold
__STATIC_INLINE uint8_t hw_i2c_get_tx_fifo_threshold(HW_I2C_ID id)
Get threshold level on TX FIFO.
Definition: hw_i2c.h:1170
I2C_I2C_INTR_STAT_REG_R_RX_DONE_Msk
#define I2C_I2C_INTR_STAT_REG_R_RX_DONE_Msk
Definition: DA1459x-00.h:3464
hw_i2c_get_enable_status
__STATIC_INLINE uint16_t hw_i2c_get_enable_status(HW_I2C_ID id)
Get I2C Controller Enable status.
Definition: hw_i2c.h:455
i2c_config::ss_hcnt
uint16_t ss_hcnt
Definition: hw_i2c.h:285
i2c_config::ss_lcnt
uint16_t ss_lcnt
Definition: hw_i2c.h:286
HW_I2C_ABORT_GENERAL_CALL_NO_ACK
Definition: hw_i2c.h:148
hw_i2c_reset_int_activity
__STATIC_INLINE void hw_i2c_reset_int_activity(HW_I2C_ID id)
Reset ACTIVITY interrupt state.
Definition: hw_i2c.h:1365
hw_i2c_is_rx_fifo_full
__STATIC_INLINE bool hw_i2c_is_rx_fifo_full(HW_I2C_ID id)
Check if RX FIFO queue is full.
Definition: hw_i2c.h:827
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10ADDR1_NOACK_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10ADDR1_NOACK_Msk
Definition: DA1459x-00.h:3598
hw_i2c_is_clk_enabled
bool hw_i2c_is_clk_enabled(const HW_I2C_ID id)
Get the status of the I2C interface clock source.
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_TXDATA_NOACK_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_TXDATA_NOACK_Msk
Definition: DA1459x-00.h:3594
HW_I2C_ABORT_GENERAL_CALL_READ
Definition: hw_i2c.h:149
hw_i2c_is_tx_fifo_empty
__STATIC_INLINE bool hw_i2c_is_tx_fifo_empty(HW_I2C_ID id)
Check if TX FIFO queue is empty.
Definition: hw_i2c.h:796
HW_I2C_REG_SETF
#define HW_I2C_REG_SETF(id, reg, field, val)
Write a value to an I2C register field.
Definition: hw_i2c.h:316
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SBYTE_ACKDET_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SBYTE_ACKDET_Msk
Definition: DA1459x-00.h:3586
HW_I2C_EVENT
HW_I2C_EVENT
Callback events when working as slave.
Definition: hw_i2c.h:194
hw_i2c_write_buffer_dma
void hw_i2c_write_buffer_dma(HW_I2C_ID id, uint8_t channel, const uint16_t *data, uint16_t len, hw_i2c_complete_cb cb, void *cb_data, uint32_t flags)
Write multiple bytes on I2C bus using DMA.
hw_i2c_controler_is_busy
__STATIC_INLINE bool hw_i2c_controler_is_busy(HW_I2C_ID id)
Check controller activity.
Definition: hw_i2c.h:781
hw_i2c_reset_int_rx_overflow
__STATIC_INLINE void hw_i2c_reset_int_rx_overflow(HW_I2C_ID id)
Reset RX_OVERFLOW interrupt state.
Definition: hw_i2c.h:1300
i2c_config::hs_lcnt
uint16_t hs_lcnt
Definition: hw_i2c.h:290
mode
HW_GPIO_MODE mode
Definition: hw_gpio.h:211
hw_i2c_master_abort_transfer
__STATIC_INLINE void hw_i2c_master_abort_transfer(HW_I2C_ID id)
Aborts I2C transfer.
Definition: hw_i2c.h:1456
I2C_I2C_TX_ABRT_SOURCE_REG_ARB_LOST_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ARB_LOST_Msk
Definition: DA1459x-00.h:3576
HW_I2C_ABORT_ARBITRATION_LOST
Definition: hw_i2c.h:153
I2C_I2C_INTR_STAT_REG_R_RX_OVER_Msk
#define I2C_I2C_INTR_STAT_REG_R_RX_OVER_Msk
Definition: DA1459x-00.h:3476
i2c_config::mode
HW_I2C_MODE mode
Definition: hw_i2c.h:294
HW_I2C_ABORT_USER_ABORT
Definition: hw_i2c.h:157
hw_i2c_reset_int_tx_abort
__STATIC_INLINE void hw_i2c_reset_int_tx_abort(HW_I2C_ID id)
Reset TX_ABORT interrupt state.
Definition: hw_i2c.h:1339
I2C_I2C_DATA_CMD_REG_I2C_DAT_Msk
#define I2C_I2C_DATA_CMD_REG_I2C_DAT_Msk
Definition: DA1459x-00.h:3370
HW_I2C_SPEED_HIGH
Definition: hw_i2c.h:168
hw_i2c_set_tx_fifo_threshold
__STATIC_INLINE void hw_i2c_set_tx_fifo_threshold(HW_I2C_ID id, uint8_t level)
Set threshold level on TX FIFO.
Definition: hw_i2c.h:1144
hw_i2c_reset_dma_cb
void hw_i2c_reset_dma_cb(HW_I2C_ID id)
Reset DMA callback.
HW_I2C_ABORT_TX_DATA_NO_ACK
Definition: hw_i2c.h:147
hw_i2c_configure
void hw_i2c_configure(HW_I2C_ID id, const i2c_config *cfg)
Configure I2C controller.
hw_i2c_reset_int_all
__STATIC_INLINE void hw_i2c_reset_int_all(HW_I2C_ID id)
Reset all interrupt state.
Definition: hw_i2c.h:1274
i2c_config::hs_hcnt
uint16_t hs_hcnt
Definition: hw_i2c.h:289
hw_i2c_set_target_addressing_mode
__STATIC_INLINE void hw_i2c_set_target_addressing_mode(HW_I2C_ID id, HW_I2C_ADDRESSING addr_mode)
Set target slave addressing mode in master mode.
Definition: hw_i2c.h:632
i2c_config::address
uint16_t address
Definition: hw_i2c.h:296
hw_i2c_get_rx_fifo_level
__STATIC_INLINE uint8_t hw_i2c_get_rx_fifo_level(HW_I2C_ID id)
Get number of bytes in RX FIFO.
Definition: hw_i2c.h:1207
HW_I2C_ADDRESSING_7B
Definition: hw_i2c.h:185
HW_I2C_SPEED_STANDARD
Definition: hw_i2c.h:166
HW_I2C_INT_RX_DONE
Definition: hw_i2c.h:217
hw_i2c_set_general_call_ack_enabled
__STATIC_INLINE void hw_i2c_set_general_call_ack_enabled(HW_I2C_ID id, bool ack)
Set support for general call acknowledgment.
Definition: hw_i2c.h:679
hw_i2c_enable
__STATIC_INLINE void hw_i2c_enable(HW_I2C_ID id)
Enable I2C controller.
Definition: hw_i2c.h:422
hw_i2c_reset_int_rx_underflow
__STATIC_INLINE void hw_i2c_reset_int_rx_underflow(HW_I2C_ID id)
Reset RX_UNDERFLOW interrupt state.
Definition: hw_i2c.h:1287
hw_i2c_setup_master
void hw_i2c_setup_master(HW_I2C_ID id, HW_I2C_ADDRESSING addr_mode, uint16_t address)
Setup controller for operation in master mode.
HW_I2C_ABORT_7B_ADDR_NO_ACK
Definition: hw_i2c.h:144
HW_I2C_ABORT_10B_ADDR1_NO_ACK
Definition: hw_i2c.h:145
hw_i2c_dma_start
void hw_i2c_dma_start(HW_I2C_ID id)
Starts DMA transfer.
hw_i2c_prepare_dma
void hw_i2c_prepare_dma(HW_I2C_ID id, uint8_t channel, void *data, uint16_t len, HW_I2C_DMA_TRANSFER type, hw_i2c_complete_cb cb, void *cb_data, uint32_t flags)
Prepares I2C DMA for transfer.
HW_I2C_REG_GETF
#define HW_I2C_REG_GETF(id, reg, field)
Get the value of an I2C register field.
Definition: hw_i2c.h:330
HW_I2C_EVENT_DATA_READY
Definition: hw_i2c.h:196
hw_i2c_set_int_mask
void hw_i2c_set_int_mask(HW_I2C_ID id, uint16_t mask)
Set bitmask of requested interrupt events.
hw_i2c_dma_prio_t
hw_dma_periph_prio_t hw_i2c_dma_prio_t
I2C DMA priority configuration.
Definition: hw_i2c.h:243
hw_i2c_disable_clk
void hw_i2c_disable_clk(const HW_I2C_ID id)
Disable I2C clock.
HW_I2C_ADDRESSING_10B
Definition: hw_i2c.h:186
i2c_config
I2C configuration.
Definition: hw_i2c.h:282
HW_I2C_MODE_MASTER
Definition: hw_i2c.h:176
hw_i2c_set_slave_address
__STATIC_INLINE void hw_i2c_set_slave_address(HW_I2C_ID id, uint16_t address)
Set slave address in slave mode.
Definition: hw_i2c.h:663
I2C_I2C_INTR_STAT_REG_R_RX_FULL_Msk
#define I2C_I2C_INTR_STAT_REG_R_RX_FULL_Msk
Definition: DA1459x-00.h:3474
hw_i2c_is_rx_fifo_not_empty
__STATIC_INLINE bool hw_i2c_is_rx_fifo_not_empty(HW_I2C_ID id)
Check if RX FIFO is not empty.
Definition: hw_i2c.h:842
I2C_I2C_INTR_STAT_REG_R_GEN_CALL_Msk
#define I2C_I2C_INTR_STAT_REG_R_GEN_CALL_Msk
Definition: DA1459x-00.h:3456
hw_i2c_write_then_read_async
int hw_i2c_write_then_read_async(HW_I2C_ID id, const uint8_t *w_data, uint16_t w_len, uint8_t *r_data, uint16_t r_len, hw_i2c_complete_cb cb, void *cb_data, uint32_t flags)
Write then read multiple bytes from I2C slave.
hw_i2c_read_buffer_dma
void hw_i2c_read_buffer_dma(HW_I2C_ID id, uint8_t channel, uint8_t *data, uint16_t len, hw_i2c_complete_cb cb, void *cb_data, uint32_t flags)
Read multiple bytes from I2C bus using DMA.
HW_I2C_SPEED
HW_I2C_SPEED
I2C interface speed.
Definition: hw_i2c.h:165
hw_i2c_set_slave_addressing_mode
__STATIC_INLINE void hw_i2c_set_slave_addressing_mode(HW_I2C_ID id, HW_I2C_ADDRESSING addr_mode)
Set slave addressing mode in slave mode.
Definition: hw_i2c.h:648
HW_I2C_MODE
HW_I2C_MODE
I2C mode.
Definition: hw_i2c.h:175
hw_i2c_enable_clk
void hw_i2c_enable_clk(const HW_I2C_ID id)
Enable I2C clock.
HW_I2C_REG_SET_FIELD
#define HW_I2C_REG_SET_FIELD(reg, field, var, val)
Sets a field value of an I2C register. Aimed to be used with local variables.
Definition: hw_i2c.h:341
HW_I2C_INT_RX_UNDERFLOW
Definition: hw_i2c.h:210
hw_i2c_is_tx_fifo_not_full
__STATIC_INLINE bool hw_i2c_is_tx_fifo_not_full(HW_I2C_ID id)
Check if TX FIFO is not full.
Definition: hw_i2c.h:811
HW_I2C_ABORT_SLAVE_ARBITRATION_LOST
Definition: hw_i2c.h:155
hw_i2c_reset_int_rx_done
__STATIC_INLINE void hw_i2c_reset_int_rx_done(HW_I2C_ID id)
Reset RX_DONE interrupt state.
Definition: hw_i2c.h:1352
HW_I2C_INT_ACTIVITY
Definition: hw_i2c.h:218
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_GCALL_READ_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_GCALL_READ_Msk
Definition: DA1459x-00.h:3590
HW_I2C_EVENT_INVALID
Definition: hw_i2c.h:199
hw_i2c_event_cb
void(* hw_i2c_event_cb)(HW_I2C_ID id, HW_I2C_EVENT event)
Callback called on event when in slave mode.
Definition: hw_i2c.h:275
hw_i2c_get_tx_fifo_level
__STATIC_INLINE uint8_t hw_i2c_get_tx_fifo_level(HW_I2C_ID id)
Get number of bytes in TX FIFO.
Definition: hw_i2c.h:1194
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLVFLUSH_TXFIFO_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLVFLUSH_TXFIFO_Msk
Definition: DA1459x-00.h:3574
hw_i2c_read_byte_trigger
__STATIC_INLINE void hw_i2c_read_byte_trigger(HW_I2C_ID id)
Initiate reading from I2C bus.
Definition: hw_i2c.h:994
I2C_I2C_INTR_STAT_REG_R_RX_UNDER_Msk
#define I2C_I2C_INTR_STAT_REG_R_RX_UNDER_Msk
Definition: DA1459x-00.h:3478
i2c_config::addr_mode
HW_I2C_ADDRESSING addr_mode
Definition: hw_i2c.h:295
hw_i2c_reset_int_gen_call
__STATIC_INLINE void hw_i2c_reset_int_gen_call(HW_I2C_ID id)
Reset GENERAL_CALL interrupt state.
Definition: hw_i2c.h:1404
HW_I2C_INT_STOP_DETECTED
Definition: hw_i2c.h:219
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_GCALL_NOACK_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_GCALL_NOACK_Msk
Definition: DA1459x-00.h:3592
hw_i2c_read_buffer_async
int hw_i2c_read_buffer_async(HW_I2C_ID id, uint8_t *data, uint16_t len, hw_i2c_complete_cb cb, void *cb_data, uint32_t flags)
Read multiple bytes from I2C slave asynchronously.
I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLVRD_INTX_Msk
#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLVRD_INTX_Msk
Definition: DA1459x-00.h:3570