mbed(SerialHalfDuplex入り)

Fork of mbed by mbed official

Revision:
92:4fc01daae5a5
Parent:
89:552587b429a1
--- a/TARGET_ARCH_BLE/TARGET_NORDIC/TARGET_MCU_NRF51822/objects.h	Wed Oct 29 11:02:04 2014 +0000
+++ b/TARGET_ARCH_BLE/TARGET_NORDIC/TARGET_MCU_NRF51822/objects.h	Thu Nov 27 13:33:22 2014 +0000
@@ -25,6 +25,16 @@
 extern "C" {
 #endif
 
+#define I2C_SPI_PERIPHERAL_FOR_I2C      1
+#define I2C_SPI_PERIPHERAL_FOR_SPI      2
+
+typedef struct {
+    uint8_t usage;   // I2C: 1, SPI: 2
+    uint8_t sda_mosi;
+    uint8_t scl_miso;
+    uint8_t sclk;
+} i2c_spi_peripheral_t;
+
 struct serial_s {
     NRF_UART_Type *uart;
     int index;
@@ -33,6 +43,7 @@
 struct spi_s {
     NRF_SPI_Type *spi;
     NRF_SPIS_Type *spis;
+    uint8_t peripheral;
 };
 
 struct port_s {
@@ -54,6 +65,7 @@
     PinName scl;
     int freq;
     uint8_t address_set;
+    uint8_t peripheral;
 };
 
 struct analogin_s {