{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9860","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9860/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9860/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9860/events","html_url":"https://github.com/RIOT-OS/RIOT/pull/9860","id":355304430,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExODY0Nzg0","number":9860,"title":"periph/gpio: support for extension API","user":{"login":"ZetaR60","id":32377642,"node_id":"MDQ6VXNlcjMyMzc3NjQy","avatar_url":"https://avatars2.githubusercontent.com/u/32377642?v=4","gravatar_id":"","url":"https://api.github.com/users/ZetaR60","html_url":"https://github.com/ZetaR60","followers_url":"https://api.github.com/users/ZetaR60/followers","following_url":"https://api.github.com/users/ZetaR60/following{/other_user}","gists_url":"https://api.github.com/users/ZetaR60/gists{/gist_id}","starred_url":"https://api.github.com/users/ZetaR60/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZetaR60/subscriptions","organizations_url":"https://api.github.com/users/ZetaR60/orgs","repos_url":"https://api.github.com/users/ZetaR60/repos","events_url":"https://api.github.com/users/ZetaR60/events{/privacy}","received_events_url":"https://api.github.com/users/ZetaR60/received_events","type":"User","site_admin":false},"labels":[{"id":214816571,"node_id":"MDU6TGFiZWwyMTQ4MTY1NzE=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/CI:%20ready%20for%20build","name":"CI: ready for build","color":"66ffcc","default":false},{"id":104178887,"node_id":"MDU6TGFiZWwxMDQxNzg4ODc=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Impact:%20major","name":"Impact: major","color":"ff0000","default":false},{"id":127102429,"node_id":"MDU6TGFiZWwxMjcxMDI0Mjk=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Process:%20API%20change","name":"Process: API change","color":"ff9933","default":false},{"id":23399100,"node_id":"MDU6TGFiZWwyMzM5OTEwMA==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Type:%20enhancement","name":"Type: enhancement","color":"ffff66","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/25","html_url":"https://github.com/RIOT-OS/RIOT/milestone/25","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/25/labels","id":3745672,"node_id":"MDk6TWlsZXN0b25lMzc0NTY3Mg==","number":25,"title":"Release 2019.01","description":"","creator":{"login":"jia200x","id":1260616,"node_id":"MDQ6VXNlcjEyNjA2MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1260616?v=4","gravatar_id":"","url":"https://api.github.com/users/jia200x","html_url":"https://github.com/jia200x","followers_url":"https://api.github.com/users/jia200x/followers","following_url":"https://api.github.com/users/jia200x/following{/other_user}","gists_url":"https://api.github.com/users/jia200x/gists{/gist_id}","starred_url":"https://api.github.com/users/jia200x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jia200x/subscriptions","organizations_url":"https://api.github.com/users/jia200x/orgs","repos_url":"https://api.github.com/users/jia200x/repos","events_url":"https://api.github.com/users/jia200x/events{/privacy}","received_events_url":"https://api.github.com/users/jia200x/received_events","type":"User","site_admin":false},"open_issues":105,"closed_issues":178,"state":"open","created_at":"2018-10-17T08:14:28Z","updated_at":"2018-12-21T13:55:36Z","due_on":"2019-01-31T08:00:00Z","closed_at":null},"comments":5,"created_at":"2018-08-29T19:41:11Z","updated_at":"2018-12-22T05:46:14Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/9860","html_url":"https://github.com/RIOT-OS/RIOT/pull/9860","diff_url":"https://github.com/RIOT-OS/RIOT/pull/9860.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/9860.patch"},"body":"### Contribution description\r\nThis is an implementation of the intercept method outlined by my proposal in [#9582](https://github.com/RIOT-OS/RIOT/issues/9582#issuecomment-410094702) (parts 1-4) for the periph/gpio interface. In short, it allows other drivers (such as GPIO expanders) to be addressed using gpio_t so that all existent code can easily gain support through those drivers. For non-implementation detail and discussion, please see #9582\r\n\r\nAt @kYc0o 's suggestion, I am breaking the implementation of #9582 / #9690 into several pieces to make it easier to review. This PR only contains the API intercept code.\r\n\r\n### Testing procedure\r\nA test case is provided for detecting collisions between use of ```GPIO_PIN``` and ```GPIO_EXT_PIN```. Otherwise the existing GPIO tests may be used to confirm CPU based pins work with the API change. This PR only contains API definitions for the redirection functions, so implementation of them will be tested in a follow-up PR.\r\n\r\n### Issues/PRs references\r\nPartially replaces and closes #9190 \r\nImplements parts 1-4 of my proposal in #9582 \r\nPart of work tracked by #9690"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/449547273","html_url":"https://github.com/RIOT-OS/RIOT/pull/9860#issuecomment-449547273","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9860","id":449547273,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTU0NzI3Mw==","user":{"login":"ZetaR60","id":32377642,"node_id":"MDQ6VXNlcjMyMzc3NjQy","avatar_url":"https://avatars2.githubusercontent.com/u/32377642?v=4","gravatar_id":"","url":"https://api.github.com/users/ZetaR60","html_url":"https://github.com/ZetaR60","followers_url":"https://api.github.com/users/ZetaR60/followers","following_url":"https://api.github.com/users/ZetaR60/following{/other_user}","gists_url":"https://api.github.com/users/ZetaR60/gists{/gist_id}","starred_url":"https://api.github.com/users/ZetaR60/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZetaR60/subscriptions","organizations_url":"https://api.github.com/users/ZetaR60/orgs","repos_url":"https://api.github.com/users/ZetaR60/repos","events_url":"https://api.github.com/users/ZetaR60/events{/privacy}","received_events_url":"https://api.github.com/users/ZetaR60/received_events","type":"User","site_admin":false},"created_at":"2018-12-22T05:46:14Z","updated_at":"2018-12-22T05:46:14Z","author_association":"CONTRIBUTOR","body":"@gschorcht\r\n\r\n> Any thoughts to my last idea\r\n\r\nSorry for the late reply. I have not been able to be as prompt as I would like to be lately.\r\n\r\n> In this case it would become possible to handle GPIO expansion devices based on a port ID starting with GPIO_PORT_NUMOF. In addition, the GPIO_PIN(x, y) macro could be redefined to handle MCU ports and extension ports in the same way. The extension interface would be completely invisible to the application. It always uses GPIO_PIN(port, pin), regardless of whether the GPIO is provided by the MCU or by the expansion device.\r\n\r\nThe extension interface is already completely invisible, because the compiler does not \"see\" the macros. I don't think that getting rid of `GPIO_EXT_PIN` would give any advantages in increasing compatibility. I also recall that when working out how to write `GPIO_EXT_PIN` I had major problems on some systems because of weird `gpio_t` encoding methods. Not everything uses ascending port numbers, so I don't think the port encoding idea will be practical. Using the leading bit to indicate an extension device made the encoding agnostic to any MCU weirdness (as apparently no system collided with the leading bit, as determined by `tests/periph_gpio_coll`).\r\n\r\n> I'm wondering whether it would possible to define a macro that is set by the CPU peripheral configuration which defines the number of ports provided by the MCU\r\n\r\nThis would be a useful thing to add to the extension API follow-up macro changes that we have been discussing in #9582."}}
{"actor":{"display_login":"ZetaR60"}}