{"action":"created","issue":{"url":"https://api.github.com/repos/espruino/Espruino/issues/390","repository_url":"https://api.github.com/repos/espruino/Espruino","labels_url":"https://api.github.com/repos/espruino/Espruino/issues/390/labels{/name}","comments_url":"https://api.github.com/repos/espruino/Espruino/issues/390/comments","events_url":"https://api.github.com/repos/espruino/Espruino/issues/390/events","html_url":"https://github.com/espruino/Espruino/issues/390","id":35572521,"number":390,"title":"I2C Repeated Start","user":{"login":"tomgidden","id":1640098,"avatar_url":"https://avatars.githubusercontent.com/u/1640098?v=3","gravatar_id":"","url":"https://api.github.com/users/tomgidden","html_url":"https://github.com/tomgidden","followers_url":"https://api.github.com/users/tomgidden/followers","following_url":"https://api.github.com/users/tomgidden/following{/other_user}","gists_url":"https://api.github.com/users/tomgidden/gists{/gist_id}","starred_url":"https://api.github.com/users/tomgidden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomgidden/subscriptions","organizations_url":"https://api.github.com/users/tomgidden/orgs","repos_url":"https://api.github.com/users/tomgidden/repos","events_url":"https://api.github.com/users/tomgidden/events{/privacy}","received_events_url":"https://api.github.com/users/tomgidden/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2014-06-12T10:38:30Z","updated_at":"2016-06-23T00:46:26Z","closed_at":"2015-10-22T10:34:40Z","body":"I'm trying to write a library for MPL3115A2 (note, NOT the existing MPL115A2) but according to the Arduino library along with various Google results, it appears that it needs Repeated Start capability on I2C: I think this means not sending a STOP command after a read or a write.\r\n\r\nWhether or not this is correct behaviour for I2C slave devices (which as far as I can see should be able to support with and without repeated starts), it's been an issue on Raspberry Pi (since fixed), and was added to Arduino in v.1.0.1.\r\n\r\nRelated code (from the MPL3115A2 Arduino driver):\r\n```C++\r\n// These are the two I2C functions in this sketch.\r\nbyte MPL3115A2::IIC_Read(byte regAddr)\r\n{\r\n  // This function reads one byte over IIC\r\n  Wire.beginTransmission(MPL3115A2_ADDRESS);\r\n  Wire.write(regAddr);  // Address of CTRL_REG1\r\n  Wire.endTransmission(false); // Send data to I2C dev with option for a repeated start. THIS IS NECESSARY and not supported before Arduino V1.0.1!\r\n  Wire.requestFrom(MPL3115A2_ADDRESS, 1); // Request the data...\r\n  return Wire.read();\r\n}\r\n```\r\nand also, http://raspberry.znix.com/2013/03/raspberry-pi-and-repeated-start-i2c.html\r\n\r\nI'd guess this might be best presented as an extra optional boolean parameter on `I2C.readFrom` and `I2C.writeTo`, although the fix for #370 might scupper that."},"comment":{"url":"https://api.github.com/repos/espruino/Espruino/issues/comments/227919428","html_url":"https://github.com/espruino/Espruino/issues/390#issuecomment-227919428","issue_url":"https://api.github.com/repos/espruino/Espruino/issues/390","id":227919428,"user":{"login":"errantspark","id":623916,"avatar_url":"https://avatars.githubusercontent.com/u/623916?v=3","gravatar_id":"","url":"https://api.github.com/users/errantspark","html_url":"https://github.com/errantspark","followers_url":"https://api.github.com/users/errantspark/followers","following_url":"https://api.github.com/users/errantspark/following{/other_user}","gists_url":"https://api.github.com/users/errantspark/gists{/gist_id}","starred_url":"https://api.github.com/users/errantspark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/errantspark/subscriptions","organizations_url":"https://api.github.com/users/errantspark/orgs","repos_url":"https://api.github.com/users/errantspark/repos","events_url":"https://api.github.com/users/errantspark/events{/privacy}","received_events_url":"https://api.github.com/users/errantspark/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T00:46:26Z","updated_at":"2016-06-23T00:46:26Z","body":"Just came back to this project, using 1v85 and I cannot get it to connect on I2C1. On I2C3 (on a different board) it works fine. Unfortunately for my current project i'm using those pins for SPI so a way to get this working with I2C1 would be super helpful. Same `Uncaught InternalError: Timeout on I2C Write BUSY` error as before. Using the code snippet from above but different (obviously) addresses."}}
{"actor":{"display_login":"errantspark"}}