Commit Graph

48 Commits

Author SHA1 Message Date
iabdalkader
1b5da3ebfe modules/py_crc: Add hardware-accelerated CRC module.
Optional, small module for testing.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-25 18:06:00 +02:00
iabdalkader
fbc8d14cda modules: Update framebuffer API.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-02 16:05:55 +02:00
iabdalkader
4c2c59d0e5 lib/imlib: Remove old framebuffer macros.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-02 13:41:30 +02:00
Kwabena W. Agyeman
84e6ee6507 modules/py_ml: Return tensor references for post-processors.
Converting the output tensors into floats for the prost-processors
causes memory exhaustion when models become very large. Additionally,
it wastes processing time converting values which may not be used. By
moving the conversion step into the post-processors we avoid this issue.

If no callback is passed for post-processing the converted output to
a floating point ndarray is returned still.
2025-08-24 14:43:24 -07:00
Kwabena W. Agyeman
7cbf85cd1c modules/py_ml: Fix py_ml_dtype_size typo. 2025-08-24 14:42:56 -07:00
iabdalkader
e5cdccc72e common: Introduce profiling support.
This adds a simple code profiler that leverages both SysTick and
the Performance Monitoring Unit (PMU) available on Armv8.1-M cores.
SysTick provides a simple high-resolution timer source, while the PMU
offers a cycle counter and multiple configurable event counters that
can track low-level performance metrics such as cache misses, pipeline
stalls, etc... See the Armv8.1-M Performance Monitoring User Guide
for additional details.

Function-level instrumentation is enabled using -finstrument-functions
on select files to automatically record statistics on entry/exit.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-24 16:57:06 +02:00
iabdalkader
cf7b84d682 ports/all: Remove old profiling macros.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-24 14:40:02 +02:00
iabdalkader
ae6c9990bf modules: Use private CSI resolution table.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-14 11:40:45 +02:00
Kwabena W. Agyeman
2c2752f743 modules/py_image: Accelerate to_ndarray() with Helium. 2025-08-12 17:30:14 -07:00
Kwabena W. Agyeman
c231f66555 drivers/sensors: Add different event buffer sizes for genx320. 2025-08-09 11:03:07 -07:00
Kwabena W. Agyeman
3908807509 drivers/sensors: Add calibration ioctl for the genx320. 2025-08-09 10:51:08 -07:00
Kwabena W. Agyeman
e591ccd735 drivers/sensors: Add RAW event output mode for the genx320. 2025-08-09 10:51:07 -07:00
Kwabena W. Agyeman
051396b4b8 modules/py_image: Add event histogram drawing method. 2025-08-09 09:32:10 -07:00
Kwabena W. Agyeman
b428655767 modules/py_csi_ng: Fix NULL image arg.
omv_csi_snapshot() implementations generally expect
image to not be NULL and crash if it is.
2025-08-09 09:32:10 -07:00
Kwabena W. Agyeman
ea0505d52e common/omv_csi: Allow IOCTLs to return positive values. 2025-08-09 09:32:10 -07:00
iabdalkader
96f1675023 modules/py_csi_ng: Support custom frame sizes.
Remove the constants for custom resolutions and support
setting a custom frame size with `csi.framesize((w, h))`.
Note: The frame size must be supported by the sensor driver.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-09 18:03:31 +02:00
iabdalkader
9112cf2aae misc: Clean-up CSI flags.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-09 12:00:59 +02:00
Kwabena W. Agyeman
e534b48b48 modules/py_image: Add transform support to image operations. 2025-07-31 13:26:14 -07:00
Kwabena W. Agyeman
1c962cb7a6 modules/py_helper: Add transform argument helper. 2025-07-31 13:26:14 -07:00
Kwabena W. Agyeman
47c5618231 lib/imlib: Add transform argument to draw_image. 2025-07-31 13:13:45 -07:00
iabdalkader
0b8607307f modules/py_csi_ng: Fix printed slave address.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-27 09:52:15 +02:00
iabdalkader
a88d5e5b0c modules/csi: Add print function.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-23 18:25:01 +02:00
iabdalkader
85a1096986 modules: Use the new framebuffer API.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>

