aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2021-04-23drivers/sdcard: Add sleep_ms(1) delay in SDCard.readinto sync loop.Damien George
So this driver works on faster MCUs (that run this loop fast) with older, slower SD cards. Fixes issue #7129. Signed-off-by: Damien George <damien@micropython.org>
2020-12-18drivers/memory/spiflash: Add MICROPY_HW_SPIFLASH_ENABLE_CACHE option.Damien George
This only needs to be enabled if a board uses FAT FS on external SPI flash. When disabled (and using external SPI flash) 4k of RAM can be saved. Signed-off-by: Damien George <damien@micropython.org>
2020-09-08extmod/modbluetooth: Refactor stack/hci/driver/port bindings.Jim Mussared
Previously the interaction between the different layers of the Bluetooth stack was different on each port and each stack. This commit defines common interfaces between them and implements them for cyw43, btstack, nimble, stm32, unix.
2020-09-04all: Rename "sys" module to "usys".stijn
This is consistent with the other 'micro' modules and allows implementing additional features in Python via e.g. micropython-lib's sys. Note this is a breaking change (not backwards compatible) for ports which do not enable weak links, as "import sys" must now be replaced with "import usys".
2020-04-07drivers/display/ssd1306.py: Change the SET_COM_PIN_CFG setting.robert-hh
Making it more specific to use 0x02 for display with an aspect ratio > 2 (resolutions 96x16 and 128x32) and 0x12 for all other sizes as recommended by @mcauser. Tested with a 64x32 display which did not work before.
2020-04-05all: Use MP_ERROR_TEXT for all error messages.Jim Mussared
2020-03-25drivers/onewire: Fix undefined variable errors.Andreas Motl
On CPython, and with pylint, the variables MATCH_ROM and SEARCH_ROM are undefined. This code works in MicroPython because these variables are constants and the MicroPython parser/compiler optimises them out. But it is not valid Python because they are technically undefined within the scope they are used. This commit makes the code valid Python code. The const part is removed completely because these constants are part of the public API and so cannot be moved to the global scope (where they could still use the MicroPython const optimisation).
2020-03-10stm32: Refactor bluetooth stack/hci/driver bindings.Damien George
This makes a cleaner separation between the: driver, HCI UART and BT stack. Also updated the naming to be more consistent (mp_bluetooth_hci_*). Work done in collaboration with Jim Mussared aka @jimmo.
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-16drivers/nrf24l01: Change pipe addrs in test to match Arduino addrs.Peter Hinch
These addresses were initially chosen to match the nRF24 Arduino library examples but they are byte-reversed. So change them to be on-air compatible with the Arduino library. Also, the data sheet for the nRF24 says that RX data pipes 1-5 must share the same top 32-bits, and must differ only in the LSbyte. The addresses used here (while correct because they are on TX pipe and RX pipe 0) are misleading in this sense, because it looks like they were chosen to share the top 32-bits per the datasheet.
2020-01-31drivers/cyw43: Return early from cyw43_wifi_set_up if wifi_on fails.Damien George
2020-01-31drivers/cyw43: Include stdio.h in files that use printf.Damien George
2020-01-30drivers, stm32: Support SPI/QSPI flash chips over 16MB.Andrew Leech
With a SPI flash that has more than 16MB, 32-bit addressing is required rather than the standard 24-bit. This commit adds support for 32-bit addressing so that the SPI flash commands (read/write/erase) are selected automatically depending on the size of the address being used at each operation.
2019-12-27drivers/cyw43: Fix to build in nanbox mode.Damien George
2019-12-13drivers/wiznet5k: Allow selecting maximum fixed buffer size for MACRAW.Damien George
Enabling WIZCHIP_USE_MAX_BUFFER will make the TX/RX buffers the maximum available size, for use with MACRAW mode.
2019-11-06drivers/sdcard: Raise exception on timeout of readinto.Jeremy Herbert
Otherwise the code can get stuck in an infinite loop if the SD card fails to respond to a read.
2019-10-16drivers/onewire/ds18x20.py: Add support for DS1822 sensor.Damien George
DS1822P sensors behave just like the DS18B20 except for the following: - it has a different family code: 0x22 - it has only the GND and DQ pins connected, it uses parasitic power from the data line Contributed by @nebelgrau77.
2019-10-01drivers/cyw43: Add low-level CYW43xx Bluetooth HCI UART driver.Damien George
2019-07-03drivers/memory/spiflash: Add support to put SPI flash in sleep mode.Damien George
2019-06-03drivers: Add driver for CYW43xx WiFi SoCs.Damien George
2019-05-20drivers/display/ssd1306.py: Change to use new i2c.writevto() method.Damien George
Fixes issue #3482.
2019-03-08drivers/memory/spiflash: Rework wait_sr to fix uninit'd variable 'sr'.Andrew Leech
2019-01-22drivers/dht: Allow open-drain-high call to be DHT specific if needed.Damien George
Some ports (eg esp8266) need to have specific behaviour for driving a DHT reliably.
2018-09-20drivers/sdcard: Remove debugging print statement in ioctl method.Peter Hinch
2018-09-20drivers/sdcard: In test use os.umount and machine module instead of pyb.Peter Hinch
pyb.umount(None, mountpoint) no longer works.
2018-09-18drivers/display/lcd160cr.py: In fast_spi, send command before flushing.Damien George
The intention of oflush() is to flush the "fast SPI" command itself so that the SPI object is ready to use when the function returns.
2018-08-08drivers/cc3000: Use cc3000_time_t instead of time_t for custom typedef.roland
Otherwise it can clash with time_t from the C standard include headers.
2018-07-05drivers/sdcard: Do not release CS during the middle of read operations.Mateusz Kijowski
It seems that some cards do not tolerate releasing the card (by setting CS high) after issuing CMD17 (and 18) and raising it again before reading data. Somehow this causes the 0xfe data start marker not being read and SDCard.readinto() is spinning forever (or until this byte is in the data). This seems to fix weird behviour of SDCard.readblocks() returning different data, also solved hanging os.mount() for my case with a 16GB Infineon card. This stackexchange answer gives more context: https://electronics.stackexchange.com/questions/307214/sd-card-spi-interface-issue-read-operation-returns-0x3f-0xff-instead-of-0x7f-0#307268
2018-06-15drivers/sdcard: Fix bug in computing number of sectors on SD Card.Damien George
This was a typo from the very first commit of this file.
2018-06-15drivers/sdcard: Change driver to use new block-device protocol.Damien George
2018-06-14drivers/memory/spiflash: Add functions for direct erase/read/write.Damien George
These new API functions do not use the cache.
2018-06-14drivers/memory/spiflash: Rename functions to indicate they use cache.Damien George
This patch renames the existing SPI flash API functions to reflect the fact that the go through the cache: mp_spiflash_flush -> mp_spiflash_cache_flush mp_spiflash_read -> mp_spiflash_cached_read mp_spiflash_write -> mp_spiflash_cached_write
2018-06-14drivers/memory/spiflash: Move cache buffer to user-provided config.Damien George
This patch removes the global cache variables from the SPI flash driver and now requires the user to provide the cache memory themselves, via the SPI flash configuration struct. This allows to either have a shared cache for multiple SPI flash devices (by sharing a mp_spiflash_cache_t struct), or have a single cache per device (or a mix of these options). To configure the cache use: mp_spiflash_cache_t spi_bdev_cache; const mp_spiflash_config_t spiflash_config = // any bus options .cache = &spi_bdev_cache, };
2018-06-01drivers/wiznet5k: Fix bug with MACRAW socket calculating packet size.Damien George
2018-03-13drivers/memory/spiflash: Fix bugs in and clean up read/write functions.Damien George
mp_spiflash_read had a bug in it where "dest" and "addr" were incremented twice for a certain special case. This was fixed, which then allowed the function to be simplified to reduce code size. mp_spiflash_write had a bug in it where "src" was not incremented correctly for the case where the data to be written included the caching buffer as well as some bytes after this buffer. This was fixed and the resulting code simplified.
2018-03-11drivers/memory/spiflash: Fix setting of QE bit in flash register.Damien George
2018-03-10drivers/memory/spiflash: Change to use low-level SPI object not uPy one.Damien George
This patch alters the SPI-flash memory driver so that it uses the new low-level C SPI protocol (from drivers/bus/spi.h) instead of the uPy SPI protocol (from extmod/machine_spi.h). This allows the SPI-flash driver to be used independently from the uPy runtime.
2018-03-10drivers/bus: Pull out software SPI implementation to dedicated driver.Damien George
This patch takes the software SPI implementation from extmod/machine_spi.c and moves it to a dedicated file in drivers/bus/softspi.c. This allows the SPI driver to be used independently of the uPy runtime, making it a more general component.
2018-03-02drivers/memory/spiflash: Add support for QSPI interface.Damien George
The spiflash memory driver is reworked to allow the underlying bus to be either normal SPI or QSPI. In both cases the bus can be implemented in software or hardware, as long as the spiflash driver is passed the correct configuration structure.
2018-03-02drivers/bus: Add QSPI abstract type with software QSPI implementation.Damien George
A new directory drivers/bus/ is introduced, which can hold implementations of bus drivers. A software QSPI implementation is added.
2018-02-18drivers/sdcard: Update SD mounting example code for ESP8266.Damien George
2018-02-05drivers/cc3200: Update to work with new stm32 SPI API.Damien George
2018-01-31drivers/sdcard: Update doc for ESP8266 to use correct SPI number.Hemanth kumar
machine.SPI(0) results in ValueError on ESP8266. SPI(1) is the user hardware SPI port (or use SPI(-1) for software SPI).
2018-01-31stm32: Add support for DHT11/DHT22 sensors.Damien George
2018-01-31esp8266/modules: Move dht.py driver to drivers/dht directory.Damien George
2018-01-10drivers/sdcard: Avoid allocation on the heap.Ayke van Laethem
This commit fixes two things: 1. Do not allocate on the heap in readblocks() - unless the block size is bigger than 512 bytes. 2. Raise an error instead of returning 1 to indicate an error: the FAT block device layer does not check the return value. And other backends (e.g. esp32 blockdev) also raise an error instead of returning non-zero.
2018-01-10drivers/display/ssd1306: Fix super() call in SSD1306 driver.Jim Mussared
2017-12-22drivers/sdcard: Support old SD cards (<=2GB).Ayke van Laethem
2017-12-13drivers/display/ssd1306: Make SSD1306 class inherit from FrameBuffer.Peter Hinch
2017-11-20drivers/nrf24l01: Make driver and test run on pyboard, ESP8266, ESP32.Peter Hinch