Esp8266 SPI Slave interrupts

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Posts: 3
Joined: Mon Apr 24, 2017 8:36 am

Esp8266 SPI Slave interrupts

Post by paraflou » Mon Apr 24, 2017 10:14 am

Hi there,

Just burned micropython in esp8266 and it works great!

I ve been searching github and forums about spi interrupts in terms of micropython.

So far i get these:

1. ... /pins.html
At chapter 6.1 External interrupts it is clear that i can call irq method on o Pin object and set a callback function.

2. ... rdware-API
I quote from IRQ section of above link
""" Peripherals that support interrupts provide the irq method which returns an irq object. This can be used to execute a function when an IRQ is triggered, or wake up the device, or both.
peripheral.irq(*, trigger, priority=1, handler=None, wake=None) """

Of course i also checked ... rules.html

My use case is:
I am building a multisensor device and i use esp8266 as a wifi module for my uC which is LPC4367. Lpc is used as spi master and esp8266 as spi slave. The spi interface that i am using is HSPI.
I leveraged c code examples for spi slave functionality and it is working fine but it is quite painfull especially for future added features.
I want to have bidirectional communication between master spi device (LPC) and slave spi device (esp).

In order to achieve above functionality when spi master sends sth to spi slave (esp) i want an interrupt raised and an isr to be triggered.

In c code spi_slave_isr_sta function needs to be impelemented to have this functionality. (Espressif official Esp8266 guide says so)

My question is:
Do i have to set irq to the pin that is for esp (slave spi) incoming data (mosi line) or i need an implementation of spi irq?

I found that hspi has no implementation of an IRQ so far. Is this right?

Thanks a lot in advace!

Post Reply