{"action":"created","issue":{"url":"https://api.github.com/repos/uraimo/SwiftyGPIO/issues/8","labels_url":"https://api.github.com/repos/uraimo/SwiftyGPIO/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/uraimo/SwiftyGPIO/issues/8/comments","events_url":"https://api.github.com/repos/uraimo/SwiftyGPIO/issues/8/events","html_url":"https://github.com/uraimo/SwiftyGPIO/issues/8","id":126907434,"number":8,"title":"Adding support for hardware PWM ","user":{"login":"uraimo","id":181436,"avatar_url":"https://avatars.githubusercontent.com/u/181436?v=3","gravatar_id":"","url":"https://api.github.com/users/uraimo","html_url":"https://github.com/uraimo","followers_url":"https://api.github.com/users/uraimo/followers","following_url":"https://api.github.com/users/uraimo/following{/other_user}","gists_url":"https://api.github.com/users/uraimo/gists{/gist_id}","starred_url":"https://api.github.com/users/uraimo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uraimo/subscriptions","organizations_url":"https://api.github.com/users/uraimo/orgs","repos_url":"https://api.github.com/users/uraimo/repos","events_url":"https://api.github.com/users/uraimo/events{/privacy}","received_events_url":"https://api.github.com/users/uraimo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/uraimo/SwiftyGPIO/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-15T16:33:03Z","updated_at":"2016-01-21T14:43:33Z","closed_at":null,"body":"PWM outputs have a few uses (for hobby projects mainly driving motors and playing sounds) and a convenient sysfs interface. Implementation should be really straightforward."},"comment":{"url":"https://api.github.com/repos/uraimo/SwiftyGPIO/issues/comments/173591216","html_url":"https://github.com/uraimo/SwiftyGPIO/issues/8#issuecomment-173591216","issue_url":"https://api.github.com/repos/uraimo/SwiftyGPIO/issues/8","id":173591216,"user":{"login":"uraimo","id":181436,"avatar_url":"https://avatars.githubusercontent.com/u/181436?v=3","gravatar_id":"","url":"https://api.github.com/users/uraimo","html_url":"https://github.com/uraimo","followers_url":"https://api.github.com/users/uraimo/followers","following_url":"https://api.github.com/users/uraimo/following{/other_user}","gists_url":"https://api.github.com/users/uraimo/gists{/gist_id}","starred_url":"https://api.github.com/users/uraimo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uraimo/subscriptions","organizations_url":"https://api.github.com/users/uraimo/orgs","repos_url":"https://api.github.com/users/uraimo/repos","events_url":"https://api.github.com/users/uraimo/events{/privacy}","received_events_url":"https://api.github.com/users/uraimo/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T14:43:33Z","updated_at":"2016-01-21T14:43:33Z","body":"Hi Claudio,\r\nin the last few days i've been building a library to drive the PCD8544 lcd and considering how slow the Swift software SPI implementation turned out to be the item with higher priority is the sysfs SPI interface (likely not much work).\r\nAfter that, considering that i don't have enough info yet to implement the transition from sysfs to mmap of the current functionalities i could start implementing some form of PWM.\r\nThe implementation doesn't seem that hard, verification and testing before release could need more time instead.\r\n\r\nThere are a few alternatives regarding what kind of PWM to expose from Swift:\r\n\r\n1. One (or two) hardware PWMs: Are accessible via sysfs, board-independent approach, fastest PWM that the Raspi&co can generate.\r\n\r\n2. Libraries like Servoblaster/PiBlaster provide 8 DMA driven PWMs: Still accessible via sysfs/dev with a custom interface, the libraries support the Raspi & BBB but not other boards AFIAK, not as fast but looks like they are more than fast enough for servos.\r\n\r\n3. Support for external PWM driver boards via I2C/SPI[1]: Harder to implement, harder to test but give access to more, fast, PWM outputs. But doesn't look like something that should be integrated in SwiftyGPIO.\r\n\r\nSo considering that SwiftyGPIO doesn't target the Raspi specifically, i'll start with (1), that will work for more than one kind of board, and then i'll consider introducing (2) as an extension (we will depend on those libraries, at the moment i don't see any reason to reimplement the same stuff in Swift).\r\n\r\nHow much time to have something usable? Possibly, sometime next month.\r\n\r\n\r\n[1] SPI is supported, for an I2C Swift library see https://github.com/Sephiroth87/SMBus-swift"}}