Explanation for the FUNCTION_n modes:
https://www.esp8266.com/wiki/doku.php?id=esp8266_gpio_pin_allocations
An important note:
Note that GPIO6-GPIO11 are typically used to interface with the flash memory ICs on most esp8266 modules, so these pins should not generally be used.