Search found 7 matches

by Frans
Wed Aug 24, 2022 4:37 am
Forum: Programs, Libraries and Tools
Topic: Example for working native mpy module with SPI communication?
Replies: 8
Views: 77055

Re: Example for working native mpy module with SPI communication?

the it8951 is an e-paper driver for some waveshare displays as used in the M5Paper - I was hoping to be able to provide a memory and CPU efficient driver using those native modules without the need to compile the whole firmware every time. But I think I got the idea now - I'll just do it in pure Pyt...
by Frans
Tue Aug 23, 2022 6:07 am
Forum: Programs, Libraries and Tools
Topic: Example for working native mpy module with SPI communication?
Replies: 8
Views: 77055

Re: Example for working native mpy module with SPI communication?

So as far as I understand my current options would be to * either turn the code from e.g. https://github.com/lovyan03/LovyanGFX/tree/master/src/lgfx/v1/panel into a MicroPython C module as done in https://github.com/russhughes/st7789_mpy * or to write a Python native driver for the it9851 and later ...
by Frans
Tue Aug 23, 2022 4:48 am
Forum: Programs, Libraries and Tools
Topic: Example for working native mpy module with SPI communication?
Replies: 8
Views: 77055

Re: Example for working native mpy module with SPI communication?

Yes, https://github.com/russhughes/st7789_mpy indeed is a C module - I was hoping the code is not too different from a native module as in examples/natmod and it deals with SPI communication as I need it. So my plan was to take one of the natmod examples and just see how include paths are being mana...
by Frans
Mon Aug 22, 2022 5:38 pm
Forum: Programs, Libraries and Tools
Topic: Example for working native mpy module with SPI communication?
Replies: 8
Views: 77055

Re: Example for working native mpy module with SPI communication?

Do you have a minimal example of how to provide the correct include paths and actual includes to do basic SPI communication? I tried to use the code @ https://github.com/russhughes/st7789_mpy as a source for example snippets but already failed to include "extmod/machine_spi.h"..
by Frans
Sat Aug 20, 2022 6:49 pm
Forum: Programs, Libraries and Tools
Topic: Example for working native mpy module with SPI communication?
Replies: 8
Views: 77055

Example for working native mpy module with SPI communication?

I'm currently trying to provide an it8951 driver as a native MicroPython module but it looks like I've underestimated the effort. So I wonder whether I'm on the right track anyway. Can you have a look and give me some feedback about existing projects or bad approaches? [*] Goal: have a IT9851 e-Pape...
by Frans
Thu Jun 23, 2022 5:24 am
Forum: General Discussion and Questions
Topic: Is there a way to check if a USB cable connected to a ESP32 based device?
Replies: 3
Views: 4018

Is there a way to check if a USB cable connected to a ESP32 based device?

I'd like to make a device behave differently based on whether a USB cable is connected (ideally I'd even like to know whether there is a serial connection or just a power supply). On devices with a PMU (like M5StickC) I currently read the USB voltage. But that seems weird, since I have to import and...
by Frans
Thu Jun 23, 2022 5:07 am
Forum: General Discussion and Questions
Topic: Can I lightsleep() until any of some given GPIOs go HIGH (on ESP32)?
Replies: 3
Views: 2034

Can I lightsleep() until any of some given GPIOs go HIGH (on ESP32)?

I'd like to wait for a couple (i.e. more than one) of buttons (GPIOs) on an AudioKit / M5StickC (ESP32 based) to be pressed (and ideally released, too), without wasting CPU cycles (i.e. battery power). I found machine.lightsleep() to do what I want but it looks like I can't tell it to wait for more ...