Wykres commitów

104 Commity (67a4490180343f61fa0c1274961ad1da92811999)

Autor SHA1 Wiadomość Data
Phil Howard b5c7add90d APA102: Extra clocks to flush pixels
This covers an edge case where pixels are updated intermittently - such as the once that happens when clearing before a Python soft reset.

Under normal circumstances users should `start` the LED strip and allow it to continuously update.
2021-08-26 18:14:39 +01:00
Phil Howard 2cc6514583 Slow set/clr_bit writes a little
We chased a bug with handling/clearing interrupts on Encoder into the depths of madness, finding that a Debug build would magically fix the bug.

Turns out it was probably just us being a little aggressive with the poor little MS51-based Encoder driver.

* Fix delays to be more delayey.
* Replace big 'ol loop and boolean with straight up checks and an early exit- the bit-addressed regs are never going to change
2021-08-26 16:35:05 +01:00
Philip Howard 07f3d65a14
Merge pull request #194 from pimoroni/patch_plasma2040_examples
Extra examples and bug fixes for Plasma2040
2021-08-26 14:36:22 +01:00
Phil Howard e283d460d4 Make ws2812 and apa102 responsibly only for their own buffers
This fixes a bug where delete[] would be called on a bytearray buffer allocated by MicroPython on gc_heap.
2021-08-25 22:00:16 +01:00
Phil Howard 53429e0c6f Do not pio_sm_unclaim for MicroPython
Adds an ifdef guard around `pio_sm_unclaim` that prevents it being called when MicroPython cleans up/finalizes classes.

For some reason this appeared to be causing a hardfault.
2021-08-25 16:06:51 +01:00
Philip Howard 0b7076d751
Merge pull request #188 from pimoroni/patch-sdcard-pio
Add support for SD over PIO SPI
2021-08-24 11:18:02 +01:00
ZodiusInfuser c8f90ea846 Changed default color order to GRB to match our strips 2021-08-23 17:18:34 +01:00
ZodiusInfuser b72e0a1bb9 Added Plasma2040 example that displays data from the BME68x 2021-08-20 18:17:39 +01:00
ZodiusInfuser 681edd255b Changed default ws2812 freq to 800khz 2021-08-19 15:36:25 +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 ae09498953 Added analog class for plasma current reading 2021-08-19 12:58:13 +01:00
Phil Howard 1e5e4c2f94 Add support for SD over PIO SPI 2021-08-04 10:16:48 +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 be9b1437db Add MicroPython bindings for BME280 and BMP280 2021-08-02 14:20:59 +01:00
Phil Howard f0eff195fe C++ SDK Support for BME280 and BMP280 2021-08-02 14:20:40 +01:00
Phil Howard 746e21c542 BME68X Add Time/Temp config to Gas, document 2021-08-02 14:12:46 +01:00
Phil Howard c402d92e0f Basic MicroPython bindings for BME68X
The BME68X library is *linked* against the MicroPython bindings, rather than compiled directly in.
This saves specifing the list of target files twice.
2021-08-02 14:12:46 +01:00
Phil Howard 22d39faf5f Bringup BME688 and BME680 sensors
This changeset brings the BOSCH BME68X Sensor API library in as a submodule and makes it buildable with CMake.

A thin wrapper- the BME68X driver- provides simple init, configure, read_forced and read_parallel functions.

Two BME688 examples are available for forced-mode and parallel-mode operation.
2021-08-02 14:11:56 +01:00
Philip Howard 73d92023e9
Merge pull request #29 from pimoroni/driver-bh1745
Add BH1745 driver
2021-08-02 09:43:46 +01:00
Philip Howard c81b92ecdc
Merge pull request #180 from Daft-Freak/patch-1
Fix some ST7789 regs
2021-08-02 09:20:25 +01:00
Phil Howard bd648034f5 Fix LTR559 duty cycle 2021-07-30 13:30:42 +01:00
Phil Howard b80b714c4f BH1745 MicroPython bindings & example 2021-07-30 12:41:06 +01:00
Phil Howard ea6acf2207 Porti BH1745 to Pimoroni I2C 2021-07-30 12:41:06 +01:00
Phil Howard 54169f4150 Add BH1745 driver 2021-07-30 12:41:02 +01:00
Phil Howard 32e226bfca Add RGBLED and Button libraries
"RGBLED" PWMs 3 pins as a single RGB LED and exposes methods to set the colour via HSV/RGB.

"Button" handles tracking the state and changed state of a single GPIO button, in addition to supporting auto-repeat for held-down buttons.
2021-07-20 15:34:24 +01:00
Charlie Birks 47a2f7c1c7
Fix some ST7789 regs
Fixes frame rate/porch register confusion and uses PWCTRL1 instead of 0xd0.
2021-07-20 15:22:31 +01:00
Philip Howard 3274069a27
Merge pull request #165 from pimoroni/patch-pico-explorer-spi
Fix Pico Explorer SPI for #162
2021-06-05 19:17:16 +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
David Lin 1f385d8f30 Fix build error: missing printf declaration 2021-06-04 23:08:26 +08:00
Phil Howard 0bda2abd2a Fix AS7262 constructor and example 2021-05-18 11:36:14 +01:00
Phil Howard 3e56dfb14c Remove unecessary manual conversion to byte arrays 2021-05-17 16:05:09 +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
Phil Howard 5ca77b6e28 Cleanup RV3028 comments/whitespace 2021-05-14 13:15:39 +01:00
Phil Howard 904bf657bb Add check for valid Chip ID and fail early
Confused myself by plugging this into a BG base. It gave all the appearance of working, but the time was not counting up.
Turns out the library will happily talk to no device whatsoever and when you "set_time" it's stored in an C array and returned as if it came from the RTC.
2021-05-14 13:15:39 +01:00
ZodiusInfuser 2be5528ec7 Partial micropython bindings for RV3028 2021-05-14 13:15:38 +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
Phil Howard fd3ef973b6 Fix MICS6814 heater enable, improve demo 2021-05-14 12:41:46 +01:00
ZodiusInfuser d45a92fef3 Micropython bindings for IOExpander breakout 2021-05-14 12:41:46 +01:00
ZodiusInfuser 31edcf8f93 Renamed IOE's set_addr method to set_address 2021-05-14 12:41:46 +01:00
ZodiusInfuser eb95bb0ffe Reorder of variables to make MP happy 2021-05-14 12:41:27 +01:00
ZodiusInfuser 05af3e86ba Renamed IOExpander and added Pot, Enc, and MICS specific classes 2021-05-14 12:40:33 +01:00
ZodiusInfuser acf011bba2 Merge in previous Nuvoton driver code 2021-05-14 12:40:33 +01:00
ZodiusInfuser ea460f9519 Micropython bindings and example for MSA301 2021-05-14 10:02:56 +01:00
ZodiusInfuser c4b166d4d9 MSA301 Driver and example tweaks 2021-05-14 10:02:49 +01:00
Jonathan Williamson f211fe67e6 Added MSA301 driver, library, and example 2021-05-14 10:01:29 +01:00