dc42 / DuetWiFiServer

HTTP and related server code for Duet WiFi 3D printer electronics
11 stars 9 forks source link

Why the spi slave control "CS" ? #4

Open MS1987 opened 8 years ago

MS1987 commented 8 years ago

Hi, David! I found that your esp8266 was configured to be the slave in the spi communication. But the spi "cs" pin was controled by esp8266 as well. In my experience, the "clk" and the "cs" pin should be outputed by the master. I just want to make sure of the way of spi communication.

MS1987 commented 8 years ago

And I read the duet firmware just now, found that it didn't obviously specified whether duet was master or slave.

dc42 commented 8 years ago

The ESP is the SPI master.

MS1987 commented 8 years ago

Hmm, I was not familiar with the arduino hardware driver with esp8266, and was mislead by the spi initial function. I still can not find out where to configure esp8266's spi to be master or slave.

dc42 commented 8 years ago

DuetWiFiServer uses the customised ESP8266 SPI driver in file HSPI.cpp.