stm32_i2c_msg_read and stm32_i2c_msg_write
for interrupt mode is replaced by a common
function: stm32_i2c_irq_xfer
Signed-off-by: Erik Andersson <erian747@gmail.com>
- Rework transaction flow to better match reference manual
and errata sheet for STM32 I2Cv2 peripheral
- Handle message transactions larger than 255 bytes in isr
- Combine stm32_i2c_msg_write and stm32_i2c_msg_read into
one common function stm32_i2c_irq_xfer when using interrupts
Signed-off-by: Erik Andersson <erian747@gmail.com>
To prepare for further patches and separation
of interrupt/DMA modes from polled, this commit
introduces two helpers for starting and stopping
DMA transfers
Finsishing DMA transfers are also moved from
interrupt handlers to thread after beeing wokenen
by semaphore
Signed-off-by: Erik Andersson <erian747@gmail.com>
During testing with teensy 4.0 it was discoverd that toggling
at high frequencies led to missed steps. As per the datasheets
of step-dir drivers an active edge needs to be maintained for
a certain timerperiod, for a step to be executed.
Instead of toggling pin twice instantaneously, the current fix
halves the step period and the step-pin is toggled on the timeout
of the respective timing source.
rework stepper stepper stop
set step pin to low if the driver does not support dual edge
and increment/decrement the actual position by one
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Refactor a bit the RX FIFO handling to prevent RX transfers performed
in Single IO mode from getting stuck when they are suspended due to
the empty TX FIFO and cannot be resumed because there is no further
interrupt in which the TX FIFO could be filled properly with dummy
bytes above its transfer start level.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Do not select CONFIG_SYS_MEM_BLOCKS when enabling the Atmel SAM0 USB device
controller driver as the implementation does not use the system memory
blocks allocator.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Clean up headers includes section:
- Remove conditional inclusions
- zephyr/, then susbystem/, standardlib, locals
- Sort alphabetically within these categories
- Remove the ones already available through _priv.h
Noticeable exception, lldp.h requires prior net_pkt.h inclusion
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Since phy init is not in this function anymore, it can be moved back
to driver initialization function.
While I'm at, harmonize v1/v2 flavors of the function.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
To be able to split code, some functions were removed their static
attribute, which opens the possibility of name conflict.
Rename them by adding eth_stm32_ prefix.
Additionally, review their sorting in the header file.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Split V1 and V2 code from the common file of STM32 ethernet
driver.
Whenever it is possible, make use of v1 or v2 version of functions
that are call from the common file in order to maximize factorization.
Review definitions to put them where they are used.
Review header inclusions to minimize them.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
In an effort to make stm32 eth driver files easier to read and maintain,
split the ptp code in a dedicated file.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
This reverts commit 678e226045.
This commit was part of PR 94142 which has been merged
while a discussion was still on going on the right direction
between splitting V1 and V2 or keeping a common file.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
This reverts commit 29750ac05d.
This commit was part of PR 94142 which has been merged
while a discussion was still on going on the right direction
between splitting V1 and V2 or keeping a common file.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Commit bc8d66d538931e650dd2855fabe768720dcb4b02 introduced a
result argument to some RTIO callback handlers. Update for the IIS3DWB
sensor.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
flushing rx pending already happens in
uart_litex_fifo_read, which should be called
by the callback, so don't do it again, also
it can lead to the drop of chars, as flushing
removes the current entry in the fifo.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Process all in one callback, in order to reduce latency.
The following changes have been done:
- Process FIFO read-out and/or Data-ready in GPIO callback.
- FIFO Full is handled on completion if needed.
- Omit fifo-count fetching, to optimize cycles. The watermark
count is the number of samples we're going for.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
By introducing three states: Off -> On -> Busy -> (Offf)
This allows us to more clearly guard on-going events and detect
overlapping triggers.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Since the driver knows how many samples it wants (because of the
watermark threshold), stick to that per event in order to facilitate
batches of N number of samples.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
In order to allow the error-handling scheme to take action, instead
of crashing when asserts are enabled. Now possible since we have RTIO
error handling for streaming mode.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Similar pattern applied to other in-tree sensor drivers, where
preparing a set of SQEs for writing/reading on registers is a recurrent
syntax.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
The IIS3DWB is a system-in-package featuring a 3-axis digital vibration
sensor with low noise over an ultrawide and flat frequency range.
The wide bandwidth, low noise, very stable and repeatable sensitivity,
together with the capability of operating over an extended temperature
range (up to +105 C), make the device particularly suitable for vibration
monitoring in industrial applications.
Datasheet: https://www.st.com/en/mems-and-sensors/iis3dwb.html
This driver is currently only supporting the polling-mode read_and_decode
APIs (both blocking and non-blocking).
This driver is based on stmemsc HAL i/f v2.9.1.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
- Add the pdl-based version of the i2c driver for infineon devices
like the one found on the kit_psc3m5_evk board.
- In the pull request review it was decided that the
I2C_INFINEON_CAT1_ASYNC option was not needed. The driver would
always be interrupt driven. This meant that the existing driver
had to be updated as well.
Signed-off-by: Bill Waters <bill.waters@infineon.com>
The new nrf-802154 now has the updated API signatures. The migration
code is no longer needed.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Make the STM32 I2C transfer timeout configurable via Kconfig.
- Add CONFIG_I2C_STM32_TRANSFER_TIMEOUT_MSEC Kconfig symbol.
- Use this Kconfig value in both STM32 I2C drivers.
Tested on STM32WBA55CG.
Fixes: #95819
Signed-off-by: Pablo Bacho <pablobacho@gmail.com>
This IPM driver is not being used by SOF and is there simply for
a test which does not provide much additional value compared to
the existing host IPC tests. That IPM specific test has been
removed so there is no need to keep this driver in the tree.
This is in preparation to rewrite the host IPC driver to utilize
the IPC API. There is no need to maintain another driver that is
not being used in SOF.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Support reporting the reset cause for native_sim. The default is to
report POR (Power-On Reset). If CONFIG_NATIVE_SIM_REBOOT was enabled and
the system is rebooted using sys_reboot(), the reset cause is set to
SOFTWARE.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
This header file isn't required, and prevents the driver building for
the RISC-V based Hazard3 cores.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
The RP2350 uses the Xh3irq interrupt controller, which supports nested
and prioritised interrupts. This adds initial support, configuring the
controller in 'direct' (non-vectored) mode.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
There's no benefit to starting a subset of them, and this ensure that
everything is ready, regarless of RP2040 vs RP235xx, and whether the
Cortex-M33 or Hazard3 cores are in use in the latter case.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
In case one defines an RGB led that is bigger than the led_rgb struct,
ws2812_gpio_update_rgb would overflow the buffer it writes to while
iterating. This could lead to crashes, as the code would also support
GRBW (as supposed in one comment).
As a 'proper' fix would require another buffer and therefore more
memory, I added a BUILD_ASSERT to ensure it does not compile.
Signed-off-by: Stefan Kraus <dev@stefankraus.org>