Add support for hardware reset via GPIO in the ADIN1100 PHY driver.
The reset pin is configured via device tree using the reset-gpios
property.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Clarify HAL return value is of type HAL_StatusTypeDef and may not
be a int. This change aims preventing one from mixing standard "errno"
int return values and STM32 HAL return value finding misleading
implementation in existing code.
No functional change.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add missing test of HAL_FLASHEx_DATAEEPROM_Unlock() return value.
By the way, add a error trace message when failing to relock the
EEPROM after we failed to program it.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Correct eeprom_stm32_write() to return a valid errno instead
of mixing HAL return values and errno return values.
Clarify HAL return value is of type HAL_StatusTypeDef and not an
int in eeprom_stm32_read().
Remove printing of HAL_FLASHEx_DATAEEPROM_Lock() error code since
not very useful.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
The STM32 QSPI, OSPI, and XSPI drivers support sending the ULBPR command
for flash ICs that require unlocking before writing to. This is done
conditionally based on the requires_ulbpr devicetree property.
Previously the driver would always log "Write Un-protected", even if a
write un-protect was not attempted. Fix this so that "Write Un-protected"
is only logged when a write un-protect is attempted and succeeds.
Signed-off-by: Ben Marsh <ben.marsh@helvar.com>
Use build assert to check counts_per_revolution DTS value compile time to
prevent runtime failure and also decrease flash usage slightly.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Obtain the value for the AMBA AHB bus width (32 bit/64 bit/128 bit) from
the design_cfg5 register at init-time rather than specifying it in the
respective SoC's DT.
Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
Moved the MSI init after the LSE init to respect the initialization flow
of the MSI PLL mode that need LSE to be enabled and ready.
Signed-off-by: Julien Racki <julien.racki-ext@st.com>
Fix mcux flexcan driver failed to transfer when both loop back mode
and CAN FD mode are enabled.
Transceiver Delay Compensation feature must be disabled in loopback
mode. For some platforms, both FDCTRL[TDCEN] and ETDC[ETDCEN] can
enable such feature. In this case, SDK API only configure ETDC register
and current driver do not clear ETDC[ETDCEN].
Fix this issue by add ETDC[ETDCEN] configuration according to SDK
macro `FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG` vaule.
Test this commit on mimxrt1180_evk/mimxrt1189/cm33 and set both CAN FD
mode and loop back mode.
Signed-off-by: William Tang <william.tang@nxp.com>
Change HDC_302X_TEMP_OFFSET_SCALE and HDC_302X_HUMIDITY_OFFSET_SCALE
from float literals to double literals to avoid implicit conversion
warnings when compiling with clang and -Wdouble-promotion flag.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Redefine some macros due to different naming scheme in the header file.
Get the clock rate from the device tree when 'SOC_ATMEL_SAM_MCK_FREQ_HZ'
is not defined.
Signed-off-by: Tony Han <tony.han@microchip.com>
The HDC302X sensor driver is added,
you can use this driver to read temperature and humidity.
Also set an offset, upper and lower limits to get warned
when temperature or humidity get out of band.
The sensor is build for ultra low power applications.
Signed-off-by: COUSSEMENT Stijn <stijn.coussement@psicontrol.com>
Reduce floating-point operations in the nxp_pmc_tmpsns.
Provide new calculation method without floating-point operations.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
The max30101 allows to configure time slots in samples acquisition.
It is now supported by adding matrix mapping for the slot/fifo
indexing. When a channel is present multiple times, the resulting
sample from the `sensor_channel_get` is averaging each entry.
Added Die temperature sample acquisition with
`CONFIG_MAX30101_DIS_TEMPERATURE` Kconfig.
Signed-off-by: Logan Saint-Germain <l.saintgermain@catie.fr>
The max30101 sensor driver doesn't support triggers.
Add `.trigger_set` API and corresponding Kconfig and
device tree parameters. Add `SENSOR_CHAN_AMBIENT_LIGHT`
and `SENSOR_TRIG_OVERFLOW`.
Signed-off-by: Logan Saint-Germain <l.saintgermain@catie.fr>
The max30101 sensor driver doesn't support multiple instance.
Update Kconfig and maxim,max30101.yaml for instance based
configuration. Propagate changes over existing files.
Signed-off-by: Logan Saint-Germain <l.saintgermain@catie.fr>
Enable this kconfig setting to force using a specific raw value for the
OVRDVAL field in the DLLCR registers.
This option gives more granularity than the 'data-valid-time' field in
the dts. The unit of 'data-valid-time' is nanoseconds while the unit of
OVRDVAL are raw delay cells.
Normally the 'data-valid-time' on any 'nxp,imx-flexspi-device' device
will set the OVRDVAL and OVRDEN fields in the DLLCR register
but works only when the 'rx-clock-source' is configured to '#0 External
input from DQS pad' and the frequency <= 100MHz.
Signed-off-by: Andre Heinemans <andre.heinemans@nxp.com>
Replace the look-up table used to obtain the prescaler enumeration with
a simple multiplication.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
The existing formula assumed prescaler enumerations were consecutive,
which led to incorrect values being passed to HAL functions. Update
the code to calculate correct prescaler enumerations.
Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
In case of using HAL_OVERRIDE, avoid clearing the FIFO ERROR flag
before calling the HAL DMA IrqHandler so that the HAL DMA code
handling can be used.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
If hal_override is set, avoid reporting an error and clear the
transfer error (TE) bit so that HAL code can properly handle it.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
The size of icm45686_encoded_data fifo_payload is guaranteed
to span the full number of frames read as it was allocated during
icm45686_event_handler() buf_len_required size.
This update suppresses the static analysis warning of
out of bounds memory access at index 1 by explicitly declaring
fifo_payload to be a VLA at the end of icm45686_encoded_data.
Signed-off-by: Anthony Williams <anthony289478@gmail.com>
Change the __ASSERT on unsupported fifo packet header to
CHECKIF so the user can choose how to handle the invalid
packet.
Signed-off-by: Anthony Williams <anthony289478@gmail.com>
When operating in streaming mode, a FIFO empty event, which
is caused by host reading the last byte of the last FIFO frame,
can cause FIFO data corruption.
During subsequent reads to the FIFO, the first frame that arrives
after the empty condition will be corrupted. Once the issue occurs,
the internal state cannot recover and the FIFO must be flushed in
bypass mode to clear the corrupted state.
The current workaround from TDK is to read M-1 frames when M frames
are reported by fifo_count. Since M is fixed by the fifo_watermark
DT parameter, and in cases where fifo_watermark == 1, the watermark
trigger threshold is set to M + 1 frames and M frames are read out
during a watermark threshold event.
Signed-off-by: Anthony Williams <anthony289478@gmail.com>
When an unsupported fifo packet triggers an assert, it is
helpful to see the packet as a hex value to help when debugging.
Signed-off-by: Anthony Williams <anthony289478@gmail.com>
tx_int_sem serves solely as a signal indicator and does not require signal
counting. Within eth_stm32_tx, the semaphore is reset each time a packet
is transmitted. Upon receiving the transmission completion signal, the
function exits. Signal counting is unnecessary. Change to a binary
semaphore.
Signed-off-by: WenBin Zhang <freey7955@gmail.com>
During a Host-to-Device Control transfer, an arbitrary amount of data is
sent from Host to the Device using OUT Data packets. If the total amount of
data to transfer, communicated via the wLength field of the SETUP packet,
exceeds the EP0 MaxPacketSize, several Data packets until all data has been
transfered.
Combined with HAL behavior, the STM32 driver did not handle this situation
properly and always ended reception after a single Data packet was received
regardless of whether or not all data had actually been received from Host.
Modify driver to handle this situation properly by keeping track of how
much data has been received and restarting transfers until we have received
everything the Host promised it would send.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Drop all existing transfers in control endpoints' queue when a new SETUP
packet is received. Also use the appropriate net_buf API in a nearby place.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Extend the IT51XXX M1K flash controller driver to implement the flash
extended operation (ex_op) API. This allows runtime selection of both
the flash device and the addressing mode:
Flash target selection:
- FLASH_IT51XXX_INTERNAL: on-chip SPI eFlash
- FLASH_IT51XXX_EXTERNAL_FSPI_CS0: external SPI flash on FSCE0#
- FLASH_IT51XXX_EXTERNAL_FSPI_CS1: external SPI flash on FSCE1#
Addressing mode selection:
- FLASH_IT51XXX_ADDR_3B: 3-byte (24-bit) addressing mode, supports
flash devices up to 16MB capacity
- FLASH_IT51XXX_ADDR_4B: 4-byte (32-bit) addressing mode, required
for devices larger than 16MB
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Rename the modulino pixels driver to use the official marketing name,
the "smartleds" one was picked incorrectly from the source code of the
on board mcu of the module itself, but that was clearly out of date.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Properly close down the CMUX channel before shutting down
the modem.
The CMUX Close-Down command should indicate the remote end
to clean up, even if we don't have shutdown script or power-key GPIO.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Optimizes i2s_esp32_stream_data and i2s_esp32_stream_conf structs and adds
property sanity check according to soc series based on SOC_GDMA_SUPPORTED
feature
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>