The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Revision:
111:4336505e4b1c
Parent:
104:b9ad9a133dc7
--- a/TARGET_WALLBOT_BLE/TARGET_NORDIC/TARGET_MCU_NRF51822/twi_master.h	Wed Nov 25 13:21:40 2015 +0000
+++ b/TARGET_WALLBOT_BLE/TARGET_NORDIC/TARGET_MCU_NRF51822/twi_master.h	Tue Dec 15 14:39:38 2015 +0000
@@ -23,6 +23,8 @@
 #include <stdbool.h>
 #include <stdint.h>
 
+#include "nrf51.h"
+
 /** @file
 * @brief Software controlled TWI Master driver.
 *
@@ -68,11 +70,12 @@
  *
  * Both pins are configured as Standard-0, No-drive-1 (open drain).
  *
+ * @param twi The TWI interface to use - either NRF_TWI0 or NRF_TWI1
  * @return
  * @retval true TWI bus is clear for transfers.
  * @retval false TWI bus is stuck.
  */
-bool twi_master_init_and_clear(void);
+bool twi_master_init_and_clear(NRF_TWI_Type* twi);
 
 /**
  * @brief Function for transferring data over TWI bus.
@@ -90,11 +93,12 @@
  * @param data Pointer to data.
  * @param data_length Number of bytes to transfer.
  * @param issue_stop_condition If @ref TWI_ISSUE_STOP, STOP condition is issued before exiting function. If @ref TWI_DONT_ISSUE_STOP, STOP condition is not issued before exiting function. If transfer failed for any reason, STOP condition will be issued in any case.
+ * @param twi The TWI interface to use - either NRF_TWI0 or NRF_TWI1
  * @return
  * @retval true Data transfer succeeded without errors.
  * @retval false Data transfer failed.
  */
-bool twi_master_transfer(uint8_t address, uint8_t *data, uint8_t data_length, bool issue_stop_condition);
+bool twi_master_transfer(uint8_t address, uint8_t *data, uint8_t data_length, bool issue_stop_condition, NRF_TWI_Type* twi);
 
 /**
  *@}