{"id":3600,"date":"2022-10-14T15:34:23","date_gmt":"2022-10-14T14:34:23","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=3600"},"modified":"2022-10-14T15:36:51","modified_gmt":"2022-10-14T14:36:51","slug":"io-pins-geneal","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/microcontrollers\/programming-in-c-c\/io-pins-programming-in-c-c\/io-pins-geneal","title":{"rendered":"IO Pins Geneal"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">IO Pin documentation<\/h4>\n\n\n\n<p><a href=\"https:\/\/raspberrypi.github.io\/pico-sdk-doxygen\/group__hardware__gpio.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/raspberrypi.github.io\/pico-sdk-doxygen\/group__hardware__gpio.html<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Inputs<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tconst uint IO_MY_INPUT = 2;\t\t\/\/RP2040 GPIO number\n\n\t\/\/Initialise Pin\n\tgpio_init(IO_MY_INPUT);\n\tgpio_set_dir(IO_MY_INPUT, GPIO_IN);\n\tgpio_set_pulls(IO_MY_INPUT, 1, 0);\t\t\/\/IO, PullUp, PullDown\n\n\t\/\/Read pin state\n\tif gpio_get(IO_MY_INPUT)\n\t{\n\t}\n\n\t\/\/Read all pins state\n\tuint32_t AllPins = gpio_get_all\t();\t\t\/\/read all 29 GPIO in one call to a uint32<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Outputs<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tconst uint IO_MY_OUPUT = 2;\t\t\/\/RP2040 GPIO number\n\n\t\/\/Initialise pin\n\tgpio_init(IO_MY_OUPUT);\r\n\tgpio_set_dir(IO_MY_OUPUT, GPIO_OUT);\r\n\tgpio_put(IO_MY_OUPUT, 0);\n\tgpio_set_drive_strength(IO_MY_OUPUT, GPIO_DRIVE_STRENGTH_12MA);\t\t\/\/GPIO_DRIVE_STRENGTH_2MA, GPIO_DRIVE_STRENGTH_4MA, GPIO_DRIVE_STRENGTH_8MA or GPIO_DRIVE_STRENGTH_12MA\n\n\t\/\/Set pin state\n\tgpio_put(IO_MY_OUPUT, 1);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>IO Pin documentation https:\/\/raspberrypi.github.io\/pico-sdk-doxygen\/group__hardware__gpio.html Inputs Outputs<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[184],"tags":[],"class_list":["post-3600","post","type-post","status-publish","format-standard","hentry","category-io-pins-programming-in-c-c"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=3600"}],"version-history":[{"count":2,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3600\/revisions"}],"predecessor-version":[{"id":3603,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3600\/revisions\/3603"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=3600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=3600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=3600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}