├── .gitignore ├── LICENSE ├── Makefile ├── Package.swift ├── README.md ├── Sources ├── CUSB │ ├── include │ │ └── libusb.h │ └── libusb_bridge.c └── I2C │ ├── BusDevice.swift │ ├── I2CDevice.swift │ └── USBI2C.swift ├── Tests ├── I2CTests │ └── I2CTests.swift └── LinuxMain.swift └── Xcode ├── I2C ├── I2C.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── I2C │ ├── I2C.h │ └── Info.plist └── I2CTests │ └── Info.plist └── modulemaps └── CUSB └── module.map /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata 6 | *.xcuserdatad -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Yusuke Ito 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BUILD_OPTS=-Xlinker -L/usr/lib 2 | 3 | SWIFTC=swiftc 4 | SWIFT=swift 5 | ifdef SWIFTPATH 6 | SWIFTC=$(SWIFTPATH)/bin/swiftc 7 | SWIFT=$(SWIFTPATH)/bin/swift 8 | endif 9 | 10 | OS := $(shell uname) 11 | ifeq ($(OS),Darwin) 12 | SWIFTC=xcrun -sdk macosx swiftc 13 | LIBXMLBASE=$(shell xcrun --show-sdk-path) 14 | BUILD_OPTS=-Xlinker -L/usr/local/lib -Xcc -I/usr/local/include -Xlinker -lusb 15 | endif 16 | 17 | all: debug 18 | 19 | release: CONF_ENV=release 20 | release: build_; 21 | 22 | debug: CONF_ENV=debug 23 | debug: build_; 24 | 25 | build_: 26 | $(SWIFT) build --configuration $(CONF_ENV) $(BUILD_OPTS) 27 | 28 | clean: 29 | $(SWIFT) package clean 30 | 31 | distclean: 32 | $(SWIFT) package reset 33 | 34 | test: 35 | $(SWIFT) test $(BUILD_OPTS) 36 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | import PackageDescription 2 | 3 | 4 | let package = Package( 5 | name: "I2C", 6 | targets: [ 7 | Target(name: "I2C", dependencies: ["CUSB"]), 8 | Target(name: "CUSB") 9 | ], 10 | dependencies: [ 11 | .Package(url: "https://www.github.com/sixtyfiveford/Ci2c.swift.git", majorVersion: 1), 12 | ], 13 | exclude: ["Xcode"] 14 | ) 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # i2c-swift 2 | 3 | I2C Bus Library for Swift 4 | 5 | ## Supported Platform 6 | 7 | * [I2C tiny USB](https://github.com/novi/i2c_tiny_usb) adapter (Mac, Linux) 8 | * I2C Kernel device (/dev/i2c-*) (Linux, Raspberry Pi etc...) 9 | 10 | ## Building 11 | 12 | Install libusb package. 13 | 14 | ### macOS 15 | 16 | ``` 17 | $ brew install libusb-compat libusb 18 | ``` 19 | 20 | ### Linux(Ubuntu 16.04) 21 | 22 | 23 | ``` 24 | $ sudo apt-get install i2c-tools libi2c-dev 25 | ``` 26 | 27 | ## Usage 28 | 29 | ```swift 30 | // create a device (see table below.) 31 | let device = try I2CTinyUSB() 32 | // or 33 | let device = try I2CBusDevice(portNumber: 0) 34 | 35 | // write data and read 5 bytes of data to slave address 0x23 36 | let readData = try device.write(toAddress: 0x23, data: dataToWrite, readBytes: 5) 37 | readData.count == 5 // true 38 | 39 | ``` 40 | 41 | | Platform | Bus connection | Driver | Class | 42 | |----------|--------------------------|--------------|----------------| 43 | | macOS | I2C tiny USB | libusb | `I2CTinyUSB` | 44 | | Linux | I2C tiny USB | libusb | not supported, use `/dev/i2c-*` | 45 | | Linux | I2C tiny USB | `/dev/i2c-*` | `I2CBusDevice` | 46 | | Linux | Native I2C bus (on GPIO) | `/dev/i2c-*` | `I2CBusDevice` | 47 | 48 | See [demo project](https://github.com/novi/i2c-swift-example) for every platform. 49 | 50 | -------------------------------------------------------------------------------- /Sources/CUSB/include/libusb.h: -------------------------------------------------------------------------------- 1 | #if __APPLE__ 2 | #include 3 | #endif -------------------------------------------------------------------------------- /Sources/CUSB/libusb_bridge.c: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Sources/I2C/BusDevice.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BusDevice.swift 3 | // I2C 4 | // 5 | // Created by Yusuke Ito on 12/17/16. 6 | // Copyright © 2016 Yusuke Ito. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // https://www.kernel.org/doc/Documentation/i2c/dev-interface 12 | // http://matsup.blogspot.jp/2015/03/physical-computing-intel-edison-i2c_14.html 13 | 14 | 15 | 16 | #if os(Linux) 17 | 18 | import Ci2c 19 | 20 | 21 | public final class I2CBusDevice: I2CDevice { 22 | 23 | public enum I2CError: Error { 24 | case deviceOpenError(portNumber: UInt8, returns: Int32, errno: Int32) 25 | case slaveAddressSetError(Int32, Int32) 26 | case readOrWriteError(Int32, Int32) 27 | case noAckError(Int32, Int32) 28 | } 29 | 30 | private var currentAddress: UInt8 = 0 31 | 32 | private func chageAddressIfNeeded(_ newAddress: UInt8) throws { 33 | guard currentAddress != newAddress else { 34 | return 35 | } 36 | let status = ioctl(i2c, UInt(I2C_SLAVE), CInt(newAddress)) 37 | guard status == 0 else { 38 | throw I2CError.slaveAddressSetError(status, errno) 39 | } 40 | self.currentAddress = newAddress 41 | } 42 | 43 | 44 | private let i2c: CInt 45 | 46 | public init(portNumber: UInt8) throws { 47 | let fd = open("/dev/i2c-\(portNumber)", O_RDWR) 48 | guard fd != -1 else { 49 | throw I2CError.deviceOpenError(portNumber: portNumber, returns: fd, errno: errno) 50 | } 51 | self.i2c = fd 52 | } 53 | 54 | public func closeDevice() { 55 | close(i2c) 56 | } 57 | 58 | public func write(toAddress: UInt8, data: [UInt8], readBytes: UInt32) throws -> [UInt8] { 59 | 60 | // send only start, stop 61 | if data.count == 0 && readBytes == 0 { 62 | try chageAddressIfNeeded(toAddress) 63 | 64 | let response = i2c_smbus_write_quick(i2c, UInt8(I2C_SMBUS_WRITE)) 65 | if response < 0 { 66 | throw I2CError.noAckError(response, errno) 67 | } 68 | return [] 69 | } 70 | 71 | let writeLength = data.count 72 | 73 | var messageLength = 0 74 | if writeLength > 0 { 75 | messageLength += 1 76 | } 77 | if readBytes > 0 { 78 | messageLength += 1 79 | } 80 | 81 | var messageIndex = 0 82 | var messages = [i2c_msg](repeating: i2c_msg(), count: messageLength) 83 | 84 | var writePtr: UnsafeMutableRawPointer? = nil 85 | if writeLength > 0 { 86 | writePtr = UnsafeMutableRawPointer.allocate(bytes: Int(data.count), alignedTo: MemoryLayout.alignment) 87 | //defer { 88 | // writePtr.deallocate(bytes: Int(data.count), alignedTo: MemoryLayout.alignment) 89 | //} 90 | var indexW = 0 91 | let writeBuf = writePtr!.bindMemory(to: UInt8.self, capacity: data.count) 92 | for d in data { 93 | writeBuf[indexW] = d 94 | indexW += 1 95 | } 96 | 97 | messages[messageIndex].addr = UInt16(toAddress) 98 | messages[messageIndex].flags = 0 // Write mode 99 | messages[messageIndex].len = Int16(data.count) 100 | messages[messageIndex].buf = writePtr!.assumingMemoryBound(to: Int8.self) 101 | 102 | messageIndex += 1 103 | } 104 | 105 | var readPtr: UnsafeMutableRawPointer? = nil 106 | if readBytes > 0 { 107 | readPtr = UnsafeMutableRawPointer.allocate(bytes: Int(readBytes), alignedTo: MemoryLayout.alignment) 108 | messages[messageIndex].addr = UInt16(toAddress) 109 | messages[messageIndex].flags = UInt16(I2C_M_RD) 110 | messages[messageIndex].len = Int16(readBytes) 111 | messages[messageIndex].buf = readPtr!.assumingMemoryBound(to: Int8.self) 112 | } 113 | 114 | var packets = i2c_rdwr_ioctl_data(msgs: &messages, nmsgs: UInt32(messages.count)) 115 | let status = ioctl(i2c, UInt(I2C_RDWR), &packets) 116 | guard status >= 0 else { 117 | throw I2CError.readOrWriteError(status, errno) 118 | } 119 | 120 | if let ptr = writePtr { 121 | ptr.deallocate(bytes: Int(data.count), alignedTo: MemoryLayout.alignment) 122 | } 123 | 124 | if let ptr = readPtr { 125 | let bbuf = UnsafeBufferPointer(start: ptr.assumingMemoryBound(to: UInt8.self), count: Int(readBytes)) 126 | let arr = Array(bbuf) 127 | ptr.deallocate(bytes: Int(readBytes), alignedTo: MemoryLayout.alignment) 128 | return arr 129 | } 130 | return [] 131 | } 132 | } 133 | 134 | #endif 135 | -------------------------------------------------------------------------------- /Sources/I2C/I2CDevice.swift: -------------------------------------------------------------------------------- 1 | // 2 | // I2C.swift 3 | // i2clib 4 | // 5 | // Created by Yusuke Ito on 12/14/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol I2CDevice { 12 | 13 | func write(toAddress: UInt8, data: [UInt8]) throws 14 | func read(toAddress: UInt8, readBytes: UInt32) throws -> [UInt8] 15 | 16 | // write then read (no STOP condition between write and read) 17 | // data.count == 0 (empty) -> only reading 18 | // readBytes == 0 -> only writing 19 | // the both data.count and readBytes == 0 -> only receiving ack 20 | // return buffer's count should be `readBytes` 21 | func write(toAddress: UInt8, data: [UInt8], readBytes: UInt32) throws -> [UInt8] 22 | } 23 | 24 | public extension I2CDevice { 25 | 26 | func write(toAddress: UInt8, data: [UInt8]) throws { 27 | _ = try write(toAddress: toAddress, data: data, readBytes: 0) 28 | } 29 | 30 | func read(toAddress: UInt8, readBytes: UInt32) throws -> [UInt8] { 31 | return try write(toAddress: toAddress, data: [], readBytes: readBytes) 32 | } 33 | } 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Sources/I2C/USBI2C.swift: -------------------------------------------------------------------------------- 1 | // 2 | // USBI2C.swift 3 | // i2clib 4 | // 5 | // Created by Yusuke Ito on 12/14/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | #if os(macOS) 12 | 13 | import CUSB 14 | 15 | extension String { 16 | init?(tupleCString tuple: Any) { 17 | let mirror = Mirror(reflecting: tuple) 18 | 19 | var buffer = [CChar](repeating: 0, count: Int(mirror.children.count)) 20 | var index = 0 21 | for c in mirror.children { 22 | buffer[index] = c.value as? CChar ?? 0 23 | index += 1 24 | } 25 | self.init(utf8String: buffer) 26 | } 27 | } 28 | 29 | fileprivate func findDevice(vendor: UInt16, product: UInt16) -> UnsafeMutablePointer? { 30 | usb_find_busses() 31 | usb_find_devices() 32 | guard var bus = usb_get_busses() else { 33 | return nil 34 | } 35 | while true { 36 | // has valid device 37 | if var dev = bus.pointee.devices { 38 | while true { 39 | 40 | //print("dirname", String(tupleCString: bus.pointee.dirname)) 41 | //print("filename", String(tupleCString: dev.pointee.filename)) 42 | 43 | if dev.pointee.descriptor.idVendor == vendor && 44 | dev.pointee.descriptor.idProduct == product { 45 | return dev 46 | } 47 | 48 | if let next = dev.pointee.next { 49 | dev = next 50 | } else { 51 | break 52 | } 53 | } 54 | } 55 | if let next = bus.pointee.next { 56 | // has next bus 57 | bus = next 58 | continue 59 | } else { 60 | break 61 | } 62 | } 63 | return nil 64 | } 65 | 66 | public final class I2CTinyUSB { 67 | 68 | public enum USBDeviceError: Error { 69 | case USBDeviceOpenError 70 | case USBControlMessageSendError 71 | case I2CTinyUSBNotFound 72 | case USBI2CWriteError 73 | case USBI2CReadError 74 | case USBI2CNoAckError 75 | } 76 | 77 | private static var usbInitialized: Bool = false 78 | private static func usbInit() { 79 | guard usbInitialized == false else { 80 | return 81 | } 82 | usbInitialized = true 83 | usb_init() 84 | } 85 | 86 | private static let VendorID: UInt16 = 0x0403 87 | private static let ProductID: UInt16 = 0xc631 88 | 89 | fileprivate let USB_CTRL_IN = (USB_TYPE_CLASS | USB_ENDPOINT_IN) 90 | fileprivate let USB_CTRL_OUT = (USB_TYPE_CLASS) 91 | fileprivate let CMD_ECHO = 0 as Int32 92 | fileprivate let CMD_GET_FUNC = 1 as Int32 93 | fileprivate let CMD_SET_DELAY = 2 as Int32 94 | fileprivate let CMD_GET_STATUS = 3 as Int32 95 | fileprivate let CMD_I2C_IO = 4 as Int32 96 | fileprivate let CMD_I2C_BEGIN = 1 as Int32 // flag to I2C_IO 97 | fileprivate let CMD_I2C_END = 2 as Int32 // flag to I2C_IO 98 | fileprivate let I2C_M_RD = 0x01 as Int32 99 | 100 | fileprivate let TimeoutControl = 1000 as Int32 101 | fileprivate let TimeoutI2CBus = 1000 as Int32 102 | 103 | fileprivate let usb: OpaquePointer 104 | public init() throws { 105 | type(of: self).usbInit() 106 | 107 | guard let dev = findDevice(vendor: type(of: self).VendorID, product: type(of: self).ProductID) else { 108 | throw USBDeviceError.I2CTinyUSBNotFound 109 | } 110 | guard let handler = usb_open(dev) else { 111 | throw USBDeviceError.USBDeviceOpenError 112 | } 113 | self.usb = handler 114 | 115 | //let funcVal = String(format: "%lx", try getFunc()) 116 | //try print("func=\(funcVal), status=\(getStatus())") 117 | 118 | try usbSet(cmd: CMD_SET_DELAY, value: 10) 119 | } 120 | 121 | public func closeDevice() { 122 | usb_release_interface(usb, 0) 123 | usb_close(usb) 124 | } 125 | } 126 | 127 | fileprivate extension I2CTinyUSB { 128 | 129 | func usbRead(cmd: Int32, outBuffer: UnsafeMutablePointer, length: UInt32) throws { 130 | let bytesRead = usb_control_msg(usb, USB_CTRL_IN, cmd, 0, 0, outBuffer, Int32(length), TimeoutControl) 131 | if bytesRead < 0 { 132 | throw USBDeviceError.USBControlMessageSendError 133 | } 134 | } 135 | 136 | func usbSet(cmd: Int32, value: Int32) throws { 137 | let nBytes = usb_control_msg(usb, USB_TYPE_VENDOR, cmd, value, 0, nil, 0, TimeoutControl) 138 | if nBytes < 0 { 139 | throw USBDeviceError.USBControlMessageSendError 140 | } 141 | } 142 | 143 | enum Status: Int { 144 | case idle = 0 145 | case addressACK = 1 146 | case addressNAK = 2 147 | } 148 | 149 | func getFunc() throws -> UInt32 { 150 | let buffer = UnsafeMutablePointer.allocate(capacity: 1) 151 | defer { 152 | buffer.deallocate(capacity: 1) 153 | } 154 | try usbRead(cmd: CMD_GET_FUNC, outBuffer: unsafeBitCast(buffer, to: UnsafeMutablePointer.self), length: UInt32(MemoryLayout.size)) 155 | return buffer.pointee 156 | } 157 | 158 | func getStatus() throws -> Status { 159 | let buffer = UnsafeMutablePointer.allocate(capacity: 1) 160 | defer { 161 | buffer.deallocate(capacity: 1) 162 | } 163 | try usbRead(cmd: CMD_GET_STATUS, outBuffer: unsafeBitCast(buffer, to: UnsafeMutablePointer.self), length: 1) 164 | guard let status = Status(rawValue: Int(buffer.pointee)) else { 165 | throw USBDeviceError.USBControlMessageSendError 166 | } 167 | return status 168 | } 169 | } 170 | 171 | extension I2CTinyUSB { 172 | 173 | fileprivate func sendAck(addr: UInt8) throws { 174 | let nBytes = usb_control_msg(usb, USB_CTRL_IN, CMD_I2C_IO + CMD_I2C_BEGIN + CMD_I2C_END, 0, Int32(addr), nil, 0, TimeoutControl) 175 | if nBytes < 0 { 176 | throw USBDeviceError.USBControlMessageSendError 177 | } 178 | if try getStatus() == .addressACK { 179 | return 180 | } 181 | throw USBDeviceError.USBI2CNoAckError 182 | } 183 | } 184 | 185 | extension I2CTinyUSB: I2CDevice { 186 | 187 | private func write(toAddress: UInt8, data: [UInt8], sendStop: Bool) throws { 188 | var buffer = unsafeBitCast(data, to: [Int8].self) 189 | // start control flow, (end control flow if no reading) 190 | let nBytes = usb_control_msg(usb, USB_CTRL_OUT, CMD_I2C_IO + CMD_I2C_BEGIN + (sendStop ? CMD_I2C_END : 0), 0, Int32(toAddress), &buffer, Int32(data.count), TimeoutControl) 191 | if nBytes < 0 { 192 | throw USBDeviceError.USBI2CWriteError 193 | } 194 | // check ACK 195 | if try getStatus() != .addressACK { 196 | throw USBDeviceError.USBI2CNoAckError 197 | } 198 | } 199 | 200 | public func write(toAddress: UInt8, data: [UInt8], readBytes: UInt32) throws -> [UInt8] { 201 | 202 | if data.count == 0 && readBytes == 0 { 203 | try sendAck(addr: toAddress) 204 | return [] 205 | } 206 | 207 | let writeLength = data.count 208 | 209 | if writeLength > 0 { 210 | // start control flow and write bytes 211 | try write(toAddress: toAddress, data: data, sendStop: readBytes == 0) 212 | } 213 | 214 | if readBytes > 0 { 215 | var readBuffer = [Int8](repeating: 0, count: Int(readBytes)) 216 | // read data and end control flow 217 | let nBytes = usb_control_msg(usb, USB_CTRL_IN, CMD_I2C_IO + (writeLength > 0 ? 0 : CMD_I2C_BEGIN) + CMD_I2C_END, I2C_M_RD, Int32(toAddress), &readBuffer, Int32(readBytes), TimeoutI2CBus) 218 | if nBytes < 0 { 219 | throw USBDeviceError.USBI2CReadError 220 | } 221 | if try getStatus() != .addressACK { 222 | throw USBDeviceError.USBI2CNoAckError 223 | } 224 | //print("read", readBuffer) 225 | return unsafeBitCast(readBuffer, to: [UInt8].self) 226 | } 227 | 228 | return [] 229 | } 230 | 231 | } 232 | 233 | #endif 234 | -------------------------------------------------------------------------------- /Tests/I2CTests/I2CTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import I2C 3 | 4 | #if os(Linux) 5 | public func getCurrentI2CDevice() throws -> I2CDevice { 6 | return try I2CBusDevice(portNumber: 0) 7 | } 8 | #else 9 | public func getCurrentI2CDevice() throws -> I2CDevice { 10 | return try I2CTinyUSB() 11 | } 12 | 13 | #endif 14 | 15 | 16 | final class I2CTests: XCTestCase { 17 | 18 | func testDeviceConnected() throws { 19 | 20 | let device = try getCurrentI2CDevice() 21 | 22 | XCTAssertTrue(try device.write(toAddress: 0x23, data: [], readBytes: 0) == []) 23 | 24 | //device.closeDevice() 25 | } 26 | 27 | 28 | static var allTests : [(String, (I2CTests) -> () throws -> Void)] { 29 | return [ 30 | ("testDeviceConnected", testDeviceConnected) 31 | ] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import I2CTests 3 | 4 | XCTMain([ 5 | testCase(I2CTests.allTests), 6 | ]) 7 | -------------------------------------------------------------------------------- /Xcode/I2C/I2C.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 528C6B661E0565CB006E6040 /* BusDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528C6B651E0565CB006E6040 /* BusDevice.swift */; }; 11 | 52BC0A461E050727008D74D7 /* I2C.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52BC0A3C1E050727008D74D7 /* I2C.framework */; }; 12 | 52BC0A4D1E050728008D74D7 /* I2C.h in Headers */ = {isa = PBXBuildFile; fileRef = 52BC0A3F1E050727008D74D7 /* I2C.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | 52BC0A591E050735008D74D7 /* I2CDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BC0A571E050735008D74D7 /* I2CDevice.swift */; }; 14 | 52BC0A5A1E050735008D74D7 /* USBI2C.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BC0A581E050735008D74D7 /* USBI2C.swift */; }; 15 | 52BC0A5E1E050742008D74D7 /* I2CTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BC0A5C1E050742008D74D7 /* I2CTests.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXContainerItemProxy section */ 19 | 52BC0A471E050727008D74D7 /* PBXContainerItemProxy */ = { 20 | isa = PBXContainerItemProxy; 21 | containerPortal = 52BC0A331E050727008D74D7 /* Project object */; 22 | proxyType = 1; 23 | remoteGlobalIDString = 52BC0A3B1E050727008D74D7; 24 | remoteInfo = I2C; 25 | }; 26 | /* End PBXContainerItemProxy section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | 528C6B651E0565CB006E6040 /* BusDevice.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BusDevice.swift; sourceTree = ""; }; 30 | 52BC0A3C1E050727008D74D7 /* I2C.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = I2C.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 52BC0A3F1E050727008D74D7 /* I2C.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = I2C.h; sourceTree = ""; }; 32 | 52BC0A401E050727008D74D7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | 52BC0A451E050727008D74D7 /* I2CTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = I2CTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 52BC0A4C1E050728008D74D7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 52BC0A571E050735008D74D7 /* I2CDevice.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = I2CDevice.swift; sourceTree = ""; }; 36 | 52BC0A581E050735008D74D7 /* USBI2C.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = USBI2C.swift; sourceTree = ""; }; 37 | 52BC0A5C1E050742008D74D7 /* I2CTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = I2CTests.swift; sourceTree = ""; }; 38 | 52BC0A5D1E050742008D74D7 /* LinuxMain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LinuxMain.swift; path = ../../../Tests/LinuxMain.swift; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 52BC0A381E050727008D74D7 /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | 52BC0A421E050727008D74D7 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | 52BC0A461E050727008D74D7 /* I2C.framework in Frameworks */, 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | 52BC0A321E050727008D74D7 = { 61 | isa = PBXGroup; 62 | children = ( 63 | 52BC0A3E1E050727008D74D7 /* I2C */, 64 | 52BC0A491E050728008D74D7 /* I2CTests */, 65 | 52BC0A3D1E050727008D74D7 /* Products */, 66 | ); 67 | sourceTree = ""; 68 | }; 69 | 52BC0A3D1E050727008D74D7 /* Products */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 52BC0A3C1E050727008D74D7 /* I2C.framework */, 73 | 52BC0A451E050727008D74D7 /* I2CTests.xctest */, 74 | ); 75 | name = Products; 76 | sourceTree = ""; 77 | }; 78 | 52BC0A3E1E050727008D74D7 /* I2C */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 52BC0A561E050735008D74D7 /* I2C */, 82 | 52BC0A3F1E050727008D74D7 /* I2C.h */, 83 | 52BC0A401E050727008D74D7 /* Info.plist */, 84 | ); 85 | path = I2C; 86 | sourceTree = ""; 87 | }; 88 | 52BC0A491E050728008D74D7 /* I2CTests */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 52BC0A5B1E050742008D74D7 /* I2CTests */, 92 | 52BC0A5D1E050742008D74D7 /* LinuxMain.swift */, 93 | 52BC0A4C1E050728008D74D7 /* Info.plist */, 94 | ); 95 | path = I2CTests; 96 | sourceTree = ""; 97 | }; 98 | 52BC0A561E050735008D74D7 /* I2C */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 52BC0A571E050735008D74D7 /* I2CDevice.swift */, 102 | 528C6B651E0565CB006E6040 /* BusDevice.swift */, 103 | 52BC0A581E050735008D74D7 /* USBI2C.swift */, 104 | ); 105 | name = I2C; 106 | path = ../../../Sources/I2C; 107 | sourceTree = ""; 108 | }; 109 | 52BC0A5B1E050742008D74D7 /* I2CTests */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 52BC0A5C1E050742008D74D7 /* I2CTests.swift */, 113 | ); 114 | name = I2CTests; 115 | path = ../../../Tests/I2CTests; 116 | sourceTree = ""; 117 | }; 118 | /* End PBXGroup section */ 119 | 120 | /* Begin PBXHeadersBuildPhase section */ 121 | 52BC0A391E050727008D74D7 /* Headers */ = { 122 | isa = PBXHeadersBuildPhase; 123 | buildActionMask = 2147483647; 124 | files = ( 125 | 52BC0A4D1E050728008D74D7 /* I2C.h in Headers */, 126 | ); 127 | runOnlyForDeploymentPostprocessing = 0; 128 | }; 129 | /* End PBXHeadersBuildPhase section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | 52BC0A3B1E050727008D74D7 /* I2C */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = 52BC0A501E050728008D74D7 /* Build configuration list for PBXNativeTarget "I2C" */; 135 | buildPhases = ( 136 | 52BC0A371E050727008D74D7 /* Sources */, 137 | 52BC0A381E050727008D74D7 /* Frameworks */, 138 | 52BC0A391E050727008D74D7 /* Headers */, 139 | 52BC0A3A1E050727008D74D7 /* Resources */, 140 | ); 141 | buildRules = ( 142 | ); 143 | dependencies = ( 144 | ); 145 | name = I2C; 146 | productName = I2C; 147 | productReference = 52BC0A3C1E050727008D74D7 /* I2C.framework */; 148 | productType = "com.apple.product-type.framework"; 149 | }; 150 | 52BC0A441E050727008D74D7 /* I2CTests */ = { 151 | isa = PBXNativeTarget; 152 | buildConfigurationList = 52BC0A531E050728008D74D7 /* Build configuration list for PBXNativeTarget "I2CTests" */; 153 | buildPhases = ( 154 | 52BC0A411E050727008D74D7 /* Sources */, 155 | 52BC0A421E050727008D74D7 /* Frameworks */, 156 | 52BC0A431E050727008D74D7 /* Resources */, 157 | ); 158 | buildRules = ( 159 | ); 160 | dependencies = ( 161 | 52BC0A481E050727008D74D7 /* PBXTargetDependency */, 162 | ); 163 | name = I2CTests; 164 | productName = I2CTests; 165 | productReference = 52BC0A451E050727008D74D7 /* I2CTests.xctest */; 166 | productType = "com.apple.product-type.bundle.unit-test"; 167 | }; 168 | /* End PBXNativeTarget section */ 169 | 170 | /* Begin PBXProject section */ 171 | 52BC0A331E050727008D74D7 /* Project object */ = { 172 | isa = PBXProject; 173 | attributes = { 174 | LastSwiftUpdateCheck = 0820; 175 | LastUpgradeCheck = 0820; 176 | ORGANIZATIONNAME = "Yusuke Ito"; 177 | TargetAttributes = { 178 | 52BC0A3B1E050727008D74D7 = { 179 | CreatedOnToolsVersion = 8.2; 180 | ProvisioningStyle = Automatic; 181 | }; 182 | 52BC0A441E050727008D74D7 = { 183 | CreatedOnToolsVersion = 8.2; 184 | LastSwiftMigration = 0820; 185 | ProvisioningStyle = Automatic; 186 | }; 187 | }; 188 | }; 189 | buildConfigurationList = 52BC0A361E050727008D74D7 /* Build configuration list for PBXProject "I2C" */; 190 | compatibilityVersion = "Xcode 3.2"; 191 | developmentRegion = English; 192 | hasScannedForEncodings = 0; 193 | knownRegions = ( 194 | en, 195 | ); 196 | mainGroup = 52BC0A321E050727008D74D7; 197 | productRefGroup = 52BC0A3D1E050727008D74D7 /* Products */; 198 | projectDirPath = ""; 199 | projectRoot = ""; 200 | targets = ( 201 | 52BC0A3B1E050727008D74D7 /* I2C */, 202 | 52BC0A441E050727008D74D7 /* I2CTests */, 203 | ); 204 | }; 205 | /* End PBXProject section */ 206 | 207 | /* Begin PBXResourcesBuildPhase section */ 208 | 52BC0A3A1E050727008D74D7 /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | 52BC0A431E050727008D74D7 /* Resources */ = { 216 | isa = PBXResourcesBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | /* End PBXResourcesBuildPhase section */ 223 | 224 | /* Begin PBXSourcesBuildPhase section */ 225 | 52BC0A371E050727008D74D7 /* Sources */ = { 226 | isa = PBXSourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | 52BC0A591E050735008D74D7 /* I2CDevice.swift in Sources */, 230 | 528C6B661E0565CB006E6040 /* BusDevice.swift in Sources */, 231 | 52BC0A5A1E050735008D74D7 /* USBI2C.swift in Sources */, 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | }; 235 | 52BC0A411E050727008D74D7 /* Sources */ = { 236 | isa = PBXSourcesBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | 52BC0A5E1E050742008D74D7 /* I2CTests.swift in Sources */, 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | }; 243 | /* End PBXSourcesBuildPhase section */ 244 | 245 | /* Begin PBXTargetDependency section */ 246 | 52BC0A481E050727008D74D7 /* PBXTargetDependency */ = { 247 | isa = PBXTargetDependency; 248 | target = 52BC0A3B1E050727008D74D7 /* I2C */; 249 | targetProxy = 52BC0A471E050727008D74D7 /* PBXContainerItemProxy */; 250 | }; 251 | /* End PBXTargetDependency section */ 252 | 253 | /* Begin XCBuildConfiguration section */ 254 | 52BC0A4E1E050728008D74D7 /* Debug */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | ALWAYS_SEARCH_USER_PATHS = NO; 258 | CLANG_ANALYZER_NONNULL = YES; 259 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 260 | CLANG_CXX_LIBRARY = "libc++"; 261 | CLANG_ENABLE_MODULES = YES; 262 | CLANG_ENABLE_OBJC_ARC = YES; 263 | CLANG_WARN_BOOL_CONVERSION = YES; 264 | CLANG_WARN_CONSTANT_CONVERSION = YES; 265 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 266 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 267 | CLANG_WARN_EMPTY_BODY = YES; 268 | CLANG_WARN_ENUM_CONVERSION = YES; 269 | CLANG_WARN_INFINITE_RECURSION = YES; 270 | CLANG_WARN_INT_CONVERSION = YES; 271 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 272 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 273 | CLANG_WARN_UNREACHABLE_CODE = YES; 274 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 275 | CODE_SIGN_IDENTITY = "-"; 276 | COPY_PHASE_STRIP = NO; 277 | CURRENT_PROJECT_VERSION = 1; 278 | DEBUG_INFORMATION_FORMAT = dwarf; 279 | ENABLE_STRICT_OBJC_MSGSEND = YES; 280 | ENABLE_TESTABILITY = YES; 281 | GCC_C_LANGUAGE_STANDARD = gnu99; 282 | GCC_DYNAMIC_NO_PIC = NO; 283 | GCC_NO_COMMON_BLOCKS = YES; 284 | GCC_OPTIMIZATION_LEVEL = 0; 285 | GCC_PREPROCESSOR_DEFINITIONS = ( 286 | "DEBUG=1", 287 | "$(inherited)", 288 | ); 289 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 290 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 291 | GCC_WARN_UNDECLARED_SELECTOR = YES; 292 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 293 | GCC_WARN_UNUSED_FUNCTION = YES; 294 | GCC_WARN_UNUSED_VARIABLE = YES; 295 | MACOSX_DEPLOYMENT_TARGET = 10.12; 296 | MTL_ENABLE_DEBUG_INFO = YES; 297 | ONLY_ACTIVE_ARCH = YES; 298 | SDKROOT = macosx; 299 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 300 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 301 | VERSIONING_SYSTEM = "apple-generic"; 302 | VERSION_INFO_PREFIX = ""; 303 | }; 304 | name = Debug; 305 | }; 306 | 52BC0A4F1E050728008D74D7 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ALWAYS_SEARCH_USER_PATHS = NO; 310 | CLANG_ANALYZER_NONNULL = YES; 311 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 312 | CLANG_CXX_LIBRARY = "libc++"; 313 | CLANG_ENABLE_MODULES = YES; 314 | CLANG_ENABLE_OBJC_ARC = YES; 315 | CLANG_WARN_BOOL_CONVERSION = YES; 316 | CLANG_WARN_CONSTANT_CONVERSION = YES; 317 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 318 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 319 | CLANG_WARN_EMPTY_BODY = YES; 320 | CLANG_WARN_ENUM_CONVERSION = YES; 321 | CLANG_WARN_INFINITE_RECURSION = YES; 322 | CLANG_WARN_INT_CONVERSION = YES; 323 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 324 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 325 | CLANG_WARN_UNREACHABLE_CODE = YES; 326 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 327 | CODE_SIGN_IDENTITY = "-"; 328 | COPY_PHASE_STRIP = NO; 329 | CURRENT_PROJECT_VERSION = 1; 330 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 331 | ENABLE_NS_ASSERTIONS = NO; 332 | ENABLE_STRICT_OBJC_MSGSEND = YES; 333 | GCC_C_LANGUAGE_STANDARD = gnu99; 334 | GCC_NO_COMMON_BLOCKS = YES; 335 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 336 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 337 | GCC_WARN_UNDECLARED_SELECTOR = YES; 338 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 339 | GCC_WARN_UNUSED_FUNCTION = YES; 340 | GCC_WARN_UNUSED_VARIABLE = YES; 341 | MACOSX_DEPLOYMENT_TARGET = 10.12; 342 | MTL_ENABLE_DEBUG_INFO = NO; 343 | SDKROOT = macosx; 344 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 345 | VERSIONING_SYSTEM = "apple-generic"; 346 | VERSION_INFO_PREFIX = ""; 347 | }; 348 | name = Release; 349 | }; 350 | 52BC0A511E050728008D74D7 /* Debug */ = { 351 | isa = XCBuildConfiguration; 352 | buildSettings = { 353 | CODE_SIGN_IDENTITY = ""; 354 | COMBINE_HIDPI_IMAGES = YES; 355 | DEFINES_MODULE = YES; 356 | DYLIB_COMPATIBILITY_VERSION = 1; 357 | DYLIB_CURRENT_VERSION = 1; 358 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 359 | FRAMEWORK_VERSION = A; 360 | INFOPLIST_FILE = I2C/Info.plist; 361 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 362 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 363 | LIBRARY_SEARCH_PATHS = /usr/local/lib; 364 | OTHER_LDFLAGS = "-lusb"; 365 | PRODUCT_BUNDLE_IDENTIFIER = jp.novi.I2C; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | SKIP_INSTALL = YES; 368 | SWIFT_INCLUDE_PATHS = "\"$(SRCROOT)/../modulemaps\""; 369 | SWIFT_VERSION = 3.0; 370 | }; 371 | name = Debug; 372 | }; 373 | 52BC0A521E050728008D74D7 /* Release */ = { 374 | isa = XCBuildConfiguration; 375 | buildSettings = { 376 | CODE_SIGN_IDENTITY = ""; 377 | COMBINE_HIDPI_IMAGES = YES; 378 | DEFINES_MODULE = YES; 379 | DYLIB_COMPATIBILITY_VERSION = 1; 380 | DYLIB_CURRENT_VERSION = 1; 381 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 382 | FRAMEWORK_VERSION = A; 383 | INFOPLIST_FILE = I2C/Info.plist; 384 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 386 | LIBRARY_SEARCH_PATHS = /usr/local/lib; 387 | OTHER_LDFLAGS = "-lusb"; 388 | PRODUCT_BUNDLE_IDENTIFIER = jp.novi.I2C; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | SKIP_INSTALL = YES; 391 | SWIFT_INCLUDE_PATHS = "\"$(SRCROOT)/../modulemaps\""; 392 | SWIFT_VERSION = 3.0; 393 | }; 394 | name = Release; 395 | }; 396 | 52BC0A541E050728008D74D7 /* Debug */ = { 397 | isa = XCBuildConfiguration; 398 | buildSettings = { 399 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 400 | CLANG_ENABLE_MODULES = YES; 401 | COMBINE_HIDPI_IMAGES = YES; 402 | INFOPLIST_FILE = I2CTests/Info.plist; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 404 | PRODUCT_BUNDLE_IDENTIFIER = jp.novi.I2CTests; 405 | PRODUCT_NAME = "$(TARGET_NAME)"; 406 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 407 | SWIFT_VERSION = 3.0; 408 | }; 409 | name = Debug; 410 | }; 411 | 52BC0A551E050728008D74D7 /* Release */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 415 | CLANG_ENABLE_MODULES = YES; 416 | COMBINE_HIDPI_IMAGES = YES; 417 | INFOPLIST_FILE = I2CTests/Info.plist; 418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 419 | PRODUCT_BUNDLE_IDENTIFIER = jp.novi.I2CTests; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | SWIFT_VERSION = 3.0; 422 | }; 423 | name = Release; 424 | }; 425 | /* End XCBuildConfiguration section */ 426 | 427 | /* Begin XCConfigurationList section */ 428 | 52BC0A361E050727008D74D7 /* Build configuration list for PBXProject "I2C" */ = { 429 | isa = XCConfigurationList; 430 | buildConfigurations = ( 431 | 52BC0A4E1E050728008D74D7 /* Debug */, 432 | 52BC0A4F1E050728008D74D7 /* Release */, 433 | ); 434 | defaultConfigurationIsVisible = 0; 435 | defaultConfigurationName = Release; 436 | }; 437 | 52BC0A501E050728008D74D7 /* Build configuration list for PBXNativeTarget "I2C" */ = { 438 | isa = XCConfigurationList; 439 | buildConfigurations = ( 440 | 52BC0A511E050728008D74D7 /* Debug */, 441 | 52BC0A521E050728008D74D7 /* Release */, 442 | ); 443 | defaultConfigurationIsVisible = 0; 444 | defaultConfigurationName = Release; 445 | }; 446 | 52BC0A531E050728008D74D7 /* Build configuration list for PBXNativeTarget "I2CTests" */ = { 447 | isa = XCConfigurationList; 448 | buildConfigurations = ( 449 | 52BC0A541E050728008D74D7 /* Debug */, 450 | 52BC0A551E050728008D74D7 /* Release */, 451 | ); 452 | defaultConfigurationIsVisible = 0; 453 | defaultConfigurationName = Release; 454 | }; 455 | /* End XCConfigurationList section */ 456 | }; 457 | rootObject = 52BC0A331E050727008D74D7 /* Project object */; 458 | } 459 | -------------------------------------------------------------------------------- /Xcode/I2C/I2C.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Xcode/I2C/I2C/I2C.h: -------------------------------------------------------------------------------- 1 | // 2 | // I2C.h 3 | // I2C 4 | // 5 | // Created by Yusuke Ito on 12/17/16. 6 | // Copyright © 2016 Yusuke Ito. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for I2C. 12 | FOUNDATION_EXPORT double I2CVersionNumber; 13 | 14 | //! Project version string for I2C. 15 | FOUNDATION_EXPORT const unsigned char I2CVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Xcode/I2C/I2C/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2016 Yusuke Ito. All rights reserved. 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Xcode/I2C/I2CTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Xcode/modulemaps/CUSB/module.map: -------------------------------------------------------------------------------- 1 | module CUSB [system] { 2 | header "/usr/local/include/usb.h" 3 | export * 4 | } 5 | 6 | --------------------------------------------------------------------------------