Using a USB Keyboard with the ESP8266 NONOS SDK

AgentSmithers
Posts: 165
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Using a USB Keyboard with the ESP8266 NONOS SDK

Postby AgentSmithers » Wed Jul 10, 2019 9:33 am

Hey Everyone!
Hope everyone is doing well. I'm back from a mini vacation and am going down the USB rabbit hole to implement keyboard interrupt control / input for the ESP8266 NONOS SDK. Now I think I may know enough to pull it off so I ordered a few Max3421 breakout boards and have a gameplan to tackle usb input. Before I dive in and burn time I wanted to reach out and see if any of you have gone down this road already with the ESP and actually made traction?

PostScript: Does anyone know of any useful psudo code that describes setting up the Max3421 for Keyboard Interrupt request? Somelike like below...

Set Mode:
1. Assert SS low.
2. Clock out SPI command byte 11011010 – selects R27 (MODE) for a write.
3. Clock out 11000001 – sets D+ and D- pulldowns and Host mode.
3. Assert SS high to end.

Read HRSL status register:
4. Assert SS low.
5. Clock out SPI command byte 11111000 – selects R31 (HRSL) for a read.
6. Clock in R31 data and check for JSTATUS AND KSTATUS to determine when a device has been connected or disconnected and is a Low or High speed device.
7. Loop step 6 until detected.
8. Assert SS high to end.

Load Send FIFO register with camera shutter release command data bytes:
9. Assert SS low.
10. Clock out SPI command byte 00010010 – selects R2 (SNDFIFO) for a write.
11. Clock out data bytes to load Send FIFO.
12. Assert SS high to end.

Load Send Byte Count register with the number of data bytes in Send FIFO:
13. Assert SS low.
14. Clock out SPI command byte 00111010 – selects R7 (SNDBC) for a write.
15. Clock out number of bytes loaded into SNDFIFO.
16. Assert SS high to end.

Send data to device by writting to HXFR register:
17. Assert SS low.
18. Clock out SPI command byte 11110010 – selects R30 (HXFR) for a write.
19. Clock out 00100001 – selects Bulk Transfer and EP1.
20. Assert SS high to end.
21. Pause x seconds then repeat the write to HXFR register.

AgentSmithers
Posts: 165
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Re: Using a USB Keyboard with the ESP8266 NONOS SDK

Postby AgentSmithers » Thu Jul 11, 2019 5:55 am

So, I reviewed a chunk of the code from USBESP and it appears after version 1.5.2 SDK the IRAM management changed and the code was unable to fit within version SDK 2.0. I did see a comment last year that Espressif did address this issue.
Does anyone have any basic IRAM useage status from SDK to SDK?

Who is online

Users browsing this forum: MSN [Bot] and 5 guests