{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/519","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/519/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/519/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/519/events","html_url":"https://github.com/esp8266/Arduino/issues/519","id":93767572,"number":519,"title":"Cannot access GPIO15 On OLIMEX EVB board -- No FUNCTION_3 switch in extern void __pinMode(uint8_t pin, uint8_t mode) {","user":{"login":"drmpf","id":5945337,"avatar_url":"https://avatars.githubusercontent.com/u/5945337?v=3","gravatar_id":"","url":"https://api.github.com/users/drmpf","html_url":"https://github.com/drmpf","followers_url":"https://api.github.com/users/drmpf/followers","following_url":"https://api.github.com/users/drmpf/following{/other_user}","gists_url":"https://api.github.com/users/drmpf/gists{/gist_id}","starred_url":"https://api.github.com/users/drmpf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drmpf/subscriptions","organizations_url":"https://api.github.com/users/drmpf/orgs","repos_url":"https://api.github.com/users/drmpf/repos","events_url":"https://api.github.com/users/drmpf/events{/privacy}","received_events_url":"https://api.github.com/users/drmpf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-07-08T11:33:07Z","updated_at":"2016-01-31T09:23:17Z","closed_at":"2015-07-09T08:48:27Z","body":"I am trying to use GPIO15 on the OMILEX EVB BOARD (the one with the relay)\r\nBut cannot read that pin.\r\ndefault function appears to be MTDO,  and there is no FUNCTION_3 switch in the \r\nextern void __pinMode(uint8_t pin, uint8_t mode)  \r\nmethod to make this pin accessible as GPIO in stable release 1.6.4-673-g8cd3697\r\n\r\nI need two digital inputs and have all ready used GPIO4 as one and am using GPIO16 for ADC,\r\nCannot use GPIO0 or 2 as my be shorted to gnd on power up by external switch\r\nGPIO5 on this board drives the relay and TX/RX use the other two GPIO's\r\n\r\n```\r\nextern void __pinMode(uint8_t pin, uint8_t mode) {\r\n  if(pin < 16){\r\n    if(mode == SPECIAL){\r\n      GPC(pin) = (GPC(pin) & (0xF << GPCI)); //SOURCE(GPIO) | DRIVER(NORMAL) | INT_TYPE(UNCHANGED) | WAKEUP_ENABLE(DISABLED)\r\n      GPEC = (1 << pin); //Disable\r\n      GPF(pin) = GPFFS(GPFFS_BUS(pin));//Set mode to BUS (RX0, TX0, TX1, SPI, HSPI or CLK depending in the pin)\r\n      if(pin == 3) GPF(pin) |= (1 << GPFPU);//enable pullup on RX\r\n    } else if(mode & FUNCTION_0){\r\n      GPC(pin) = (GPC(pin) & (0xF << GPCI)); //SOURCE(GPIO) | DRIVER(NORMAL) | INT_TYPE(UNCHANGED) | WAKEUP_ENABLE(DISABLED)\r\n      GPEC = (1 << pin); //Disable\r\n      GPF(pin) = GPFFS((mode >> 4) & 0x07);\r\n      if(pin == 13 && mode == FUNCTION_4) GPF(pin) |= (1 << GPFPU);//enable pullup on RX\r\n    }  else if(mode == OUTPUT || mode == OUTPUT_OPEN_DRAIN){\r\n      GPF(pin) = GPFFS(GPFFS_GPIO(pin));//Set mode to GPIO\r\n      GPC(pin) = (GPC(pin) & (0xF << GPCI)); //SOURCE(GPIO) | DRIVER(NORMAL) | INT_TYPE(UNCHANGED) | WAKEUP_ENABLE(DISABLED)\r\n      if(mode == OUTPUT_OPEN_DRAIN) GPC(pin) |= (1 << GPCD);\r\n      GPES = (1 << pin); //Enable\r\n    } else if(mode == INPUT || mode == INPUT_PULLUP || mode == INPUT_PULLDOWN){\r\n      GPF(pin) = GPFFS(GPFFS_GPIO(pin));//Set mode to GPIO\r\n      GPEC = (1 << pin); //Disable\r\n      GPC(pin) = (GPC(pin) & (0xF << GPCI)) | (1 << GPCD); //SOURCE(GPIO) | DRIVER(OPEN_DRAIN) | INT_TYPE(UNCHANGED) | WAKEUP_ENABLE(DISABLED)\r\n      if(mode == INPUT_PULLUP) {\r\n          GPF(pin) |= (1 << GPFPU);  // Enable  Pullup\r\n      } else if(mode == INPUT_PULLDOWN) {\r\n          GPF(pin) |= (1 << GPFPD);  // Enable  Pulldown\r\n      }\r\n    }\r\n  } else if(pin == 16){\r\n    GPF16 = GP16FFS(GPFFS_GPIO(pin));//Set mode to GPIO\r\n    GPC16 = 0;\r\n    if(mode == INPUT || mode == INPUT_PULLDOWN){\r\n      if(mode == INPUT_PULLDOWN){\r\n        GPF16 |= (1 << GP16FPD);//Enable Pulldown\r\n      }\r\n      GP16E &= ~1;\r\n    } else if(mode == OUTPUT){\r\n      GP16E |= 1;\r\n    }\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/177447316","html_url":"https://github.com/esp8266/Arduino/issues/519#issuecomment-177447316","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/519","id":177447316,"user":{"login":"atrent","id":412584,"avatar_url":"https://avatars.githubusercontent.com/u/412584?v=3","gravatar_id":"","url":"https://api.github.com/users/atrent","html_url":"https://github.com/atrent","followers_url":"https://api.github.com/users/atrent/followers","following_url":"https://api.github.com/users/atrent/following{/other_user}","gists_url":"https://api.github.com/users/atrent/gists{/gist_id}","starred_url":"https://api.github.com/users/atrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atrent/subscriptions","organizations_url":"https://api.github.com/users/atrent/orgs","repos_url":"https://api.github.com/users/atrent/repos","events_url":"https://api.github.com/users/atrent/events{/privacy}","received_events_url":"https://api.github.com/users/atrent/received_events","type":"User","site_admin":false},"created_at":"2016-01-31T09:23:17Z","updated_at":"2016-01-31T09:23:17Z","body":"_A latere_ question: do you know why Olimex brought out (on the EVB board header) the GPIO 6 to 11 (i.e. SD_CLK to SD_CMD) if they cannot be used? Or they can be used someway? Thanks"}}