nrfx_twim.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. /**
  2. * Copyright (c) 2015 - 2020, Nordic Semiconductor ASA
  3. *
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without modification,
  7. * are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice, this
  10. * list of conditions and the following disclaimer.
  11. *
  12. * 2. Redistributions in binary form, except as embedded into a Nordic
  13. * Semiconductor ASA integrated circuit in a product or a software update for
  14. * such product, must reproduce the above copyright notice, this list of
  15. * conditions and the following disclaimer in the documentation and/or other
  16. * materials provided with the distribution.
  17. *
  18. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * 4. This software, with or without modification, must only be used with a
  23. * Nordic Semiconductor ASA integrated circuit.
  24. *
  25. * 5. Any software provided in binary form under this license must not be reverse
  26. * engineered, decompiled, modified and/or disassembled.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  29. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  30. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  31. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  32. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  34. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  37. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. #ifndef NRFX_TWIM_H__
  41. #define NRFX_TWIM_H__
  42. #include <nrfx.h>
  43. #include <nrfx_twi_twim.h>
  44. #include <hal/nrf_twim.h>
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. /**
  49. * @defgroup nrfx_twim TWIM driver
  50. * @{
  51. * @ingroup nrf_twim
  52. * @brief Two Wire Interface Master with EasyDMA (TWIM) peripheral driver.
  53. */
  54. /** @brief Structure for the TWI master driver instance. */
  55. typedef struct
  56. {
  57. NRF_TWIM_Type * p_twim; ///< Pointer to a structure with TWIM registers.
  58. uint8_t drv_inst_idx; ///< Index of the driver instance. For internal use only.
  59. } nrfx_twim_t;
  60. /** @brief Macro for creating a TWI master driver instance. */
  61. #define NRFX_TWIM_INSTANCE(id) \
  62. { \
  63. .p_twim = NRFX_CONCAT_2(NRF_TWIM, id), \
  64. .drv_inst_idx = NRFX_CONCAT_3(NRFX_TWIM, id, _INST_IDX), \
  65. }
  66. #ifndef __NRFX_DOXYGEN__
  67. enum {
  68. #if NRFX_CHECK(NRFX_TWIM0_ENABLED)
  69. NRFX_TWIM0_INST_IDX,
  70. #endif
  71. #if NRFX_CHECK(NRFX_TWIM1_ENABLED)
  72. NRFX_TWIM1_INST_IDX,
  73. #endif
  74. #if NRFX_CHECK(NRFX_TWIM2_ENABLED)
  75. NRFX_TWIM2_INST_IDX,
  76. #endif
  77. #if NRFX_CHECK(NRFX_TWIM3_ENABLED)
  78. NRFX_TWIM3_INST_IDX,
  79. #endif
  80. NRFX_TWIM_ENABLED_COUNT
  81. };
  82. #endif
  83. /** @brief Structure for the TWI master driver instance configuration. */
  84. typedef struct
  85. {
  86. uint32_t scl; ///< SCL pin number.
  87. uint32_t sda; ///< SDA pin number.
  88. nrf_twim_frequency_t frequency; ///< TWIM frequency.
  89. uint8_t interrupt_priority; ///< Interrupt priority.
  90. bool hold_bus_uninit; ///< Hold pull up state on GPIO pins after uninit.
  91. } nrfx_twim_config_t;
  92. /** @brief TWI master driver instance default configuration. */
  93. #define NRFX_TWIM_DEFAULT_CONFIG \
  94. { \
  95. .scl = 31, \
  96. .sda = 31, \
  97. .frequency = (nrf_twim_frequency_t)NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY, \
  98. .interrupt_priority = NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY, \
  99. .hold_bus_uninit = NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT, \
  100. }
  101. /** @brief Flag indicating that TX buffer address will be incremented after the transfer. */
  102. #define NRFX_TWIM_FLAG_TX_POSTINC (1UL << 0)
  103. /** @brief Flag indicating that RX buffer address will be incremented after the transfer. */
  104. #define NRFX_TWIM_FLAG_RX_POSTINC (1UL << 1)
  105. /** @brief Flag indicating that the interrupt after each transfer will be suppressed, and the event handler will not be called. */
  106. #define NRFX_TWIM_FLAG_NO_XFER_EVT_HANDLER (1UL << 2)
  107. /** @brief Flag indicating that the transfer will be set up, but not started. */
  108. #define NRFX_TWIM_FLAG_HOLD_XFER (1UL << 3)
  109. /** @brief Flag indicating that the transfer will be executed multiple times. */
  110. #define NRFX_TWIM_FLAG_REPEATED_XFER (1UL << 4)
  111. /** @brief Flag indicating that the TX transfer will not end with a stop condition. */
  112. #define NRFX_TWIM_FLAG_TX_NO_STOP (1UL << 5)
  113. /** @brief Flag indicating that checks for spurious STOP condition will not be performed. */
  114. #define NRFX_TWIM_FLAG_NO_SPURIOUS_STOP_CHECK (1UL << 6)
  115. /** @brief TWI master driver event types. */
  116. typedef enum
  117. {
  118. NRFX_TWIM_EVT_DONE, ///< Transfer completed event.
  119. NRFX_TWIM_EVT_ADDRESS_NACK, ///< Error event: NACK received after sending the address.
  120. NRFX_TWIM_EVT_DATA_NACK, ///< Error event: NACK received after sending a data byte.
  121. NRFX_TWIM_EVT_OVERRUN, ///< Error event: The unread data is replaced by new data.
  122. NRFX_TWIM_EVT_BUS_ERROR ///< Error event: An unexpected transition occurred on the bus.
  123. } nrfx_twim_evt_type_t;
  124. /** @brief TWI master driver transfer types. */
  125. typedef enum
  126. {
  127. NRFX_TWIM_XFER_TX, ///< TX transfer.
  128. NRFX_TWIM_XFER_RX, ///< RX transfer.
  129. NRFX_TWIM_XFER_TXRX, ///< TX transfer followed by RX transfer with repeated start.
  130. NRFX_TWIM_XFER_TXTX ///< TX transfer followed by TX transfer with repeated start.
  131. } nrfx_twim_xfer_type_t;
  132. /** @brief Structure for a TWI transfer descriptor. */
  133. typedef struct
  134. {
  135. nrfx_twim_xfer_type_t type; ///< Type of transfer.
  136. uint8_t address; ///< Slave address.
  137. size_t primary_length; ///< Number of bytes transferred.
  138. size_t secondary_length; ///< Number of bytes transferred.
  139. uint8_t * p_primary_buf; ///< Pointer to transferred data.
  140. uint8_t * p_secondary_buf; ///< Pointer to transferred data.
  141. } nrfx_twim_xfer_desc_t;
  142. /** @brief Macro for setting the TX transfer descriptor. */
  143. #define NRFX_TWIM_XFER_DESC_TX(addr, p_data, length) \
  144. { \
  145. .type = NRFX_TWIM_XFER_TX, \
  146. .address = (addr), \
  147. .primary_length = (length), \
  148. .secondary_length = 0, \
  149. .p_primary_buf = (p_data), \
  150. .p_secondary_buf = NULL, \
  151. }
  152. /** @brief Macro for setting the RX transfer descriptor. */
  153. #define NRFX_TWIM_XFER_DESC_RX(addr, p_data, length) \
  154. { \
  155. .type = NRFX_TWIM_XFER_RX, \
  156. .address = (addr), \
  157. .primary_length = (length), \
  158. .secondary_length = 0, \
  159. .p_primary_buf = (p_data), \
  160. .p_secondary_buf = NULL, \
  161. }
  162. /** @brief Macro for setting the TX-RX transfer descriptor. */
  163. #define NRFX_TWIM_XFER_DESC_TXRX(addr, p_tx, tx_len, p_rx, rx_len) \
  164. { \
  165. .type = NRFX_TWIM_XFER_TXRX, \
  166. .address = (addr), \
  167. .primary_length = (tx_len), \
  168. .secondary_length = (rx_len), \
  169. .p_primary_buf = (p_tx), \
  170. .p_secondary_buf = (p_rx), \
  171. }
  172. /** @brief Macro for setting the TX-TX transfer descriptor. */
  173. #define NRFX_TWIM_XFER_DESC_TXTX(addr, p_tx, tx_len, p_tx2, tx_len2) \
  174. { \
  175. .type = NRFX_TWIM_XFER_TXTX, \
  176. .address = (addr), \
  177. .primary_length = (tx_len), \
  178. .secondary_length = (tx_len2), \
  179. .p_primary_buf = (p_tx), \
  180. .p_secondary_buf = (p_tx2), \
  181. }
  182. /** @brief Structure for a TWI event. */
  183. typedef struct
  184. {
  185. nrfx_twim_evt_type_t type; ///< Event type.
  186. nrfx_twim_xfer_desc_t xfer_desc; ///< Transfer details.
  187. } nrfx_twim_evt_t;
  188. /** @brief TWI event handler prototype. */
  189. typedef void (* nrfx_twim_evt_handler_t)(nrfx_twim_evt_t const * p_event,
  190. void * p_context);
  191. /**
  192. * @brief Function for initializing the TWI driver instance.
  193. *
  194. * @param[in] p_instance Pointer to the driver instance structure.
  195. * @param[in] p_config Pointer to the structure with the initial configuration.
  196. * @param[in] event_handler Event handler provided by the user. If NULL, blocking mode is enabled.
  197. * @param[in] p_context Context passed to event handler.
  198. *
  199. * @retval NRFX_SUCCESS Initialization was successful.
  200. * @retval NRFX_ERROR_INVALID_STATE The driver is in invalid state.
  201. * @retval NRFX_ERROR_BUSY Some other peripheral with the same
  202. * instance ID is already in use. This is
  203. * possible only if @ref nrfx_prs module
  204. * is enabled.
  205. */
  206. nrfx_err_t nrfx_twim_init(nrfx_twim_t const * p_instance,
  207. nrfx_twim_config_t const * p_config,
  208. nrfx_twim_evt_handler_t event_handler,
  209. void * p_context);
  210. /**
  211. * @brief Function for uninitializing the TWI instance.
  212. *
  213. * @param[in] p_instance Pointer to the driver instance structure.
  214. */
  215. void nrfx_twim_uninit(nrfx_twim_t const * p_instance);
  216. /**
  217. * @brief Function for enabling the TWI instance.
  218. *
  219. * @param[in] p_instance Pointer to the driver instance structure.
  220. */
  221. void nrfx_twim_enable(nrfx_twim_t const * p_instance);
  222. /**
  223. * @brief Function for disabling the TWI instance.
  224. *
  225. * @param[in] p_instance Pointer to the driver instance structure.
  226. */
  227. void nrfx_twim_disable(nrfx_twim_t const * p_instance);
  228. /**
  229. * @brief Function for sending data to a TWI slave.
  230. *
  231. * The transmission will be stopped when an error occurs. If a transfer is ongoing,
  232. * the function returns the error code @ref NRFX_ERROR_BUSY.
  233. *
  234. * @note This function is deprecated. Use @ref nrfx_twim_xfer instead.
  235. *
  236. * @note Peripherals using EasyDMA (including TWIM) require the transfer buffers
  237. * to be placed in the Data RAM region. If this condition is not met,
  238. * this function fails with the error code NRFX_ERROR_INVALID_ADDR.
  239. *
  240. * @param[in] p_instance Pointer to the driver instance structure.
  241. * @param[in] address Address of a specific slave device (only 7 LSB).
  242. * @param[in] p_data Pointer to a transmit buffer.
  243. * @param[in] length Number of bytes to send. Maximum possible length is
  244. * dependent on the used SoC (see the MAXCNT register
  245. * description in the Product Specification). The driver
  246. * checks it with assertion.
  247. * @param[in] no_stop If set, the stop condition is not generated on the bus
  248. * after the transfer has completed successfully (allowing
  249. * for a repeated start in the next transfer).
  250. *
  251. * @retval NRFX_SUCCESS The procedure is successful.
  252. * @retval NRFX_ERROR_BUSY The driver is not ready for a new transfer.
  253. * @retval NRFX_ERROR_INTERNAL An unexpected transition occurred on the bus.
  254. * @retval NRFX_ERROR_INVALID_ADDR The provided buffer is not placed in the Data RAM region.
  255. * @retval NRFX_ERROR_DRV_TWI_ERR_ANACK NACK is received after sending the address in polling mode.
  256. * @retval NRFX_ERROR_DRV_TWI_ERR_DNACK NACK is received after sending a data byte in polling mode.
  257. */
  258. nrfx_err_t nrfx_twim_tx(nrfx_twim_t const * p_instance,
  259. uint8_t address,
  260. uint8_t const * p_data,
  261. size_t length,
  262. bool no_stop);
  263. /**
  264. * @brief Function for reading data from a TWI slave.
  265. *
  266. * The transmission will be stopped when an error occurs. If a transfer is ongoing,
  267. * the function returns the error code @ref NRFX_ERROR_BUSY.
  268. *
  269. * @note This function is deprecated. Use @ref nrfx_twim_xfer instead.
  270. *
  271. * @param[in] p_instance Pointer to the driver instance structure.
  272. * @param[in] address Address of a specific slave device (only 7 LSB).
  273. * @param[in] p_data Pointer to a receive buffer.
  274. * @param[in] length Number of bytes to be received. Maximum possible length
  275. * is dependent on the used SoC (see the MAXCNT register
  276. * description in the Product Specification). The driver
  277. * checks it with assertion.
  278. *
  279. * @retval NRFX_SUCCESS The procedure is successful.
  280. * @retval NRFX_ERROR_BUSY The driver is not ready for a new transfer.
  281. * @retval NRFX_ERROR_INTERNAL An unexpected transition occurred on the bus.
  282. * @retval NRFX_ERROR_DRV_TWI_ERR_OVERRUN The unread data is replaced by new data.
  283. * @retval NRFX_ERROR_DRV_TWI_ERR_ANACK NACK is received after sending the address in polling mode.
  284. * @retval NRFX_ERROR_DRV_TWI_ERR_DNACK NACK is received after sending a data byte in polling mode.
  285. */
  286. nrfx_err_t nrfx_twim_rx(nrfx_twim_t const * p_instance,
  287. uint8_t address,
  288. uint8_t * p_data,
  289. size_t length);
  290. /**
  291. * @brief Function for performing a TWI transfer.
  292. *
  293. * The following transfer types can be configured (@ref nrfx_twim_xfer_desc_t::type):
  294. * - @ref NRFX_TWIM_XFER_TXRX - Write operation followed by a read operation (without STOP condition in between).
  295. * - @ref NRFX_TWIM_XFER_TXTX - Write operation followed by a write operation (without STOP condition in between).
  296. * - @ref NRFX_TWIM_XFER_TX - Write operation (with or without STOP condition).
  297. * - @ref NRFX_TWIM_XFER_RX - Read operation (with STOP condition).
  298. *
  299. * @note TX-RX and TX-TX transfers are supported only in non-blocking mode.
  300. *
  301. * Additional options are provided using the flags parameter:
  302. * - @ref NRFX_TWIM_FLAG_TX_POSTINC and @ref NRFX_TWIM_FLAG_RX_POSTINC - Post-incrementation of buffer addresses.
  303. * - @ref NRFX_TWIM_FLAG_NO_XFER_EVT_HANDLER - No user event handler after the transfer completion. In most cases, this also means no interrupt at the end of the transfer.
  304. * - @ref NRFX_TWIM_FLAG_HOLD_XFER - Driver is not starting the transfer. Use this flag if the transfer is triggered externally by PPI.
  305. * Use @ref nrfx_twim_start_task_get to get the address of the start task.
  306. * - @ref NRFX_TWIM_FLAG_REPEATED_XFER - Prepare for repeated transfers. You can set up a number of transfers that will be triggered externally (for example by PPI).
  307. * An example is a TXRX transfer with the options @ref NRFX_TWIM_FLAG_RX_POSTINC, @ref NRFX_TWIM_FLAG_NO_XFER_EVT_HANDLER, and @ref NRFX_TWIM_FLAG_REPEATED_XFER.
  308. * After the transfer is set up, a set of transfers can be triggered by PPI that will read, for example, the same register of an
  309. * external component and put it into a RAM buffer without any interrupts. @ref nrfx_twim_stopped_event_get can be used to get the
  310. * address of the STOPPED event, which can be used to count the number of transfers. If @ref NRFX_TWIM_FLAG_REPEATED_XFER is used,
  311. * the driver does not set the driver instance into busy state, so you must ensure that the next transfers are set up
  312. * when TWIM is not active.
  313. * - @ref NRFX_TWIM_FLAG_TX_NO_STOP - No stop condition after the TX transfer.
  314. * - @ref NRFX_TWIM_FLAG_NO_SPURIOUS_STOP_CHECK - Checks for spurious STOP conditions are disabled.
  315. * Used together with @ref NRFX_TWIM_FLAG_NO_XFER_EVT_HANDLER can result in lower power consumption
  316. * when transfers are triggered externally and CPU is sleeping.
  317. * Use only with I2C standard-compliant slave devices.
  318. *
  319. * @note
  320. * Some flag combinations are invalid:
  321. * - @ref NRFX_TWIM_FLAG_TX_NO_STOP with @ref nrfx_twim_xfer_desc_t::type different than @ref NRFX_TWIM_XFER_TX
  322. * - @ref NRFX_TWIM_FLAG_REPEATED_XFER with @ref nrfx_twim_xfer_desc_t::type set to @ref NRFX_TWIM_XFER_TXTX
  323. *
  324. * If @ref nrfx_twim_xfer_desc_t::type is set to @ref NRFX_TWIM_XFER_TX and the @ref NRFX_TWIM_FLAG_TX_NO_STOP and @ref NRFX_TWIM_FLAG_REPEATED_XFER
  325. * flags are set, two tasks must be used to trigger a transfer: TASKS_RESUME followed by TASKS_STARTTX. If no stop condition is generated,
  326. * TWIM is in SUSPENDED state. Therefore, it must be resumed before the transfer can be started.
  327. *
  328. * @note Peripherals using EasyDMA (including TWIM) require the transfer buffers
  329. * to be placed in the Data RAM region. If this condition is not met,
  330. * this function will fail with the error code NRFX_ERROR_INVALID_ADDR.
  331. *
  332. * @param[in] p_instance Pointer to the driver instance structure.
  333. * @param[in] p_xfer_desc Pointer to the transfer descriptor.
  334. * @param[in] flags Transfer options (0 for default settings).
  335. *
  336. * @retval NRFX_SUCCESS The procedure is successful.
  337. * @retval NRFX_ERROR_BUSY The driver is not ready for a new transfer.
  338. * @retval NRFX_ERROR_NOT_SUPPORTED The provided parameters are not supported.
  339. * @retval NRFX_ERROR_INTERNAL An unexpected transition occurred on the bus.
  340. * @retval NRFX_ERROR_INVALID_ADDR The provided buffers are not placed in the Data RAM region.
  341. * @retval NRFX_ERROR_DRV_TWI_ERR_OVERRUN The unread data is replaced by new data.
  342. * @retval NRFX_ERROR_DRV_TWI_ERR_ANACK NACK is received after sending the address.
  343. * @retval NRFX_ERROR_DRV_TWI_ERR_DNACK NACK is received after sending a data byte.
  344. */
  345. nrfx_err_t nrfx_twim_xfer(nrfx_twim_t const * p_instance,
  346. nrfx_twim_xfer_desc_t const * p_xfer_desc,
  347. uint32_t flags);
  348. /**
  349. * @brief Function for checking the TWI driver state.
  350. *
  351. * @param[in] p_instance TWI instance.
  352. *
  353. * @retval true The TWI driver is currently busy performing a transfer.
  354. * @retval false The TWI driver is ready for a new transfer.
  355. */
  356. bool nrfx_twim_is_busy(nrfx_twim_t const * p_instance);
  357. /**
  358. * @brief Function for returning the address of a TWIM start task.
  359. *
  360. * This function is to be used if @ref nrfx_twim_xfer was called with the flag @ref NRFX_TWIM_FLAG_HOLD_XFER.
  361. * In that case, the transfer is not started by the driver, but it must be started externally by PPI.
  362. *
  363. * @param[in] p_instance Pointer to the driver instance structure.
  364. * @param[in] xfer_type Transfer type used in the last call of the @ref nrfx_twim_xfer function.
  365. *
  366. * @return Start task address (TX or RX) depending on the value of xfer_type.
  367. */
  368. uint32_t nrfx_twim_start_task_get(nrfx_twim_t const * p_instance, nrfx_twim_xfer_type_t xfer_type);
  369. /**
  370. * @brief Function for returning the address of a STOPPED TWIM event.
  371. *
  372. * A STOPPED event can be used to detect the end of a transfer if the @ref NRFX_TWIM_FLAG_NO_XFER_EVT_HANDLER
  373. * option is used.
  374. *
  375. * @param[in] p_instance Pointer to the driver instance structure.
  376. *
  377. * @return STOPPED event address.
  378. */
  379. uint32_t nrfx_twim_stopped_event_get(nrfx_twim_t const * p_instance);
  380. /**
  381. * @brief Function for recovering the bus.
  382. *
  383. * This function checks if the bus is not stuck because of a slave holding the SDA line in the low state,
  384. * and if needed it performs required number of pulses on the SCL line to make the slave release the SDA line.
  385. * Finally, the function generates a STOP condition on the bus to put it into a known state.
  386. *
  387. * @note This function can be used only if the TWIM driver is uninitialized.
  388. *
  389. * @param[in] scl_pin SCL pin number.
  390. * @param[in] sda_pin SDA pin number.
  391. *
  392. * @retval NRFX_SUCCESS Bus recovery was successful.
  393. * @retval NRFX_ERROR_INTERNAL Bus recovery failed.
  394. */
  395. __STATIC_INLINE nrfx_err_t nrfx_twim_bus_recover(uint32_t scl_pin, uint32_t sda_pin);
  396. #ifndef SUPPRESS_INLINE_IMPLEMENTATION
  397. __STATIC_INLINE nrfx_err_t nrfx_twim_bus_recover(uint32_t scl_pin, uint32_t sda_pin)
  398. {
  399. return nrfx_twi_twim_bus_recover(scl_pin, sda_pin);
  400. }
  401. #endif
  402. /** @} */
  403. void nrfx_twim_0_irq_handler(void);
  404. void nrfx_twim_1_irq_handler(void);
  405. void nrfx_twim_2_irq_handler(void);
  406. void nrfx_twim_3_irq_handler(void);
  407. #ifdef __cplusplus
  408. }
  409. #endif
  410. #endif // NRFX_TWIM_H__