Wykres commitów

203 Commity (master)

Autor SHA1 Wiadomość Data
Damien George 54f1694ab6 drivers/bus: Rename MP_SPI_ADDR_IS_32B to MICROPY_HW_SPI_ADDR_IS_32BIT.
And allow it to be configured externally, if needed.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-02 14:30:51 +10:00
iabdalkader 0bdfceacbe extmod/network_ninaw10: Add support for socket events callback. 2022-05-26 11:15:07 +10:00
iabdalkader be83bdf9ec drivers/ninaw10: Update driver to support firmware 1.5.0.
* Firmware 1.5.0 introduces a new BSD-like sockets ABI,
which improves the integration with MicroPython.
2022-05-25 16:05:50 +02:00
Takeo Takahashi 86e35178e6 drivers/dht/dht.py: Change default import module as machine.
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
2022-04-29 12:29:07 +09:00
iabdalkader 52c2580a40 drivers/ninaw10: Fix isconnected to return False when inactive.
If isconnected is called before active, it returns -1, which causes
mp_obj_new_bool return True, indicating the module is connected.
2022-04-20 15:40:52 +10:00
robert-hh 56b331ace6 drivers/codec: Add driver for the WM8960 codec.
This codec is assembled for the MIMXRT1xxx_DEV boards and available for
WM8960 breakout boards as well.

The driver itself has been tested as working with the MIMXRT boards and a
Sparkfun WM6890 breakout board.  It implements the initialization, basic
methods and some enhanced methods like 3D, ALC, soft-mute and deemphasis.
2022-04-04 16:31:17 +10:00
robert-hh 9c05f3aa1d drivers/sdcard: Allow setting the final SPI baudrate.
This baudrate is supplied in the constructor. The default is 1320000 as
before.

Example:

    sd = sdcard.SDCard(spi, cs, baudrate=20_000_000)
2022-02-18 14:37:44 +11:00
iabdalkader 465b74e78d drivers/ninaw10: Add NIC-level ioctl function.
This commit adds support in the driver for irregular commands.  It
currently supports setting GPIO pin mode, and GPIO pin read/write value.
2022-02-18 14:35:26 +11:00
iabdalkader 1aac151d68 drivers/ninaw10: Return standard error numbers. 2022-01-21 13:35:05 +11:00
iabdalkader e401ff8935 drivers/ninaw10: Fix timeout handling to match modusocket. 2022-01-21 13:31:41 +11:00
iabdalkader 981664fd07 drivers/ninaw10: Add function to check socket state/data availability. 2022-01-21 13:30:13 +11:00
iabdalkader 12f9f93b39 drivers/ninaw10/nina_wifi_drv: Fix DNS resolution.
- The wrong ACK is returned and checked.
- Send secondary DNS to google.
2022-01-06 14:37:34 +11:00
iabdalkader 908e4cf5c3 rp2: Add support for DHT11 and DHT22 sensors. 2022-01-06 14:00:03 +11:00
iabdalkader b65d17fced drivers/ninaw10: Fix BSSID byte order, and add null byte to ESSID.
- Fix the BSSID byte order from scan and netinfo.
- Make sure ESSID from netinfo is null terminated.
2021-11-19 15:41:26 +11:00
Jim Mussared 841eeb158e drivers/neopixel: Avoid heap alloc in fill().
Previously the use of `range(start,stop,step)` caused an allocation.
Replace with while loop.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-19 15:37:06 +11:00
iabdalkader f082793ac4 drivers/lsm6dsox: Add LSM6DSOX driver and examples. 2021-11-16 15:05:00 +11:00
iabdalkader 43079aaf86 drivers/ninaw10: Add ublox Nina-W10 WiFi/BT module driver.
- Add WiFi/BT drivers for ublox Nina-W10 (esp32 based) module.
- Add ublox Nina-W10 Python module in extmod.
2021-11-13 23:01:03 +11:00
robert-hh e7572776c3 mimxrt: Add dht_readinto() to the mimxrt module, and freeze dht.py.
The change affects dht.py from the drivers directory as well to include the
logic for the mimxrt port.
2021-10-25 23:49:28 +11:00
Damien George 30691ed2a1 drivers/cyw43: Make wifi join fail if interface is not active.
Otherwise the Python network object continues to report that it is
attempting to connect.

Also make the return error code consistent with wifi scan.

Signed-off-by: Damien George <damien@micropython.org>
2021-08-31 13:00:11 +10:00
Damien George 52a78e6965 drivers/cyw43: Fix cyw43_deinit so it can be called many times in a row.
This makes sure deinit() can be called on the interface many times without
error, and that the state of the driver is fully reset.

