Restructured counter and timer.
CTimer/Timer is now parent to pwm and counter.
Created PWM driver and tied to pwm and pwm-led
Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
This moves the couple functions that are and will be all over
the various clock operations for all platforms.
Signed-off-by: Camille BAUD <mail@massdriver.space>
Handle `SENSOR_CHAN_ALL` case of the sample_fetch callback of the
lis2dw12 driver. Without this, `sensor_sample_fetch()` does not work
correctly for this device, e.g. rendering the rtio and the sensor shell
unusable.
Signed-off-by: Ruben Völl <ruben.voell@sevenlab.de>
Rpu recovey debug stats are stored in hal_dev_ctx which is not
persistent in case of interface is brought down/up. Need to add
in nrf_wifi_ctx_zep and update before interface goes down.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
The MAX17055 peripheral allows measuring the current
value (which corresponds to the instantaneous value). Respond to
the `SENSOR_CHAN_CURRENT` command, and retrieve the data
from the `0x0a` device register.
Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
In order to allow decoupling these two operations.
No functional changes, sensor returns same readings through shell.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
As this isn't effectively providing any value to the driver, instead
wastes cycles on every sample-fetch. Scrubbing this simplifies the
code.
Also, remove fix_sign() and replace it for the in-tree helper
sign_extend().
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Some modems (e.g. Quectel BG95/EG25-G, several SIMCom parts) print
“APP RDY” when the application core is ready. Parse this line and
proceed from AWAIT_POWER_ON immediately, while keeping the existing
startup timeout as a fall-back.
* add MODEM_CELLULAR_EVENT_MODEM_READY + chat match
* open UART and attach chat in AWAIT_POWER_ON
* jump to SET_BAUDRATE / RUN_INIT_SCRIPT on event
Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
Add optional autostarts boolean to the quectel,bg95 binding and make
MODEM_CELLULAR_DEFINE_INSTANCE() use it through DT_PROP_OR().
Boards that carry a BG95-M3 Mini-PCIe card—or any other variant that
boots at VCC can now declare the property and skip the PWRKEY pulse,
while existing designs continue to behave unchanged.
Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
Quectel BG9x returns only the base model string to AT+CGMR, while
AT+QGMR provides the true firmware build ID, e.g.
AT+CGMR → BG95M3LAR02A03
AT+QGMR → BG95M3LAR02A03_01.204.01.204
Replace CGMR with QGMR in the BG95 init script so that
cellular_get_modem_info(... FW_VERSION ...) reports the complete
version string.
Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
Add quectel_bg95_shutdown_chat_script that issues AT+QPOWD=1 and
link it to MODEM_CELLULAR_DEVICE_QUECTEL_BG95 to enable a clean
software-initiated power-off path
Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
This commit adds support for configuring two user-defined target
addresses in the I2C target driver.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
GAIN field is not present on LV10A, so instead we need to
check the input value to the function.
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
The nrf-802154 driver may be unable to acquire a valid timestamp under
rare conditions. In such case, the nrf_802154_received_timestamp_raw
reports time=NRF_802154_NO_TIMESTAMP.
The shim implementation must not calculate the PHR timestamp when
receiving this value, because doing so results in an assert in
ptp_packet.h due to a negative time value.
When the driver is unable to capture the timestamp, the packet is
assigned zero as its timestamp.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
It was observed that device ceases to work in Buffer DMA mode after GET
DEVICE QUALIFIER request is STALLed (when USB stack is limited to
Full-Speed only operation). The issue is due to missing dout feed.
Clear pending dout feed flag after bus reset (enumeration done) and
after stalled control read transfer to allow dout to be feed when
necessary.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
The can_nrf device driver incorrectly passes its own device
driver pointer to a call to clock_control_get_rate() to get the
rate of the auxpll. The actual device driver which should be passed
to clock_control_get_rate() is the auxpll.
Without this fix, the call jumps to the can_nrf_api and returns
garbage (unfortunately it does not hardfault, which is why this
issue has not been discovered yet).
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
In order to abstract details of the transport itself, improving
portability.
No functional changes at this point. Driver works the same as far
as my local testing goes.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
The existing driver requires setting multiple attributes in order to
work basic fetch/get reads. Simplify this by allowing the user to set
dts node properties based on the use-case.
As a result, basic settings results in the driver being up and running
from the start, one can just get sensor readings out of the box.
These still can be overriden at run-time if need be.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Turn MCX series into families.
Reasoning:
1. The MCX SOCs are quite different from each other and having them all
under one family in the HWMv2 hierarchy is fruitless because there
are so many differences that it is confusing to try to introduce
family-level code and configs since they would each only apply to a
subset of the series. There is almost nothing that can be shared
between all of them. Which is why there are comments in the MCX
family files saying not to put anything in them. This is a technical
waste.
2. Therefore, turning all of them into families is almost 0 effort and
makes sense. It will allow these different types of MCX to be
further subdivided into series in the future as the MCX portfolio
expands and such division will be necessary as new SOCs within each
letter family are released.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Ensure uart_configure() only updates UART parameters without
reassigning pin configuration. Pin assignment via pinctrl is now
restricted to the initialization procedure, guaranteeing pins are
set only when properly configured.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
There was an observed situation where the assert checking frame length
is below 128 bytes was hit. While the nrf-802154 checks that the frame
does not exceed that size, there might exists code paths that allow such
packets to pass through.
The change removes the assert and drops the packet instead.
An error is also printed to allow for further debugging.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
To be consistent with the definition of label stm32_lp_tick_source,
be sure "st,timeout" is taken from the LPTIM defined as lp_tick_source.
Then, fix the computation of lptim_time_base.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Fix the non-IRAM interrupt disable routine to use non_iram_int_mask[cpu]
directly instead of its bitwise inverse. The previous implementation used
the wrong mask and could affect unrelated interrupts. This change ensures
that only intended non-IRAM interrupts are disabled and restored.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Fix bitwise operation when freeing an interrupt to correctly clear the
VECDESC_FL_NONSHARED, VECDESC_FL_RESERVED, and VECDESC_FL_SHARED flags.
Also reset the interrupt source to ETS_INTERNAL_UNUSED_INTR_SOURCE to
ensure proper cleanup and prevent issues with future allocations.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Replace global lock variable with function-local storage for irq_lock()
state. This fixes a race condition when multiple access enter or exit
the critical section at the same time. Now each lock/unlock pair uses
its own key, making interrupt safe.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
don't use global buffers for reg_read and reg_write,
so we only need to rely on the spi drivers lock and
don't have to use our lock.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
spi_configure was returning HAL error codes that are incompatible with
Zephyr error definitions straight back to the caller. Replace these with
error codes that Zephyr can correctly interpret.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Driver was not handling SPI word sizes other than 8 bits. Apply DFS
shift wherever necessary to support non 8-bit transfers.
DMA mode cannot support word sizes that are less than 8 bits so return
-ENOTSUP if word size less than 8-bits is required.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Reading back the raw interrupt status from the gpio controller, provides
the interrupt mask _without_ the controller's masking registers applied.
This means that e.g. a rising edge would trigger an interrupt even on
pins that are configured for falling edge only.
Fix this by reading the "enabled" interrupt status instead of the raw
one.
Signed-off-by: Emil Dahl Juhl <emdj@bang-olufsen.dk>
The polarity mapping was swapped such that GPIO_INT_TRIG_LOW would
translate to high, and vice versa, on the chip configuration.
Swap the polarity to fix this.
Signed-off-by: Emil Dahl Juhl <emdj@bang-olufsen.dk>
This commit implements the gpio_get_config handle for the gpio_mspm0
driver.
NOTE: Currently only handles input/output state and not configured flags
Signed-off-by: Hans Binderup <habi@bang-olufsen.dk>
Prior to this commit, writing a gpio port would completely clear
the state of given port. This commit ensures that state is kept
when writing, reading and configuring gpio ports.
Signed-off-by: Hans Binderup <habi@bang-olufsen.dk>