ESP8266_RTOS_SDK
v1.4.0
|
GPIO APIs. More...
Macros | |
#define | GPIO_OUTPUT_SET(gpio_no, bit_value) gpio_output_conf(bit_value<<gpio_no, ((~bit_value)&0x01)<<gpio_no, 1<<gpio_no, 0) |
Set GPIO pin output level. More... | |
#define | GPIO_OUTPUT(gpio_bits, bit_value) |
Set GPIO pin output level. More... | |
#define | GPIO_DIS_OUTPUT(gpio_no) gpio_output_conf(0, 0, 0, 1<<gpio_no) |
Disable GPIO pin output. More... | |
#define | GPIO_AS_INPUT(gpio_bits) gpio_output_conf(0, 0, 0, gpio_bits) |
Enable GPIO pin intput. More... | |
#define | GPIO_AS_OUTPUT(gpio_bits) gpio_output_conf(0, 0, gpio_bits, 0) |
Enable GPIO pin output. More... | |
#define | GPIO_INPUT_GET(gpio_no) ((gpio_input_get()>>gpio_no)&BIT0) |
Sample the level of GPIO input. More... | |
Functions | |
void | gpio16_output_conf (void) |
Enable GPIO16 output. More... | |
void | gpio16_output_set (uint8 value) |
Set GPIO16 output level. More... | |
void | gpio16_input_conf (void) |
Enable GPIO pin intput. More... | |
uint8 | gpio16_input_get (void) |
Sample the value of GPIO16 input. More... | |
void | gpio_output_conf (uint32 set_mask, uint32 clear_mask, uint32 enable_mask, uint32 disable_mask) |
Configure Gpio pins out or input. More... | |
void | gpio_intr_handler_register (void *fn, void *arg) |
Register an application-specific interrupt handler for GPIO pin interrupts. More... | |
void | gpio_pin_wakeup_enable (uint32 i, GPIO_INT_TYPE intr_state) |
Configure GPIO wake up to light sleep,Only level way is effective. More... | |
void | gpio_pin_wakeup_disable () |
Disable GPIO wake up to light sleep. More... | |
void | gpio_pin_intr_state_set (uint32 i, GPIO_INT_TYPE intr_state) |
Config interrupt types of GPIO pin. More... | |
uint32 | gpio_input_get (void) |
Sample the value of GPIO input pins and returns a bitmask. More... | |
GPIO APIs.
#define GPIO_AS_INPUT | ( | gpio_bits | ) | gpio_output_conf(0, 0, 0, gpio_bits) |
Enable GPIO pin intput.
gpio_bits | : The GPIO bit number. |
#define GPIO_AS_OUTPUT | ( | gpio_bits | ) | gpio_output_conf(0, 0, gpio_bits, 0) |
Enable GPIO pin output.
gpio_bits | : The GPIO bit number. |
#define GPIO_DIS_OUTPUT | ( | gpio_no | ) | gpio_output_conf(0, 0, 0, 1<<gpio_no) |
Disable GPIO pin output.
gpio_no | : The GPIO sequence number. |
#define GPIO_INPUT_GET | ( | gpio_no | ) | ((gpio_input_get()>>gpio_no)&BIT0) |
Sample the level of GPIO input.
gpio_no | : The GPIO sequence number. |
#define GPIO_OUTPUT | ( | gpio_bits, | |
bit_value | |||
) |
Set GPIO pin output level.
gpio_bits | : The GPIO bit number. |
bit_value | : GPIO pin output level. |
#define GPIO_OUTPUT_SET | ( | gpio_no, | |
bit_value | |||
) | gpio_output_conf(bit_value<<gpio_no, ((~bit_value)&0x01)<<gpio_no, 1<<gpio_no, 0) |
Set GPIO pin output level.
gpio_no | : The GPIO sequence number. |
bit_value | : GPIO pin output level. |
void gpio16_input_conf | ( | void | ) |
Enable GPIO pin intput.
null |
uint8 gpio16_input_get | ( | void | ) |
Sample the value of GPIO16 input.
null |
void gpio16_output_conf | ( | void | ) |
Enable GPIO16 output.
null |
void gpio16_output_set | ( | uint8 | value | ) |
Set GPIO16 output level.
uint8 | value : GPIO16 output level. |
uint32 gpio_input_get | ( | void | ) |
Sample the value of GPIO input pins and returns a bitmask.
null |
void gpio_intr_handler_register | ( | void * | fn, |
void * | arg | ||
) |
Register an application-specific interrupt handler for GPIO pin interrupts.
void | *fn:interrupt handler for GPIO pin interrupts. |
void | *arg:interrupt handler's arg |
void gpio_output_conf | ( | uint32 | set_mask, |
uint32 | clear_mask, | ||
uint32 | enable_mask, | ||
uint32 | disable_mask | ||
) |
Configure Gpio pins out or input.
uint32 | set_mask : Set the output for the high bit, the corresponding bit is 1, the output of high, the corresponding bit is 0, do not change the state. |
uint32 | set_mask : Set the output for the high bit, the corresponding bit is 1, the output of low, the corresponding bit is 0, do not change the state. |
uint32 | enable_mask : Enable Output |
uint32 | disable_mask : Enable Input |
void gpio_pin_intr_state_set | ( | uint32 | i, |
GPIO_INT_TYPE | intr_state | ||
) |
Config interrupt types of GPIO pin.
uint32 | i : The GPIO sequence number. |
GPIO_INT_TYPE | intr_state : GPIO interrupt types. |
void gpio_pin_wakeup_disable | ( | ) |
Disable GPIO wake up to light sleep.
null |
void gpio_pin_wakeup_enable | ( | uint32 | i, |
GPIO_INT_TYPE | intr_state | ||
) |
Configure GPIO wake up to light sleep,Only level way is effective.
uint32 | i : Gpio sequence number |
GPIO_INT_TYPE | intr_state : the level of wake up to light sleep |