Fixes issue #7493.

Signed-off-by: Damien George <damien@micropython.org>
2021-08-31 13:00:11 +10:00
Jim Mussared e9a26791e5 drivers/neopixel: Reduce code size of driver.
Saves 71 bytes of bytecode.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-30 23:26:45 +10:00
Jim Mussared d63b287c85 drivers/neopixel: Optimize fill() for speed.
This makes fill() about 7x faster (PYBV11 and PYBD_SF6) for the cost of +40
bytes of bytecode (or 120 bytes text).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-30 23:26:29 +10:00
Jim Mussared 62fd450e62 drivers/neopixel: Add common machine.bitstream-based neopixel module.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-19 22:50:32 +10:00
Damien George 136369d72f all: Update to point to files in new shared/ directory.
Signed-off-by: Damien George <damien@micropython.org>
2021-07-12 17:08:10 +10:00
Mike Causer bc7822d8e9 drivers/display/ssd1306.py: Add support for 72x40 displays.
The 72x40 OLED requires selecting the internal IREF, as opposed to the
default external IREF.  This is an undocumented feature in the SSD1306
datasheet, but is present in the SSD1315 datasheet.  It's possible the
72x40 OLED is actually using the newer SSD1315 controller.  Sending the
IREF select command to SSD1306 displays has no effect on them, so it's
added to the init_display() instead of wrapping in an "if width = 72".

Also tested on a 128x64 OLED using the SSD1315 controller (smaller ribbon
cable) and the proposed change has no effect on the display, as the module
comes with the correct current limiting resistor.  Internal and external
IREF work the same.

