Commit Graph

130 Commits

Author SHA1 Message Date
Phil Howard b1fd8936cf Badger2040: Enforce minimum update blocking time. 2022-03-25 10:57:30 +00:00
Mike Bell fe943a05f7 Include USER button in button state 2022-03-24 23:24:10 +00:00
Phil Howard 39e9728b0e Badger2040: Fix text rotation aliasing for #290
Fix text rendering at 90, 180 and 270 degree rotations by avoiding float -> int truncation.
2022-03-11 13:48:41 +00:00
Mike Bell 6975610fdc Don't use wait_for_press because that waits for the button to be released 2022-03-09 23:53:56 +00:00
Mike Bell fefa6f8880 Change internal state of Badger2040 to protected 2022-03-09 23:47:12 +00:00
Mike Bell bbb995a062 Reboot on button press when halted but still have power 2022-03-09 23:32:52 +00:00
Mike Bell d26bb1701c Minor fixes to Badger2040 library 2022-03-02 21:08:17 +00:00
Phil Howard f90559ed41 Badger2040: Add support for colour inverted mode 2022-02-25 14:49:28 +00:00
Phil Howard 2c27296cc4 Badger2040: Add image & icon support 2022-02-25 11:08:32 +00:00
Jonathan Williamson e69115ea2e added new meaasure_text() and measure_glyph() methods 2022-02-25 11:08:32 +00:00
Phil Howard a4f7d05fe5 Badger2040: Move startup block on held buttons to launcher.py
Blocking on held buttons is bad for MicroPython, since it makes nothing happen on startup-
We need the button to be held but are waiting for a button release after some arbitrary amount of time.

Additionally running code while holding down a button would block normal MicroPython event execution and crash the host's USB bus quite severely.
2022-02-25 11:08:32 +00:00
Phil Howard 6ff5c39c1b Badger2040: Bugfixes, danger LUTs, examples 2022-02-25 11:08:32 +00:00
Phil Howard 669e96598d Badger2040: Fix input handling
Fixes input handling by clearing the button states to 0 when "wait_for_press".
2022-02-25 11:08:32 +00:00
Jonathan Williamson 07c62a849a added rotation by angle in degrees to text() and glyph() methods 2022-02-25 11:08:32 +00:00
Phil Howard a38dc98199 Badger2040: Comment out meh fonts 2022-02-25 11:08:32 +00:00
Phil Howard af230b5fd5 Badger2040: Refactor to fix MicroPython issues
Move busy wait logic into MicroPython bindings so that MICROPY_EVENT_POLL_HOOK can be called.
2022-02-25 11:08:32 +00:00
Phil Howard 5b084c1b9a Badger2040: Add Fast/Slow LUTs, bugfix and tinkering helpers 2022-02-25 11:08:32 +00:00
Phil Howard 5a0fe00149 Badger2040: Fix typo, comment out explodey wfi 2022-02-25 11:08:32 +00:00
Phil Howard 0a0aecf3f7 Badger2040: Set pull-down on inputs 2022-02-25 11:08:32 +00:00
Phil Howard 46d54072ce Badger2040 MicroPython bindings 2022-02-25 11:08:32 +00:00
Phil Howard 5f52626a4f Add partial update support 2022-02-25 11:08:32 +00:00
Jonathan Williamson ad0ebee16b added image demo for badger2040 2022-02-25 11:08:31 +00:00
Jonathan Williamson f7d61b587a added support for badger2040 2022-02-25 11:08:31 +00:00
Phil Howard 520757d14b Fix code example for #229 2022-01-26 10:07:17 +00:00
Phil Howard 9fddf89111 Remove set_backlight from TOC for #92 2022-01-26 09:50:37 +00:00
Chris Blume 9e788f7379 Correct Pico Display 2 baud
The Pico Display 2 example specifies a baud of 74 * 1000 * 1000.
However, the highest baud the Raspberry Pi Pico can achieve is
62,500,000.

I checked and even when the baud of 74 * 1000 * 1000 is specified,
it ends up using the max that the Raspberry Pi Pico can handle anyway.

This commit removes the incorrect baud parameter, using the default
parameter instead.
2021-12-02 11:42:29 -08:00
Philip Howard 1a9e2802fe
Merge pull request #206 from pimoroni/driver/pwm3901
C++ and MP drivers and examples for Optical Flow sensors
2021-10-06 11:19:29 +01:00
Phil Howard efdc05805f Drop redundant library and example 2021-09-08 13:56:03 +01:00
ZodiusInfuser 9906fdec38 C class and MP bindings for PicoDisplay2 2021-09-08 13:56:03 +01:00
Phil Howard 9ba3a6cfab 320x240 LCD library + tweaks to ST7789 driver
Add the init required for the 320x240 2.0" LCD.

Add an option to set baudrate, 320x240 needs 74MHz for 60FPS