modules
2025-07-23 18:24:55 +02:00
iabdalkader
f0c3d72406 ports/mimxrt: Fix omv module UID function.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-23 12:10:15 +02:00
Kwabena W. Agyeman
bacfb7aeb7 modules/py_fir_lepton: Remove lepton control through fir module. 2025-07-21 23:10:40 -07:00
iabdalkader
95d1c0a6cc ports/all: Switch to gnu11 standard.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-21 17:51:07 +02:00
iabdalkader
0bc0385eb4 common/csi: Remove csi.fb() function.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-16 23:42:47 +02:00
iabdalkader
678be91f39 modules: Use common alignment macros.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-16 11:18:56 +02:00
Kwabena W. Agyeman
cc9e9c94f4 modules/py_spi_display: Add vflip/hmirror support. 2025-07-10 21:35:25 -07:00
Kwabena W. Agyeman
e6dff41517 lib/imlib: Remove old fallback image transfer code. 2025-07-07 20:39:29 -07:00
Kwabena W. Agyeman
e14bbe586d lib/imlib: Fix update_jpeg_buffer to update from the passed image.
framebuffer_update_jpeg_buffer was previously bugged as it always
updated the jpeg buffer from the frame buffer versus the image
object it was attached to. e.g. img.flush() always flushed the
frame buffer and not the image object it was called on.
2025-07-07 20:39:29 -07:00
Kwabena W. Agyeman
84c3db58a4 modules/py_omv: Remove disable fb from omv module. 2025-07-07 20:39:29 -07:00
Kwabena W. Agyeman
eba2529237 modules/py_helper: Fix error arg_to_image error message typo. 2025-07-04 17:54:22 -07:00
Ibrahim Abdelkader
81dd44aef4
Merge pull request #2735 from openmv/refactor_csi_init
Some checks are pending
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Waiting to run
🔥 Firmware Build / build-firmware (DOCKER) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV2) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_AE3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_N6) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Waiting to run
🔥 Firmware Build / code-size-report (push) Blocked by required conditions
🔥 Firmware Build / stable-release (push) Blocked by required conditions
🔥 Firmware Build / development-release (push) Blocked by required conditions
misc: Refactor CSI initialization code.
2025-06-27 22:42:05 +03:00
iabdalkader
4ded9fba91 common: Remove xalloc.
Originally meant to abstract gc_collect but we could just use
m_alloc and friends. Also was meant to provide functions like
alloc0, alloc_maybe etc.. which are all available in MP anyway.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-27 14:50:16 +02:00
Kwabena W. Agyeman
8cd7a309fd modules/py_csi_ng: Implement snapshot() image argument. 2025-06-27 09:30:06 +02:00
iabdalkader
522560a48e modules/py_csi_ng: Add new CSI API.
A modern API that supports multiple CSI instances.
The API is a work in progress and is not backwards
compatible, but it can be enabled and used at the
same time as the old "sensor" module.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-25 21:15:20 +02:00
iabdalkader
72410dfc8c common/csi: Add support for multiple CSIs.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-25 10:37:41 +02:00
Kwabena W. Agyeman
3984ec783f ports/stm32: Move VOSPI memory near DMA controller.
On the STM32N6 the DMA memory meant to be used with the SPI bus is
in the low-performance memory domain. Moving the DMA buffers and
linked list buffers there reduces the AHB cycle time by the DMA
controller making it more stable.
2025-06-24 10:19:31 -07:00
Kwabena W. Agyeman
c758b71040 drivers/sensors/lepton: Fix refresh and resolution attributes. 2025-06-23 14:49:37 -07:00
Kwabena W. Agyeman
8e543c2a96 lib/imlib: Refactor fill_image_from_lepton out of py_fir_lepton. 2025-06-23 14:49:37 -07:00
Kwabena W. Agyeman
7e77155551 modules/py_spi_display: Reduce timeout from max to 5 seconds. 2025-06-18 12:39:20 -07:00
Kwabena W. Agyeman
eb2276e476 modules: Update SPIDisplay to allow LCD controllers to override commands. 2025-06-18 12:37:51 -07:00
iabdalkader
4c1e525d5a modules/spi_display: Disable SPI DMA mode if not supported.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-16 14:10:48 +02:00
iabdalkader
71689c4a4f modules: Refactor framebuffer API to accept a context.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-26 16:29:30 +03:00
iabdalkader
59a1db0088 modules/py_imu: Fix I2C mode. 2025-04-24 12:31:08 +02:00
iabdalkader
a5605401d5 modules/py_fir_lepton: Use CS pin stored in SPI bus.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-22 11:18:30 +02:00
iabdalkader
daf2bb30da misc: Restructure repo.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-13 08:28:34 +02:00