summaryrefslogtreecommitdiffstatshomepage
path: root/drivers
Commit message (Collapse)AuthorAge
* drivers/cyw43: Remove old BTHCI UART backend.iabdalkader8 days
| | | | | | It has been completely replaced by equivalent code in cyw43-driver. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/ninaw10: Rename Bluetooth HCI backend driver.iabdalkader8 days
| | | | | | | Rename `bt_hci` to `bthci_uart` for consistency with the CYW43 driver and to distinguish it from HCI backends that use a different transport. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/esp-hosted: Rename Bluetooth HCI backend driver.iabdalkader8 days
| | | | | | | Rename `bthci` to `bthci_uart` for consistency with the CYW43 driver and to distinguish it from HCI backends that use a different transport. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/ninaw10/machine_pin_nina: Add exception text wrappers.Andrew Leech8 days
| | | | | | Required in MICROPY_PREVIEW_VERSION_2. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
* drivers/bus/qspi: Make num_dummy configurable for quad reads.Damien George2025-04-09
| | | | Signed-off-by: Damien George <damien@micropython.org>
* drivers/memory/spiflash: Allow a board/port to detect SPI flash.Damien George2025-04-09
| | | | | | | | | | | This commit allows the user of this driver to intercept the SPI flash initialisation routine and possibly take some action based on the JEDEC id, for example change the `mp_spiflash_t::chip_params` element. To do this, enable `MICROPY_HW_SPIFLASH_DETECT_DEVICE` and define a function called `mp_spiflash_detect()`. Signed-off-by: Damien George <damien@micropython.org>
* drivers/memory/spiflash: Allow a board/port to configure chip params.Damien George2025-04-09
| | | | | | | | | This commit allows the user of this driver to dynamically configure the SPI flash chip parameters. For this, enable `MICROPY_HW_SPIFLASH_CHIP_PARAMS` and then set the `mp_spiflash_t::chip_params` element to point to a valid `mp_spiflash_chip_params_t` struct. Signed-off-by: Damien George <damien@micropython.org>
* drivers: Add MP_QSPI_IOCTL_MEMORY_MODIFIED to indicate flash changed.Damien George2025-03-25
| | | | Signed-off-by: Damien George <damien@micropython.org>
* drivers/memory/spiflash: Add a config option to soft-reset SPI flash.iabdalkader2024-12-10
| | | | | | | | Add a compile-time config option to soft-reset SPI flash on init. This puts the flash in a known state on reset. Note this option is disabled by default. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* extmod/machine_spi: Support firstbit=LSB for machine.SoftSPI.robert-hh2024-07-12
| | | | | | | | | | | | | | | | Being able to send data out in LSB format can be useful, and having support in the low-level driver is much better than requiring Python code to reorder the bits before sending them / after receiving them. In particular if the hardware does not support the LSB format (eg RP2040) then one needs to use the SoftSPI in LSB mode. For this change a default definition of `MICROPY_PY_MACHINE_SPI_MSB/_LSB` was added to `py/mpconfig.h`, making them available to all ports. The identical defines in `esp32/mpconfigport.h` were deleted. Resolves issues #5340, #11404. Signed-off-by: robert-hh <robert@hammelrath.com>
* extmod/network_nina: Fix the AP security mode constants.iabdalkader2024-07-12
| | | | | | | | | | | The only AP security mode supported is actually WPA/WPA2 not WEP. The firmware command `0x19` starts the AP using `WIFI_AUTH_WPA_WPA2_PSK` mode. There are no functional changes in this commit, it just fixes the constant names and removes the useless sanity checks for WEP. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/memory: Add IS25LPWP064D chip to list of external flash devices.robert-hh2024-03-28
| | | | | | Confirguration provided by by @ironss-iotec. Signed-off-by: robert-hh <robert@hammelrath.com>
* all: Remove the "STATIC" macro and just use "static" instead.Angus Gratton2024-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The STATIC macro was introduced a very long time ago in commit d5df6cd44a433d6253a61cb0f987835fbc06b2de. The original reason for this was to have the option to define it to nothing so that all static functions become global functions and therefore visible to certain debug tools, so one could do function size comparison and other things. This STATIC feature is rarely (if ever) used. And with the use of LTO and heavy inline optimisation, analysing the size of individual functions when they are not static is not a good representation of the size of code when fully optimised. So the macro does not have much use and it's simpler to just remove it. Then you know exactly what it's doing. For example, newcomers don't have to learn what the STATIC macro is and why it exists. Reading the code is also less "loud" with a lowercase static. One other minor point in favour of removing it, is that it stops bugs with `STATIC inline`, which should always be `static inline`. Methodology for this commit was: 1) git ls-files | egrep '\.[ch]$' | \ xargs sed -Ei "s/(^| )STATIC($| )/\1static\2/" 2) Do some manual cleanup in the diff by searching for the word STATIC in comments and changing those back. 3) "git-grep STATIC docs/", manually fixed those cases. 4) "rg -t python STATIC", manually fixed codegen lines that used STATIC. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
* drivers/dht: Only build DHT driver if MICROPY_PY_MACHINE_PULSE enabled.Damien George2024-02-07
| | | | | | Because this driver calls `machine_time_pulse_us()`. Signed-off-by: Damien George <damien@micropython.org>
* rp2: Switch rp2 and drivers to use new event functions.Angus Gratton2023-12-08
| | | | | | | | | | | | | | | | This commit changes all uses in the rp2 port, and drivers that are optionally supported by that port. The old MICROPY_EVENT_POLL_HOOK and MICROPY_EVENT_POLL_HOOK_FAST macros are no longer used for rp2 builds and are removed (C user code will need to be changed to suit). Also take the opportunity to change some timeouts that used 64-bit arithmetic to 32-bit, to hopefully claw back a little code size. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
* extmod/modmachine: Consolidate mem, i2c and spi headers to modmachine.h.Damien George2023-10-26
| | | | | | | The contents of machine_mem.h, machine_i2c.h and machine_spi.h have been moved into extmod/modmachine.h. Signed-off-by: Damien George <damien@micropython.org>
* extmod/modmachine: Consolidate simple machine headers into modmachine.h.Damien George2023-10-26
| | | | | | | The contents of machine_bitstream.h, machine_pinbase.h, machine_pulse.h and machine_signal.h have been moved into extmod/modmachine.h. Signed-off-by: Damien George <damien@micropython.org>
* extmod/modmachine: Clean up decls of machine types to use common ones.Damien George2023-10-26
| | | | | | | | | | | The machine_i2c_type, machine_spi_type and machine_timer_type symbols are already declared in extmod/modmachine.h and should not be declared anywhere else. Also move declarations of machine_pin_type and machine_rtc_type to the common header in extmod. Signed-off-by: Damien George <damien@micropython.org>
* extmod/machine_uart: Factor ports' UART Python bindings to common code.Damien George2023-10-26
| | | | | | | | | | | | | | | | | This is a code factoring to have the Python bindings in one location, and all the ports use those same bindings. For all ports except the two listed below there is no functional change. The nrf port has UART.sendbreak() removed, but this method previously did nothing. The zephyr port has the following methods added: - UART.init(): supports setting timeout and timeout_char. - UART.deinit(): does nothing, just returns None. - UART.flush(): raises OSError(EINVAL) because it's not implemented. - UART.any() and UART.txdone(): raise NotImplementedError. Signed-off-by: Damien George <damien@micropython.org>
* drivers/ninaw10: Add support for external ADC channels.iabdalkader2023-10-20
| | | | Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/ninaw10: Add ioctl for reading analog pins.iabdalkader2023-10-20
| | | | Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/esp_hosted_hal: Add support for WiFI LED activity indicator.iabdalkader2023-10-02
| | | | Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/esp-hosted: Fix MTU size.iabdalkader2023-10-02
| | | | | | The maximum SPI frame payload is 1600 - header_size. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/esp_hosted: Fix pin IRQ.iabdalkader2023-10-02
| | | | | | | This patch reinstalls the pin IRQ handler on WiFi init, as some ports disable/remove pin IRQs on soft-reboot, or deinit the pins. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/ninaw10/nina_bt_hci: Make some minor fixes to HCI driver.iabdalkader2023-09-15
| | | | | | | | | | Fixes are: - Reset the module first before changing GPIO1 direction. - Skip spurious bytes received after reset. - Use HCI UART ID and baudrate when reinitializing UART. - Disable all printf output which causes unit-tests to fail. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/esp-hosted: Add host driver for ESP-Hosted firmware.iabdalkader2023-09-14
| | | | | | | This is a host driver for ESP32 chips running the esp-hosted firmware, which turns ESP32s into a WLAN/BT co-processor. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* drivers/cyw43: Make the CYW43 Bluetooth HCI driver more portable.iabdalkader2023-09-01
| | | | | | | | | | | | | | | This commit allows other ports to reuse the CYW43 HCI driver, by replacing all Bluetooth UART and control named pins with defines in config files and using `mpbthci` abstract functions (i.e. `mp_bluetooth_hci_*`) instead of the STM32 specific UART functions. Note: the function `cywbt_wait_cts_low` does not need to switch the CTS pin from alternate function to GPIO to read it. At least on stm32, mimxrt it's possible to just read the pin input. For example, see the STM32F7 RM0410 section 6.3.11, and the `SION` for IMXRT. So this function can also be available for other ports if the pin mode switching is removed. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* samd/samd_qspiflash: Add QSPI flash driver and configure it accordingly.robert-hh2023-06-06
| | | | | | | | | The QSPI driver provides the interface for using an on-board QSPI flash for the filesystem. It provides the same methods as the driver for the internal flash and uses the same name. Therefore, only one of the drivers for internal flash, SPI flash and QSPI flash must be enabled at a time. Signed-off-by: robert-hh <robert@hammelrath.com>
* all: Fix spelling mistakes based on codespell check.Damien George2023-04-27
| | | | Signed-off-by: Damien George <damien@micropython.org>
* drivers/ninaw10: Fix ESP32 input-only pins.iabdalkader2023-04-04
| | | | | ESP32 pins 34, 35, 36 and 39 are input only, and should not be configured as output.
* drivers/ninaw10: Add missing external pins 34 and 39.iabdalkader2023-03-08
| | | | There are 2 more external pins controlled by the Nina module.
* drivers/cyw43: Include CYW43 config file.iabdalkader2023-03-08
| | | | To get definition of CYW43_RESOURCE_ATTRIBUTE.
* drivers/ninaw10: Fix machine_pin GPIO read.iabdalkader2023-03-06
|
* drivers/cyw43: Use a different baudrate for BT firmware download.iabdalkader2023-03-02
| | | | | Allow boards to define a specific firmware for Bluetooth firmware download, or none at all.
* stm32: Update to use the open-source lib version of cyw43-driver.Jim Mussared2023-03-01
| | | | | | | | This removes the previous WiFi driver from drivers/cyw43 (but leaves behind the BT driver), and makes the stm32 port (i.e. PYBD and Portenta) use the new "lib/cyw43-driver" open-source driver already in use by the rp2 port. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* drivers/cyw43: Use board-defined BLE UART secondary baudrate.iabdalkader2023-02-24
| | | | The secondary baudrate was defined by boards but never used in this driver.
* drivers/ninaw10: Implement machine.Pin external pin controls.iabdalkader2023-01-16
|
* drivers/bus: Change QSPI read_cmd signature to return an error code.Damien George2022-12-09
| | | | Signed-off-by: Damien George <damien@micropython.org>
* drivers/bus: Detect QSPI transfer errors and pass up to spiflash driver.Andrew Leech2022-12-09
| | | | | | | | | This changes the signatures of QSPI write_cmd_data, write_cmd_addr_data and read_cmd_qaddr_qdata so they return an error code. The softqspi and stm32 hardware qspi driver are updated to follow this new signature. Also the spiflash driver is updated to use these new return values. Signed-off-by: Damien George <damien@micropython.org>
* drivers/ninaw10: Connect to WiFi asynchronously.iabdalkader2022-11-16
| | | | | | | | | Before this patch, WiFi connection was blocking, and could raise exceptions if the connection failed for any reason (including timeouts). This doesn't match the behavior of other WiFi modules, which connect asynchronously, and requires handling of exceptions on connect. This change makes `connect()` work asynchronously by scheduling code to poll connection status, and handle reconnects (if needed), and return immediately without blocking.
* py/obj: Convert make_new into a mp_obj_type_t slot.Jim Mussared2022-09-19
| | | | | | | | | | | Instead of being an explicit field, it's now a slot like all the other methods. This is a marginal code size improvement because most types have a make_new (100/138 on PYBV11), however it improves consistency in how types are declared, removing the special case for make_new. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* py/obj: Add accessors for type slots and use everywhere.Jim Mussared2022-09-19
| | | | | | | This is a no-op, but sets the stage for changing the mp_obj_type_t representation. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* drivers: Remove drivers that are now in micropython-lib.Jim Mussared2022-09-08
| | | | Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* drivers/display: Don't include tests by default.Damien George2022-09-06
| | | | | | | | The tests can be copied to the board if needed. Also update the docs to reflect this change. Signed-off-by: Damien George <damien@micropython.org>
* all: Update all manifest.py files to use new features.Jim Mussared2022-09-05
| | | | | | | | | | | | | | | | | | | | | Changes in this commit: - Manifest include's now use the directory path where possible (no longer necessary to include the manifest.py file explicitly). - Add manifest.py for all drivers and components that are referenced by port/board manifests. - Replace all uses of freeze() with package()/module(), except for port and board modules. - Use opt=3 everywhere, for consistency and to reduce code size. - Use require() instead of include() for all micropython-lib references. - Remove support for optional board-level manifest.py in mimxrt port, to make it behave the same as other ports (the board must set FROZEN_MANIFEST to a custom manifest.py, which can optionally include the default, port-level manifest). - Also reinstates modules that were accidentally removed from the esp8266 512k build in fbe9417b90474dd1a08749b3a79311a8007a98fb. Signed-off-by: Jim Mussared <jim.mussared@gmail.com> Signed-off-by: Damien George <damien@micropython.org>
* drivers/cc3000: Remove CC3000 WiFi driver files.Damien George2022-08-26
| | | | | | It's no longer used by any port. Signed-off-by: Damien George <damien@micropython.org>
* drivers/wiznet5k: Remove old Wiznet driver.robert-hh2022-08-23
| | | | It has been replaced by the submodule lib/wiznet5k.
* drivers/sdcard: Add delay in init_card_v1 to make timeout work.Kyuchumimo2022-08-11
| | | | This now follows how init_card_v2 works.
* drivers/cyw43: Allow configuring the netif/mDNS hostname.iabdalkader2022-08-06
| | | | | Allow boards to configure/override the default hostname used for netif and mDNS.
* drivers,ports: Fix a few typos in comments.Tim Gates2022-07-23
| | | | | | | | | | Fixes: - Should read `definitions` rather than `defintions`. - Should read `resolution` rather than `resoultion`. - Should read `inefficient` rather than `inefficent`. - Should read `closed` rather than `closded`. Signed-off-by: Tim Gates <tim.gates@iress.com>