Add library and example for 320x240 2.0 LCD.
2021-09-08 13:55:57 +01:00
ZodiusInfuser 77f082a984 Initial setup for PMW/PAA flow sensor 2021-09-07 16:23:32 +01:00
Phil Howard ab3951cd15 Pico Unicorn: fix MP soft reset & cleanup
* Enhance the soft reset guard to properly reinitialise the PIO/DMA and resume display operation
* Remove dead code and debug pin wiggle.
2021-08-26 21:58:37 +01:00
ZodiusInfuser 0faa312358 Updated micropython example to use working submodule 2021-08-19 15:16:40 +01:00
ZodiusInfuser 3d34d70722 Removed unneeded statics 2021-08-19 14:22:43 +01:00
ZodiusInfuser 8e763f5efe Added a plasma2040 namespaces 2021-08-19 14:12:56 +01:00
ZodiusInfuser 823729dc24 Move apa and ws PIO into drivers so they can be easily used with more boards 2021-08-19 13:40:46 +01:00
ZodiusInfuser 64e6d248d5 Updated rainbow example to be consistant across languages 2021-08-19 12:58:13 +01:00
Phil Howard 6ce80cd289 Plasma WS2812: Add RGBW and color-order support 2021-08-02 14:37:07 +01:00
Phil Howard 693e84c73d Allow uP allocated buffer for Plasma LEDs 2021-08-02 14:37:07 +01:00
Phil Howard 596fb55a57 Add "plasma" MicroPython module
Includes "WS2812" and "APA102" modules, wrapping the libraries.

Uses a destructor to clean up the LED strip and resources when MicroPython is stopped/restarted.
2021-08-02 14:37:06 +01:00
Phil Howard 815e784625 Plasma 2040 library & examples
Library:

Includes classes for driving WS2812 and APA102 LEDs and defines for Plasma features.

Encoder Example:

Supports connecting a Rotary Encoder via the Qw'St connector.

Works with APA102 or WS281X pixels.

Pressing A will cycle between:
1. Colour change
2. Brightness change
3. Cycle delay

Pressing B will switch back into auto-cycle mode.

Turning the encoder at any time will switch out of auto cycle mode into parameter adjust mode.

Also includes a bugfix to Rotary Encoder for getting the interrupt correctly.

Rainbow Example:

Basic rainbow cycle, press B to speed up and A to slow down.
2021-08-02 14:36:01 +01:00
Phil Howard b80b714c4f BH1745 MicroPython bindings & example 2021-07-30 12:41:06 +01:00
Phil Howard 6022928517 Fix Pico Explorer SPI for #162
The switch to common I2C and common definitions for SPI had broken an edge case in Pico Explorer where no backlight pin is used.

The backlight pin was inadvertently set to the front Breakout Garden SPI slot default, which is pin 20- this also happens to be the I2C SDA pin for Pico Explorer, breaking I2C comms.

This fix adds a new special case board "PICO_EXPLORER_ONBOARD" so that ST7789 can be initialised without the backlight pin.

This will be useful for anyone using ST7789 without the rest of the Pico Explorer library, although it feels a little contrived.

Also switches ST7735 over to the common defines.
2021-06-05 19:06:11 +01:00
Phil Howard 77839e2a6a Tidy up constructors, drop unused variables, const single addr
Removes i2c_inst_t from constructors since it's ignored, and updated the Python bindings not to supply this argument. Instance is inferred from the supplied pins.
2021-05-17 14:50:49 +01:00
Phil Howard 445737088f Switch drivers over to I2C class, tidy up common include
Removes all driver-specific SDA/SCL pin definitions and defaults.
Pin type is "uint" everywhere, but "PIN_UNUSED" is *int*_max for MicroPython compat. That's still a lot of pins!
Adds baudrate to the I2C class, and allows a driver (like Trackball) to check the baudrate is supported
2021-05-17 11:46:12 +01:00
Phil Howard 42c7555c96 Add common I2C class
This change adds a common I2C class, gathering various I2C functions into a single point of responsibility.

It's necessary for correctly managing the I2C bus pins and state across multiple devices.
2021-05-14 23:02:38 +01:00
Phil Howard 3dfae2ed5c Add a common header for pins and settings
* Add a common/pimoroni.hpp to list default pins for various add-ons
* Move the BG SPI Slot enum here for safe keeping
* Switch all GPIO pin references to "uint" to match Pico SDK and bring back PIN_UNUSED as UINT_MAX
2021-05-14 21:55:19 +01:00
ZodiusInfuser f2ee2a4f8d Better solution to keywords and constructors. Just for I2C for now 2021-05-14 17:14:07 +01:00
ZodiusInfuser 09fc7ca4a7 Added MP address printout for supported breakouts 2021-05-14 15:14:47 +01:00
ZodiusInfuser 80eddb24c7 Updated RV3028 driver to our coding style and included a standalone C example 2021-05-14 13:15:08 +01:00