Fixes issue #7281.
2021-06-17 18:54:32 +10:00
Mike Causer 9eea51b730 drivers/display/ssd1306.py: Add rotate method.
And clean up (make more efficient) display set-up commands.
2021-05-06 15:57:19 +10:00
iabdalkader 0d4eb15392 drivers/cyw43/cywbt: Remove hard-coded UART6 alternate function setting. 2021-04-30 10:16:27 +10:00
iabdalkader d74e2aca3e drivers/cyw43/cywbt: Add compile option for RF switch. 2021-04-30 10:15:59 +10:00
iabdalkader d3eb6d68a3 drivers/cyw43/cyw43_ctrl: Use new sdio enable API functions.
This removes any references to a specific SDMMC instance, making the driver
more generic/portable.
2021-04-30 01:12:18 +10:00
Damien George a1bc32d8a8 drivers/sdcard: Add sleep_ms(1) delay in SDCard.readinto sync loop.
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>
2021-04-23 23:44:37 +10:00
Damien George e43a74a4db drivers/memory/spiflash: Add MICROPY_HW_SPIFLASH_ENABLE_CACHE option.
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-12-18 13:39:32 +11:00
Jim Mussared ed14435a8e extmod/modbluetooth: Refactor stack/hci/driver/port bindings.
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-08 11:41:31 +10:00
stijn 40ad8f1666 all: Rename "sys" module to "usys".
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-09-04 00:10:24 +10:00
robert-hh 8680a74595 drivers/display/ssd1306.py: Change the SET_COM_PIN_CFG setting.
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-07 13:42:37 +10:00
Jim Mussared def76fe4d9 all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
Andreas Motl fbfea3b440 drivers/onewire: Fix undefined variable errors.
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-25 01:09:14 +11:00
Damien George 894c550c86 stm32: Refactor bluetooth stack/hci/driver bindings.
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-03-10 01:53:42 +11:00
Damien George 69661f3343 all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-28 10:33:03 +11:00
Peter Hinch d2f22ea953 drivers/nrf24l01: Change pipe addrs in test to match Arduino addrs.
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-02-16 23:26:34 +11:00
Damien George d494e47855 drivers/cyw43: Return early from cyw43_wifi_set_up if wifi_on fails. 2020-01-31 20:46:35 +11:00
Damien George 5de55e8fb4 drivers/cyw43: Include stdio.h in files that use printf. 2020-01-31 20:46:10 +11:00
Andrew Leech 30501d3f54 drivers, stm32: Support SPI/QSPI flash chips over 16MB.
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.
2020-01-30 13:18:38 +11:00
Damien George e83fc3260e drivers/cyw43: Fix to build in nanbox mode. 2019-12-27 22:54:53 +11:00
Damien George cd9de63c0e drivers/wiznet5k: Allow selecting maximum fixed buffer size for MACRAW.
Enabling WIZCHIP_USE_MAX_BUFFER will make the TX/RX buffers the maximum
available size, for use with MACRAW mode.
2019-12-13 12:34:42 +11:00
Jeremy Herbert 4f0f3dfb41 drivers/sdcard: Raise exception on timeout of readinto.
Otherwise the code can get stuck in an infinite loop if the SD card fails
to respond to a read.
2019-11-06 11:34:02 +11:00
Damien George 5954387858 drivers/onewire/ds18x20.py: Add support for DS1822 sensor.
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-16 14:28:13 +11:00
Damien George 7418dbf12d drivers/cyw43: Add low-level CYW43xx Bluetooth HCI UART driver. 2019-10-01 09:50:48 +10:00
Damien George 8cde5faedd drivers/memory/spiflash: Add support to put SPI flash in sleep mode. 2019-07-03 01:27:33 +10:00
Damien George 7b70ab7258 drivers: Add driver for CYW43xx WiFi SoCs. 2019-06-03 16:47:35 +10:00
Damien George 02afc0d241 drivers/display/ssd1306.py: Change to use new i2c.writevto() method.
Fixes issue #3482.
2019-05-20 15:06:39 +10:00
Andrew Leech 2ed2ec1711 drivers/memory/spiflash: Rework wait_sr to fix uninit'd variable 'sr'. 2019-03-08 23:11:13 +11:00
Damien George f102ac54e9 drivers/dht: Allow open-drain-high call to be DHT specific if needed.
Some ports (eg esp8266) need to have specific behaviour for driving a DHT
reliably.
2019-01-22 00:23:05 +11:00
Peter Hinch 40a7e8c472 drivers/sdcard: Remove debugging print statement in ioctl method. 2018-09-20 16:54:58 +10:00
Peter Hinch 1628cd0e59 drivers/sdcard: In test use os.umount and machine module instead of pyb.
pyb.umount(None, mountpoint) no longer works.
2018-09-20 16:09:28 +10:00
Damien George dc77fdb7d4 drivers/display/lcd160cr.py: In fast_spi, send command before flushing.
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-09-18 13:49:49 +10:00
roland c1c798fbc3 drivers/cc3000: Use cc3000_time_t instead of time_t for custom typedef.
Otherwise it can clash with time_t from the C standard include headers.
2018-08-08 16:37:26 +10:00
Mateusz Kijowski 1751f5ac7b drivers/sdcard: Do not release CS during the middle of read operations.
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-07-05 19:39:06 +10:00
Damien George 1747d15c3a drivers/sdcard: Fix bug in computing number of sectors on SD Card.
This was a typo from the very first commit of this file.
2018-06-15 18:02:40 +10:00
Damien George 8b8c083625 drivers/sdcard: Change driver to use new block-device protocol. 2018-06-15 18:01:36 +10:00
Damien George b78ca32476 drivers/memory/spiflash: Add functions for direct erase/read/write.
These new API functions do not use the cache.
2018-06-14 16:52:56 +10:00
Damien George cc5a94044a drivers/memory/spiflash: Rename functions to indicate they use cache.
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-14 16:52:56 +10:00
Damien George 86fe73beb9 drivers/memory/spiflash: Move cache buffer to user-provided config.
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-14 16:52:56 +10:00
Damien George 5a5bc4a61f drivers/wiznet5k: Fix bug with MACRAW socket calculating packet size. 2018-06-01 13:44:09 +10:00
Damien George bdc875e602 drivers/memory/spiflash: Fix bugs in and clean up read/write functions.
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-13 14:13:30 +11:00
Damien George cc34b087f0 drivers/memory/spiflash: Fix setting of QE bit in flash register. 2018-03-11 11:25:38 +11:00
Damien George a739b35a96 drivers/memory/spiflash: Change to use low-level SPI object not uPy one.
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-10 00:59:43 +11:00
Damien George 58ebeca6a9 drivers/bus: Pull out software SPI implementation to dedicated driver.
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-10 00:59:43 +11:00
Damien George 4e48700f9a drivers/memory/spiflash: Add support for QSPI interface.
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-02 23:54:09 +11:00
Damien George 1da2d45de6 drivers/bus: Add QSPI abstract type with software QSPI implementation.
A new directory drivers/bus/ is introduced, which can hold implementations
of bus drivers.  A software QSPI implementation is added.
2018-03-02 23:52:59 +11:00
Damien George 3759aa2cc9 drivers/sdcard: Update SD mounting example code for ESP8266. 2018-02-18 23:40:54 +11:00
Damien George 93d5c9e1c4 drivers/cc3200: Update to work with new stm32 SPI API. 2018-02-05 14:32:56 +11:00
Hemanth kumar a44892dd0d drivers/sdcard: Update doc for ESP8266 to use correct SPI number.
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-31 21:25:58 +11:00
Damien George efdda2c62d stm32: Add support for DHT11/DHT22 sensors. 2018-01-31 18:12:53 +11:00
Damien George a40ce1d829 esp8266/modules: Move dht.py driver to drivers/dht directory. 2018-01-31 18:11:06 +11:00
Ayke van Laethem a275cb0f48 drivers/sdcard: Avoid allocation on the heap.
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-10 19:14:46 +11:00
Jim Mussared bb3412291a drivers/display/ssd1306: Fix super() call in SSD1306 driver. 2018-01-10 17:56:10 +11:00
Ayke van Laethem b90f51f86a drivers/sdcard: Support old SD cards (<=2GB). 2017-12-22 16:49:58 +11:00
Peter Hinch 479392a56e drivers/display/ssd1306: Make SSD1306 class inherit from FrameBuffer. 2017-12-13 14:45:04 +11:00
Peter Hinch ccaa5f5b0b drivers/nrf24l01: Make driver and test run on pyboard, ESP8266, ESP32. 2017-11-20 11:37:47 +11:00
Damien George c0ea91bc89 drivers/wiznet5k: Get low-level W5500 driver working.
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-16 15:34:08 +11:00
Li Weiwei 73e387cff6 drivers/wiznet5k: Improve the performance of socket ops with threading.
Use MICROPY_THREAD_YIELD() instead of HAL_Delay in busy waiting to improve
the performance of connect, send, recv, sento and recvfrom.
2017-10-16 13:32:34 +11:00
Damien George ca2427c313 drivers/display/ssd1306: Make poweron() work the same with SSD1306_SPI.
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-06 12:48:44 +11:00
Tiago Queiroz 7df4083ac6 drivers/display/ssd1306: Implement SSD1306_I2C poweron method.
After a poweroff(), the poweron() method does a soft power-on and any
previous state of the display persists.
2017-10-06 12:47:22 +11:00
Damien George a3dc1b1957 all: Remove inclusion of internal py header files.
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-04 12:37:50 +11:00
Damien George 54acd0b0f0 drivers/nrf24l01: Make nRF24L01 test script more portable. 2017-10-03 20:00:31 +11:00
Peter Hinch 8fa03fee77 drivers/display/ssd1306.py: Improve performance of graphics methods.
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-09-25 16:13:32 +10:00
Damien George 613510bce8 drivers/memory/spiflash: Change from hard-coded soft SPI to generic SPI.
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-29 11:37:18 +10:00
Javier Candeira 35a1fea90b all: Raise exceptions via mp_raise_XXX
- 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-08-13 22:52:33 +10:00
Alexander Steffen 55f33240f3 all: Use the name MicroPython consistently in comments
There were several different spellings of MicroPython present in comments,
when there should be only one.
2017-07-31 18:35:40 +10:00
Alexander Steffen 299bc62586 all: Unify header guard usage.
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-07-18 11:57:39 +10:00
Damien George 683df1c8d5 drivers/onewire: Enable pull-up when init'ing the 1-wire pin.
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-26 17:48:05 +10:00
Damien George a065d78675 drivers/onewire: Move onewire.py, ds18x20.py from esp8266 to drivers.
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-06-22 16:28:07 +10:00
Paul Sokolovsky 1c9ee49756 drivers: Replace deprecated Pin.high()/low() methods with .__call__(1/0). 2017-05-21 17:44:58 +03:00
Damien George 55dd83a7ba drivers/display/lcd160cr_test: Allow test to take orientation parameter. 2017-05-17 19:54:38 +10:00
Damien George f351c6db5e drivers/display/lcd160cr: Fix get_line method and enhance screen_dump.
The docs are updated and describe the new behaviour of these methods.
2017-05-17 19:53:13 +10:00
Damien George d7310fabc2 drivers/nrf24l01: Update to work on newer ports, using machine, utime.
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-04-07 15:54:21 +10:00
Damien George 528aeb3bf3 drivers/display/lcd160cr: Add check that JPEG size is less than 65536. 2017-02-27 18:39:35 +11:00
Damien George 8400d0461d drivers/display/lcd160cr: Fix bug with save_to_flash method. 2017-02-24 17:22:57 +11:00
Damien George b0a6dda115 drivers/display/lcd160cr: Fix bugs with lcd.get_pixel().
Fixes issues #2880 and #2881.
2017-02-21 17:40:34 +11:00
Stephan Brauer 8f3e07f17d drivers/display/lcd160cr: Use correct variable in set_power(). 2017-02-17 16:54:05 +11:00