{"id":376,"date":"2014-01-22T13:58:55","date_gmt":"2014-01-22T13:58:55","guid":{"rendered":"https:\/\/ibex.tech\/embedded\/?p=376"},"modified":"2022-02-18T15:37:49","modified_gmt":"2022-02-18T15:37:49","slug":"io-general","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/pic32\/xc32-v2-old\/io-pins\/io-general","title":{"rendered":".IO Pins General"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Read Port<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tmy_var = mPORTBRead();<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Read pin<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tif (mPORTBReadBits(BIT_10))\n\t\tswitches_1_read |= 0x0001;\n\n#define EXTERNAL_POWER_PRESENT\t\t(!mPORTDReadBits(BIT_11))<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Write Pin<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#define READY_LED_ON(state)\t\t(state ? mPORTCClearBits(BIT_14) : mPORTCSetBits(BIT_14))<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Write Port<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tmPORTEWrite(0x5555)\n\tmPORTESetBits(0x00ff);\n\tmPORTEClearBits(0xff00);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Set Pin TRIS<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#define MY_IO_DIR(state)\t(state ? mPORTESetPinsDigitalIn(BIT_5) : mPORTESetPinsDigitalOut(BIT_5))\t\t\/\/1 = input, 0 = output<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Read Port Read pin Write Pin Write Port Set Pin TRIS<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45],"tags":[],"class_list":["post-376","post","type-post","status-publish","format-standard","hentry","category-io-pins"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/comments?post=376"}],"version-history":[{"count":11,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/376\/revisions"}],"predecessor-version":[{"id":1228,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/376\/revisions\/1228"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}