summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2021-03-15run code formatting scriptmicroDev
2020-07-06Add license to some obvious files.Diego Elio Pettenò
2020-06-03Fix up end of file and trailing whitespace.Diego Elio Pettenò
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2019-11-18Supervisor: move most of systick to the supervisorJeff Epler
This code is shared by most parts, except where not all the #ifdefs inside the tick function were present in all ports. This mostly would have broken gamepad tick support on non-samd ports. The "ms32" and "ms64" variants of the tick functions are introduced because there is no 64-bit atomic read. Disabling interrupts avoids a low probability bug where milliseconds could be off by ~49.5 days once every ~49.5 days (2^32 ms). Avoiding disabling interrupts when only the low 32 bits are needed is a minor optimization. Testing performed: on metro m4 express, USB still works and time.monotonic_ns() still counts up
2019-02-18Fix #ifdefs in port.c to call xxx_reset() rroutines properly. Remove most ↵Dan Halbert
uses of EXPRESS_BOARD.
2018-10-09Get DHCP working ...Nick Moore
2018-10-04Fixups for wiznet 5500 driverNick Moore
2018-10-04Copy wiznet drivers over from MicroPython 1.9.4Nick Moore
2018-07-12continued WIP: almost compilingDan Halbert
2018-07-11WIP: after merge; before testingDan Halbert
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-20Delete a bunch of docs, drivers and examples not relevant to CircuitPython.Scott Shawcroft
This fixes #345 and fixes #215.
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
2017-10-16drivers/wiznet5k: Get low-level W5500 driver working.Damien George
This patch implements the basic SPI read/write functions for the W5500 chip. It also allows _WIZCHIP_ to be configured externally to select the specific Wiznet chip.
2017-10-16drivers/wiznet5k: Improve the performance of socket ops with threading.Li Weiwei
Use MICROPY_THREAD_YIELD() instead of HAL_Delay in busy waiting to improve the performance of connect, send, recv, sento and recvfrom.
2017-10-06drivers/display/ssd1306: Make poweron() work the same with SSD1306_SPI.Damien George
The poweroff() and poweron() methods are used to do soft power control of the display, and this patch makes these methods work the same for both I2C and SPI interfaces.
2017-10-06drivers/display/ssd1306: Implement SSD1306_I2C poweron method.Tiago Queiroz
After a poweroff(), the poweron() method does a soft power-on and any previous state of the display persists.
2017-10-04all: Remove inclusion of internal py header files.Damien George
Header files that are considered internal to the py core and should not normally be included directly are: py/nlr.h - internal nlr configuration and declarations py/bc0.h - contains bytecode macro definitions py/runtime0.h - contains basic runtime enums Instead, the top-level header files to include are one of: py/obj.h - includes runtime0.h and defines everything to use the mp_obj_t type py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h, and defines everything to use the general runtime support functions Additional, specific headers (eg py/objlist.h) can be included if needed.
2017-10-03drivers/nrf24l01: Make nRF24L01 test script more portable.Damien George
2017-09-25drivers/display/ssd1306.py: Improve performance of graphics methods.Peter Hinch
It removes the need for a wrapper Python function to dispatch to the framebuf method which makes each function call a bit faster, roughly 2.5x. This patch also adds the rest of the framebuf methods to the SSD class.
2017-08-29drivers/memory/spiflash: Change from hard-coded soft SPI to generic SPI.Damien George
The SPI flash driver now supports using an arbitrary SPI object to communicate with the flash chip, and in particular can use a hardware SPI peripheral.
2017-08-13all: Raise exceptions via mp_raise_XXXJavier Candeira
- Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-18all: Unify header guard usage.Alexander Steffen
The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
2017-06-26drivers/onewire: Enable pull-up when init'ing the 1-wire pin.Damien George
A previous version of the 1-wire driver (which was recently replaced by the current one) had this behaviour and it allows to create a 1-wire bus without any external pull-up resistors.
2017-06-22drivers/onewire: Move onewire.py, ds18x20.py from esp8266 to drivers.Damien George
These drivers can now be used by any port (so long as that port has the _onewire driver from extmod/modonewire.c). These drivers replace the existing 1-wire and DS18X20 drivers in the drivers/onewire directory. The existing ones were pyboard-specific and not very efficient nor minimal (although the 1-wire driver was written in pure Python it only worked at large enough CPU frequency). This commit brings backwards incompatible API changes to the existing 1-wire drivers. User code should be converted to use the new drivers, or check out the old version of the code and keep a local copy (it should continue to work unchanged).
2017-05-21drivers: Replace deprecated Pin.high()/low() methods with .__call__(1/0).Paul Sokolovsky
2017-05-17drivers/display/lcd160cr_test: Allow test to take orientation parameter.Damien George
2017-05-17drivers/display/lcd160cr: Fix get_line method and enhance screen_dump.Damien George
The docs are updated and describe the new behaviour of these methods.
2017-04-07drivers/nrf24l01: Update to work on newer ports, using machine, utime.Damien George
Changes made are: - Use the time module in place of the pyb module for delays. - Use spi.read/spi.write instead of spi.send/spi.receive. - Drop some non-portable parameters to spi and pin initialization. Thanks to @deshipu for the original patch.