]> granicus.if.org Git - esp-idf/commitdiff
Draft of GPIO API included
authorkrzychb <krzychb@gazeta.pl>
Tue, 25 Oct 2016 10:09:05 +0000 (12:09 +0200)
committerIvan Grokhotkov <ivan@espressif.com>
Mon, 31 Oct 2016 17:20:04 +0000 (01:20 +0800)
docs/Doxyfile
docs/api/gpio.rst [new file with mode: 0644]
docs/index.rst

index 9c8fb81df8d3df0c226eec0f9cea2652bbbab1b1..8328d44ca31efb16f25561934fcc489c5b0e0955 100644 (file)
@@ -1,12 +1,13 @@
-PROJECT_NAME     = "ESP32 Programming Guide"
-XML_OUTPUT       = xml
-GENERATE_LATEX   = NO
-GENERATE_MAN     = NO
-GENERATE_RTF     = NO
-CASE_SENSE_NAMES = NO
-INPUT            = ../components/esp32/include/esp_wifi.h
-RECURSIVE        = YES
-QUIET            = YES
-JAVADOC_AUTOBRIEF = YES
-GENERATE_HTML = NO
-GENERATE_XML = YES
+PROJECT_NAME           = "ESP32 Programming Guide"
+XML_OUTPUT                     = xml
+GENERATE_LATEX         = NO
+GENERATE_MAN           = NO
+GENERATE_RTF           = NO
+CASE_SENSE_NAMES       = NO
+INPUT                          = ../components/esp32/include/esp_wifi.h ../components/driver/include/driver/gpio.h ../components/esp32/include/rom/gpio.h
+RECURSIVE                      = YES
+QUIET                          = YES
+JAVADOC_AUTOBRIEF      = YES
+GENERATE_HTML          = NO
+GENERATE_XML           = YES
+WARN_LOGFILE           = "DoxyGenWarningLog.txt"
\ No newline at end of file
diff --git a/docs/api/gpio.rst b/docs/api/gpio.rst
new file mode 100644 (file)
index 0000000..11b0e4a
--- /dev/null
@@ -0,0 +1,67 @@
+GPIO API
+========
+
+Functions
+---------
+
+.. doxygenfunction:: gpio_config
+.. doxygenfunction:: gpio_set_intr_type
+.. doxygenfunction:: gpio_intr_enable
+.. doxygenfunction:: gpio_intr_disable
+.. doxygenfunction:: gpio_set_level
+.. doxygenfunction:: gpio_get_level
+.. doxygenfunction:: gpio_set_direction
+.. doxygenfunction:: gpio_set_pull_mode
+.. doxygenfunction:: gpio_wakeup_enable
+.. doxygenfunction:: gpio_wakeup_disable
+.. doxygenfunction:: gpio_isr_register
+
+*Example code:*
+
+Configuration of GPIO as an output
+
+.. code-block:: c
+
+    gpio_config_t io_conf;
+    io_conf.intr_type = GPIO_INTR_DISABLE;             //disable interrupt
+    io_conf.mode = GPIO_MODE_OUTPUT;                   //set as output mode
+    io_conf.pin_bit_mask = GPIO_SEL_18 | GPIO_SEL_19;  //bit mask of the pins that you want to set,e.g.GPIO18/19
+    io_conf.pull_down_en = 0;                          //disable pull-down mode
+    io_conf.pull_up_en = 0;                            //disable pull-up mode
+    gpio_config(&io_conf);                             //configure GPIO with the given settings
+
+Configuration of GPIO as an input
+
+.. code-block:: c
+
+    gpio_config_t io_conf;
+    io_conf.intr_type = GPIO_INTR_POSEDGE;             //set posedge interrupt
+    io_conf.mode = GPIO_MODE_INPUT;                    //set as input
+    io_conf.pin_bit_mask = GPIO_SEL_4 | GPIO_SEL_5;    //bit mask of the pins that you want to set, e.g.,GPIO4/5
+    io_conf.pull_down_en = 0;                          //disable pull-down mode
+    io_conf.pull_up_en = 1;                            //enable pull-up mode
+    gpio_config(&io_conf);                             //configure GPIO with the given settings
+
+
+Low level ROM GPIO functions
+
+.. doxygenfunction:: gpio_init
+.. doxygenfunction:: gpio_output_set
+.. doxygenfunction:: gpio_output_set_high
+.. doxygenfunction:: gpio_input_get
+.. doxygenfunction:: gpio_input_get_high
+.. doxygenfunction:: gpio_intr_handler_register
+.. doxygenfunction:: gpio_intr_pending
+.. doxygenfunction:: gpio_intr_pending_high
+.. doxygenfunction:: gpio_intr_ack
+.. doxygenfunction:: gpio_intr_ack_high
+.. doxygenfunction:: gpio_pin_wakeup_enable
+.. doxygenfunction:: gpio_pin_wakeup_disable
+.. doxygenfunction:: gpio_matrix_in
+.. doxygenfunction:: gpio_matrix_out
+.. doxygenfunction:: gpio_pad_select_gpio
+.. doxygenfunction:: gpio_pad_set_drv
+.. doxygenfunction:: gpio_pad_pullup
+.. doxygenfunction:: gpio_pad_pulldown
+.. doxygenfunction:: gpio_pad_unhold
+.. doxygenfunction:: gpio_pad_hold
index 30e981e8ef4697fb587f30864f7e773c1b49069f..26b906c36667ca7c5d7f9849334584a13d27b068 100644 (file)
@@ -35,6 +35,7 @@ Contents:
    :maxdepth: 1
 
    Wi-Fi <api/esp_wifi>
+   GPIO <api/gpio>
    api/example
 
 .. Technical Reference - TBA