Change the way this shim driver configures the I2C frequency, so that
it is possible to use also 1 MHz on nRF5340 (the nrfx driver performs
extra initialization steps for this frequency, hence it needs to be
reinitialized when the shim is reconfigured).
Correct the shim to handle selection of 1 MHz (or FAST_PLUS) bitrate
both through dts and I2C API.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
There are some pins that do not support internal pullup/pulldown.
This PR make sure to check that and return error if needed.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
ESP32 has 2 GPIOs: gpio0 and gpio1.
Zephyr DTS model requires pin definition in dts file
from 0 to 31, meaning that when some pin within gpio1 range
is required, gpio driver needs to increament this value
by 32, required by LL API.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Limit gptp range_adjust range for improved performance.
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
mcux enet driver updates:
a) add mutex to access the ptp timer variables
b) use thread for rx(cooperative) andfor tx cleanup(cooperative)
c) use a thread for ptp inner clock updater(pre-empty)
This patch fixes the following issue:
```
ENET_SendFrame error: 4004
```
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Co-authored-by: Seb Laveze <sebastien.laveze@nxp.com>
Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
GPT timer driver was announcing progress to the kernel too soon when an
announcement was requested via sys_clock_set_timeout() on a tick
boundary. Fix rounding to add a tick worth of cycles.
Fixes#42665
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
MCUX watchdog timer supports min window of 500ms. Increase maximum task
watchdog timeout window to 500ms by default, so that this sample can run
on iMX RT SOCs. Also update iMX RT watchdog driver to reject timeout
maximums under 500ms with a useful error message
Fixes#40153
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The st7789v_transmit function accepts a device, not device data. As a
result, driver could not be compiled when reset GPIOs were not defined
in Devicetree.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The configuration initializer had a syntax error (missing =). The driver
could not be compiled as a result.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Restore the testcase to run on the qspi nor-flash controller
of the disco_l475_iot1 board
of the disco stm32f746 board
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Like the stm32 flash driver, in case of QSPI nor flash controller
the read or write or erase returns '0' if data is of null size.
This avoids useless QPSI low level access to the controller.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Currently the generic driver is always unconditionally compiled. Fix
this by compiling it only when needed.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This is a follow-up to commit 11bbdb030d.
When RX is automatically disabled because all provided RX buffers have
been filled up, the rx_enabled flag needs to be cleared, otherwise it
will be impossible to enable RX again.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
added UART interrupts driver for Raspberry Pi Pico board
moved baudrate from config to data structure
Signed-off-by: Andrei-Edward Popa <andrei_edward.popa@upb.ro>
if peripheral clock is not configured, uart init API function returns 0,
so we need to check the return value of this function
Signed-off-by: Andrei-Edward Popa <andrei_edward.popa@upb.ro>
The properties from dts to driver were not translated
correctly from - to _. This PR fixes this
Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
Only TCP sockets should send a NULL packet
if the server closes the connection or there
is a socket error.
UDP sockets do not need to do this because
they are connectionless.
Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
The ADC driver now supports three different implementations. To maintain
readability, this patch implements an adc_fixup.h that permits more
generic access to relevant registers.
This patch also introduces support for a new third shape ADC - as found
in the SAML21 for example.
Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
Previously this was expected to be equal to 1 at all times. This doesn't
play well with the sample or other users (e.g: adc_shell). Instead, we
should count the number of active channels in the bitfield, and ensure
that only one is identified.
Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
A common pattern here was to take the work item as the subfield of a
containing object. But the contained field is not a k_work, it's a
k_work_delayable.
Things were working only because the work field was first, so the
pointers had the same value. Do things right and fix things to
produce correct code if/when that field ever moves within delayable.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
UARTE does not support RO TX buffers. Added cache buffer to the
driver which is used when provided buffer is not from RAM.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Gives more explanation on uart_stm32_err_check function.
On stm32 F4X, F1X, and F2X, when clearing the usart Error Flag
(PE, ORE, FE, NE), the LL Clear function applies a software sequence
which reads the usart SR then the usart DR.
Consequently the RXNE flag is affected (cleared) by the
uart_stm32_err_check function call.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
This patch adds fixes to the api so that it behaves as expected.
1 - The irq_tx_ready now only returns true if the tx interrupt is
enabled.
2 - The irq_tx_complete now functions as expected and returns true
only once all characters have been transmitted
Signed-off-by: Marius Scholtz <mariuss@ricelectronics.com>
Replace '%s' with '%ld', so that 'long' value is properly printed with
shell_error(). This suppresses following warning:
zephyr/drivers/lora/shell.c:181:23: warning: format '%s' expects \
argument of type 'char *', but argument 4 has type 'long int' \
[-Wformat=]
181 | shell_error(shell, "Invalid bandwidth: %s", lval);
| ^~~~~~~~~~~~~~~~~~~~~~~ ~~~~
| |
| long int
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Updated uart_rx_enable() and uart_tx() to use timeout given
in microseconds. Previously argument was given in milliseconds.
API change was done in:
https://github.com/zephyrproject-rtos/zephyr/pull/39041
Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
The handler was reworked to internal function and it
is called from the erase and the write
procedures automatically now.
This change was made due to deprecation of the flash write-protection
API.
Explanation for so late removal:
Reworked callback was introduced despite that the API had been
already deprecated at the addition time.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
On nRF53 Series SoCs, the highest SCK frequencies can only be achieved
when the HFCLK192M clock divider is changed from the default /4 setting.
Such change results in increased power consumption, so the divider needs
to be changed only for periods when it is actually necessary.
This commit modifies the driver behavior so that it changes the divider
only when a QSPI bus operation is performed.
However, when XIP accesses to the flash chip are also used, it may be
needed to keep the divider changed even when the driver is idle so that
the XIP access speed is not reduced, hence a custom API function that
allows forcing this is introduced for the driver.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Only run the `uninit` function if the SPI instance has previously been
configured. This stops an assertion in the HAL drivers from triggering
due to running `uninit` without a previous `init`.
Fixes#42299.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
HAL call function used to retrieve the configured baudrate
returns the real calculated value, which might not be exactly as
the configured. For baudrate of 115200, HAL api
returns 115201, which then causes uart_basic_api test
to fail. Instead of returning the calculated baudrate value,
returns the configured one.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Set enable configuration change bit in can_mcan_set_timing() because
the NBTP register can only be changed if we're in init mode AND
configuration change bit is set, per MCU docs.
Signed-off-by: Jeremy Wood <jeremy@bcdevices.com>
Invalidate the cache before the RX data block is passed to the DMA
engine and not after it is received. If the RX data block contains
dirty cache lines they can be flushed anytime, overwriting legitimate
data that have been prefilled by the DMA module.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
`qdec_sam` driver supports currently only position measurement and does
not support reading of the index signal. Unfortunately, the index
signal was internally enabled in the driver. If the pin to which the
index signal was connected was used by another driver it could lead to
a false detection of the signal change. Detection of the index signal
change resets the position measurement.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Fix handling of the return value by `eth_sam_gmac_set_config` function.
The function is used as a backend by
`net_mgmt(NET_REQUEST_ETHERNET_SET_MAC_ADDRESS, ...)` to change the
interface MAC address at run time.
Tested on sam_e70_xplained board.
Fixes#42151
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Remove unneeded NULL check in pmic init function. Not required as
device_is_ready() will handle NULL device structs.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Config struct in pmic regulator driver was being used as a non-constant
value when an array defined at compile time was cast to a struct used at
runtime. Move this pointer to the data struct in pmic driver.
Fixes#41951
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>