Gpio16 Related Apis; Parameter Onfiguration; Parameter Configuration For Scene - Espressif ESP8266 Technical Reference

Hide thumbs Also See for ESP8266:
Table of Contents

Advertisement

!
Interrupt status register GPIO_STATUS
Bit[15:0] (readable and writable):
If the related bit is set to be 1, the IO interrupts. Bit[15:0] contains 16 GPIOs.
Interrupt clearing register GPIO_STATUS_W1TC
Bit[15:0] (readable and writable):
Write 1 into the related bit, the related GPIO interrupt status will be cleared.

2.2.5. GPIO16 Related APIs

Different from other IO interfaces, GPIO16(XPD_DCDC) belongs to the RTC module instead
of the general GPIO module. It can be used to wake up the chip during deep-sleep; it can
be configured to input or output mode; but it cannot trigger the IO interrupt. the APIs are
shown below.
gpio16_output_conf(void)
Set the GPIO16 to the output mode.
gpio16_output_set(uint8 value)
Output high/low level from GPIO16. Configure GPIO16 to the output mode first.
gpio16_input_conf(void)
Set the GPIO16 to the input mode.
gpio16_input_get(void)
Read the GPIO16 input level status. Configure GPIO16 to the input mode first.
2.3. Parameter onfiguration
Three scenes are given as examples for parameter configuration:
Configure the MTDI output high level, and enable the pull up.
Configure the MTDI to the input mode, and get its level status.
Configure the MTDI to falling edge triggers interrupt.
2.3.1. Parameter Configuration for Scene 1
1. Configure the MTDI to GPIO mode.
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U,FUNC_GPIO12);
This sentence writes 1 into bits 4-5 of PERIPHS_IO_MUX_MTDI_U register. When bits 4-5
of PERIPHS_IO_MUX_MTDI_U are set to be 1, the MTDI is configured to the GPIO mode.
For details of PERIPHS_IO_MUX_MTDI_U register, refer to Section 2.2, Instruction on
GPIO Register.
2. Configure the MTDI output high level.
GPIO_OUTPUT_SET(GPIO_ID_PIN(12), 1);
Espressif
! /! 9 86
2. GPIO
2016.05

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP8266 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents

Save PDF