Updated ESP8266 NeoMethods (markdown)

Michael Miller
2018-12-23 14:51:28 -08:00
parent b5942f0af0
commit 6c6cdabdff

@@ -1,3 +1,8 @@
The esp8266 requires hardware support to be able to reliably send the data stream. Due to this and the restrictions on which pins are used by each hardware peripheral, only io pins GPIO1, GPIO2, and GPIO3 can be used.
The DMA method will use GPIO3.
The UART1 methods will use GPIO2.
The UART0 methods will use GPIO1.
## NeoEsp8266Dma800KbpsMethod
The NeoEsp8266Dma800KbpsMethod is the underlying method that gets used if you use Neo800KbpsMethod on Esp8266 platforms. There should be no need to use it directly.
@@ -24,51 +29,49 @@ _Thanks to g3gg0.de for porting the initial DMA support from the original which
Same as NeoEsp8266Dma800KbpsMethod but running at the older and slower data rate.
The NeoEsp8266Dma400KbpsMethod is the underlying method that gets used if you use Neo400KbpsMethod on Esp8266 platforms. There should be no need to use it directly.
## NeoEsp8266DmaWs2813Method
Same as NeoEsp8266Dma800KbpsMethod but using a longer delay as required by this chips.
## NeoEsp8266DmaWs2812xMethod & NeoEsp8266DmaWs2813Method
Same as NeoEsp8266Dma800KbpsMethod. The name is only more specific but they all use the longer delay as required by these chips.
## NeoEsp8266Uart800KbpsMethod
NeoEsp8266Uart800KbpsMethod only supports the TXD1/GPIO2 pin. The Pin argument is omitted.
## NeoEsp8266Uart1800KbpsMethod & NeoEsp8266Uart0800KbpsMethod
Use this instead of Neo800KbpsMethod to force your sketch to use the UART to send data.
NeoEsp8266Uart1800KbpsMethod only supports the TXD1/GPIO2 pin. NeoEsp8266Uart0800KbpsMethod only supports the TXD0/GPIO1 pin. The Pin argument is ignored and can be omitted.
NOTE: Due to the varied board layouts for Esp8266, even though the pin maybe exposed, it may not be usable due to some custom feature on the board you use. If you find it not working, you should review the hardware schematic of your board and confirm the pin is not used for other purposes that interferes with it being used for NeoPixelBus.
This method uses the CPU to manage a small hardware managed UART buffer to send the data to the NeoPixels. Thus it requires more CPU overhead than the Dma method but it does NOT require an extra buffer.
These methods uses the CPU to manage a small hardware managed UART buffer to send the data to the NeoPixels. Thus it requires more CPU overhead than the Dma method but it does NOT require an extra buffer.
If CPU cycles are an issue in your project, see NeoEsp8266AsyncUart800KbpsMethod below.
If CPU cycles are an issue in your project, see NeoEsp8266AsyncUart1800KbpsMethod below.
Due to using the TXD1/GPIO2 pin, the Serial1 object can not be used with the method and must be avoided. The primary serial object "Serial" is available for both read and write.
Due to using the hardware UART, the associated Serial or Serial1 objects can not be used. If you use UART1, the Serial is still available and if you use UART0 then Serial1 is still available.
Use this instead of Neo800KbpsMethod to force your sketch to use the Uart to send data.
## NeoEsp8266Uart400KbpsMethod
Same as NeoEsp8266Uart800KbpsMethod but running at the older and slower data rate.
## NeoEsp8266Uart#400KbpsMethod
Same as 800Kbps Method but running at the older and slower data rate.
Use this instead of Neo400KbpsMethod to force your sketch to use the Uart to send data.
## NeoEsp8266UartWs2813Method
Same as NeoEsp8266Uart800KbpsMethod but using a longer delay as required by this chips.
## NeoEsp8266Uart#Ws2812xMethod & NeoEsp8266Uart#Ws2813Method
Same as NeoEsp8266Uart#800KbpsMethod but using a longer delay as required by these chips.
## NeoEsp8266AsyncUart800KbpsMethod
Use this instead of Neo800KbpsMethod to force your sketch to use the Uart to send data asynchronously.
NeoEsp8266AsyncUart800KbpsMethod only supports the TXD1/GPIO2 pin. The Pin argument is omitted.
## NeoEsp8266AsyncUart#800KbpsMethod
Use this instead of Neo800KbpsMethod to force your sketch to use a UART to send data asynchronously.
NeoEsp8266AsyncUart1800KbpsMethod only supports the TXD1/GPIO2 pin. NeoEsp8266AsyncUart0800KbpsMethod only supports the TXD0/GPIO1 pin. The Pin argument is ignored and can be omitted.
**WARNING:** With this method, Serial and Serial1 can not be used due to the ISR is not shareable.
**CAUTION:** With this method the `Pixels()` method will return alternating pointers after each call to `Show()`; so the pointer returned should not be cached or retained between calls of `Show()`.
NOTE: Due to the varied board layouts for Esp8266, even though the pin maybe exposed, it may not be usable due to some custom feature on the board you use. If you find it not working, you should review the hardware schematic of your board and confirm the pin is not used for other purposes that interferes with it being used for NeoPixelBus.
This method uses the UART interrupt to read from a secondary buffer to send the data to the NeoPixels. It requires very little CPU overhead but does require an extra buffer similar to the Dma method.
These methods uses the UART interrupt to read from a secondary buffer to send the data to the NeoPixels. It requires very little CPU overhead but does require an extra buffer similar to the Dma method.
If memory is an issue for your project, see the NeoEsp8266Uart800KbpsMethod above.
If memory is an issue for your project, see the NeoEsp8266Uart#800KbpsMethod above.
_Thanks to unaiur for providing the implementation._
_Thanks to unaiur for providing the original implementation._
## NeoEsp8266AsyncUart400KbpsMethod
Same as NeoEsp8266AsyncUart800KbpsMethod but running at the older and slower data rate.
## NeoEsp8266AsyncUart#400KbpsMethod
Same as NeoEsp8266AsyncUart#800KbpsMethod but running at the older and slower data rate.
Use this instead of Neo400KbpsMethod to force your sketch to use the Uart to send data asynchronously.
## NeoEsp8266AsyncUartWs2813Method
Same as NeoEsp8266AsyncUart800KbpsMethod but using a longer delay as required by this chips.
## NeoEsp8266AsyncUart#Ws2812xMethod & NeoEsp8266AsyncUart#Ws2813Method
Same as NeoEsp8266AsyncUart800KbpsMethod but using a longer delay as required by these chips.
## NeoEsp8266BitBang800KbpsMethod
NeoEsp8266BitBang800KbpsMethod supports any available pin between 0 and 15.
@@ -80,6 +83,6 @@ Use this instead of Neo800KbpsMethod to force your sketch to use the Bit Banging
Same as NeoEsp8266BitBang800KbpsMethod but running at the older and slower data rate.
Use this instead of Neo400KbpsMethod to force your sketch to use the Bit Banging to send data.
## NeoEsp8266BitBangWs2813Method
Same as NeoEsp8266BitBang800KbpsMethod but using a longer delay as required by this chips.
## NeoEsp8266BitBangWs2812xMethod & NeoEsp8266BitBangWs2813Method
Same as NeoEsp8266BitBang800KbpsMethod but using a longer delay as required by these chips.