summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
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.
2017-02-27drivers/display/lcd160cr: Add check that JPEG size is less than 65536.Damien George
2017-02-24drivers/display/lcd160cr: Fix bug with save_to_flash method.Damien George
2017-02-21drivers/display/lcd160cr: Fix bugs with lcd.get_pixel().Damien George
Fixes issues #2880 and #2881.
2017-02-17drivers/display/lcd160cr: Use correct variable in set_power().Stephan Brauer
2017-02-05extmod/machine_pulse: Make time_pulse_us() not throw exceptions.Paul Sokolovsky
machine.time_pulse_us() is intended to provide very fine timing, including while working with signal bursts, where each transition is tracked in row. Throwing and handling an exception may take too much time and "signal loss". So instead, in case of a timeout, just return negative value. Cases of timeout while waiting for initial signal stabilization, and during actual timing, are recognized. The documentation is updated accordingly, and rewritten somewhat to clarify the function behavior.
2017-01-24drivers/memory: Add SPI flash driver, written in C.Damien George
2017-01-23drivers/display: Add driver and test for uPy LCD160CR display.Damien George
2017-01-18drivers: Fix some minor spelling mistakes.Mike Causer
respones -> response succeses -> successes
2017-01-08drivers/onewire/ds18x20: Fix negative temperature calc for DS18B20.syndycat
2017-01-03drivers/onewire: Enable pull up on data pin.Dave Hylands
The driver seems to be be enabling the pullup resistor in most places, but not this one. Making this one little change allows onewire devices to be used with no external pullup resistor.
2016-12-01drivers/display/ssd1306.py: Update to use FrameBuffer not FrameBuffer1Radomir Dopieralski
2016-11-03drivers: Add "from micropython import const" when const is used.Damien George
Following best-practice use of the const feature, to make it compatible with Python.
2016-10-21py: Specialise builtin funcs to use separate type for fixed arg count.Damien George
Builtin functions with a fixed number of arguments (0, 1, 2 or 3) are quite common. Before this patch the wrapper for such a function cost 3 machine words. After this patch it only takes 2, which can reduce the code size by quite a bit (and pays off even more, the more functions are added). It also makes function dispatch slightly more efficient in CPU usage, and furthermore reduces stack usage for these cases. On x86 and Thumb archs the dispatch functions are now tail-call optimised by the compiler. The bare-arm port has its code size increase by 76 bytes, but stmhal drops by 904 bytes. Stack usage by these builtin functions is decreased by 48 bytes on Thumb2 archs.
2016-10-21py: Be more specific with MP_DECLARE_CONST_FUN_OBJ macros.Damien George
In order to have more fine-grained control over how builtin functions are constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific, with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW. These names now match the MP_DEFINE_CONST_FUN_OBJ macros.
2016-10-07driver/dht: Use mp_raise_OSError helper function.Damien George
2016-09-01drivers/sdcard: Port the SDCard driver to new machine API.Radomir Dopieralski
With backwards compatibility for pyboard.
2016-07-11drivers/wiznet5k: Fix indentation so it's not misleading.Damien George
Otherwise gcc 6.1.1 raises a misleading-indentation error.
2016-06-26drivers/display/ssd1306: Add width arg and support 64px wide displays.Radomir Dopieralski
In particular, the WeMOS D1 Mini board comes with a shield that has a 64x48 OLED display. This patch makes it display properly, with the upper left pixel being at (0, 0) and not (32, 0). I tried to do this with the configuration commands, but there doesn't seem to be a command that would set the column offset (there is one for the line offset, though).
2016-06-03drivers/display/ssd1306: update SSD1306_SPI to work with new APIRadomir Dopieralski
Makes it work on the ESP8266.
2016-05-31extmod: Add machine time_pulse_us function (at C and Python level).Damien George
The C implementation is taken from the DHT driver.
2016-05-26drivers: Add C-level function to read DHT11 and DHT22 devices.Damien George
Uses mp_hal_pin API.
2016-05-10drivers/cc3000: Rename timeval to cc3000_timeval, to avoid clash.Damien George
The timeval struct can be defined by system C headers.
2016-04-12drivers: Add SSD1306 OLED driver, with I2C and SPI interfaces.Damien George
2016-02-02drivers/sdcard: Add support for multi-block read/write; add SD test.Peter Hinch
2015-10-10drivers/sdcard: Allow up to 5 retries to initialise SD card.Damien George
Apparently some cards need more than 2 retries. See issue #1482.
2015-09-18drivers/nrf24l01: Fix SPI phase setting to match specs of nRF chip.Damien George
Addresses issue #1466.
2015-07-30drivers/onewire: Fix ds18x20.read_temp so it works when no rom given.Damien George
2015-04-18stmhal: Remove std.h. It's not needed anymore.Damien George
2015-03-16drivers: Update CC3100 driver library to SDK release version 1.1.0.danicampora
2015-03-03drivers: Add onewire driver and ds18x20 temperature sensor driver.Damien George
2015-02-22drivers/cc3100: Remove simplelink trace messages completely.danicampora
Those trace messages have never proven to be useful and they make the code 9K bigger.
2015-02-21drivers/cc3100: Remove dependence on debug.h.Damien George
2015-02-21drivers/cc3100: Make wlan.c closer to TI original file.danicampora
2015-02-21cc3200: Get compiling with CC3100 driver from drivers/ directory.Damien George
2015-02-21cc3200: Move CC3100 driver from cc3200/simplelink to drivers/cc3100.Damien George
This commit will not build, it exists just to track changes.
2015-01-07drivers/cc3000: Fix call to extint_register.Damien George
2015-01-01stmhal: Prefix includes with py/; remove need for -I../py.Damien George
2014-12-27drivers: Add SD card driver, controlled via SPI bus.Damien George
2014-12-09drivers, nrf24: Nonblocking send now uses send_start and send_done.adminpete
2014-12-09drivers, nrf24: Nonblocking send now done by generator.adminpete
2014-12-09drivers, nrf24: Add nonblocking send option etc.Peter Hinch