Sort the list of CAN driver subsystem files and split them into common and
driver-specific sections.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
`adc_read_async` is documented as supporting the `async` signal as NULL.
Update the emulator to no longer block until completion when
`adc_read_async` is called in this situation.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Refactor and merge the SoC support files for the Atmel SAM E70 and SAM V71
product series. These SoCs are part of a larger product family (SAM
E70/S70/V70/V71) and share a common set of peripherals.
Support for the two remaining product series (SAM S70/V70) is not part of
this refactoring as these will require further additions to the Atmel HAL.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
The lis2dh driver has the ability to enable the hp filter.
However it was only possible to set the first 2 bits of the hp register.
These bits indicate wether the hp filter is enabled for the interrupts.
This commit moves lis2dh_acc_hp_filter_set to lis2dh.
It also removes the mask so that all bits are able to be set.
Signed-off-by: Maarten Nieuwenhuize <maarten.nieuwenhuize@picoo.nl>
sample_fetch function has quite a high cyclomatic complexity, this
refactoring aims to reduce cyclomatic complexity by refactoring.
- introduce fetch current on pin function
- introduce fetch voltage on pin function
- introduce fetch temperature on pin
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
This commit replaces a hack where is_busy status of adltc2990 was
checked by fetching SENSOR_CHAN_ALL with a dedicated function
expose adltc2990_trigger_measurement function to public api
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Add wsen_pdus_25131308XXXXX driver with
the corrected name and compatibility with
the hal update as well as added new features..
Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
Remove the #ifdef guard around a function prototype. This was causing a
compile error when CONFIG_FLASH_NPCX_FIU_DRA_V2 was disabled.
Signed-off-by: Keith Short <keithshort@google.com>
The data size is set using a burst length, the data size for 8/16/32 is
always 1 in those cases.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The internal chip selects are limited to 4, however when using GPIOS
does not pose this limitation.
Also set internal channel to 0 if GPIOS are used.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Defined default values for baudrate, parity, stop bits, and data bits.
This removes complexity and obfuscation from the code.
Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
This commit adds MBOX device tree entry for MCXN947.
Adds support for MCXN in NXP ipm and mbox drivers.
Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
The AD4114 is a low power, low noise, 24-bit, sigma-delta ADC.
This driver allows to use it with the Zephyr ADC API. It uses
the continuous acquisition ADC feature.
This ADC allows many configutations, but this driver uses it as the
most generic way :
- each can channel can be enable or disable using the device
tree configuration
- configure two setups (one for unipolar inputs, one for bipolar inputs)
- use an external clock
Signed-off-by: Pierrick Curt <pierrickcurt@gmail.com>
1. Temperature Interface
According to BMI08x datasheet, temperature reading
requires both MSB and LSB bytes to be read and
processed correctly.
Temp data processing should follow the formula:
Temp in °C = (temp_msb * 8) + (temp_lsb / 32)
This patch implements the correct reading
sequence and calculation method as specified
in the datasheet.
2. Trigger Setting
Previously we set handler and then trigger struct.
However under some situation, as long as we set
the handler, we get into ISR immediately and never
set trigger struct.
I simply changed the sequence.
Testing:
- Verified temperature readings match datasheet
- Tested on stm32f407igh board with BMI08x sensor
Fixes: #82375
Signed-off-by: Wenxi Xu <xuwenxi0517@gmail.com>
`sensor_sample_fetch` is documented as blocking until the fetch
operation is complete. Update the implementation so that this is true.
Since the fetch operation now blocks, there is no need for the data
ready trigger.
Signed-off-by: Jordan Yates <jordan@embeint.com>
When configuring the device to run in one-shot mode, the AS6212 requires
the sleep mode bit to be set. From the datasheet:
```
The sleep mode is activated by setting the bit SM in the configuration
register to 1. This shuts the device down immediately and reduces the
power consumption to a minimum value.
Entering the sleep mode will take some time (120 ms maximum) and the
first conversion after the sleep mode has been entered takes longer than
the values specified in Figure 7. It is therefore recommended when
entering sleep mode to trigger a single shot conversion at the same
time. After 150 ms (max), the device has then entered the sleep mode and
subsequent conversion times are as specified in Figure 7.
```
Signed-off-by: Jordan Yates <jordan@embeint.com>
Use the common `sensor_value_*` helper functions instead of implementing
the conversions again in the driver.
Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit introduces a new Sensor Clock API, enabling the retrieval
of cycle counts and conversion to nanoseconds based on the system or
external clock. The API includes:
- `sensor_clock_get_cycles()` to get the current cycle count from the
sensor clock.
- `sensor_clock_cycles_to_ns()` to convert cycles to nanoseconds using
the clock's frequency.
The implementation supports both system clocks and external clocks
defined in the device tree, making the sensor clock integration more
flexible for various sensor use cases.
Signed-off-by: Mark Chen <mark.chen@cienet.com>
Added more APIs for ARM SCMI clock management protocol.
- scmi_clock_rate_set
- scmi_clock_parent_get
- scmi_clock_parent_set
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Change the stepper API to instead of changing the stepper speed based on
the velocity in microsteps per second to use the delay in usec between
successive steps. Also remove the velocity from the `stepper_run` function
as typical API usage is enable -> set step interval -> run.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Use hardware clock frequency to calculate watchdog expire ticks
instead of kernel's "ticks".
Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
Enabling `CONFIG_INPUT_FT5336_INTERRUPT` if the ft5336 node in DT
has `int-gpios` property.
As a result of this change, some boards can eliminate lines that
explicitly configure `CONFIG_INPUT_FT5336_INTERRUPT`.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The SAM0 ADC has an internal register to divide the accumulated results
of oversampling the ADC by the amount of samples collected. This value
has to be set by the driver and was missing.
Signed-off-by: Patrick Günzel <patrick.guenzel@kinexon.com>
The commit 2c3165d187 ("drivers: spi: add opaque type to encode SPI
operation flags") introduces new type for operation flag, since it is
16/32-bit depending on CONFIG_SPI_EXTENDED_MODES.
Use the new type for safe, if the function 'spi_stm32_shift_frames' may
use extended operation flag later.
Signed-off-by: Haiyue Wang <haiyuewa@163.com>
Move all initialisation of the data struct to the init function to avoid
creating the very large `struct sd_card` in `.bss`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
In the dma loop_transfer test (test_loop_repeated_start_stop()), the
order of calls is dma_config() -> dma_stop() -> dma_start(). This
currently does not work on xmc4xxx because after calling dma_stop(), the
dma would be in a suspended state. Fix this by leaving the suspended state
before exiting dma_stop().
Also don't clear the context (dma_channel->dlr_line and dma_channel->cb)
that was setup by dma_config().
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
When quering the DMA status we need to return the number of pending bytes
left in the transfer. Currently this is inferred by calling
XMC_DMA_CH_GetTransferredData(). However, this function actually returns
the number of items read from the source peripheral (via CTL.BLOCK_TS).
It doesn't guarantee that the last item was fully transferred to the
destination.
When using the ADDR_ADJ_INCREMENT/DECREMENT options it is better to use
DAR register to infer the number of transferred bytes. This points to the
memory address where the next data will be written. It only increments
after the ongoing transfer from source to destination is completed.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Some ADCs (e.g. SAM0) can only convert one channel at a time
and therefore need to be reconfigured for every voltage
divider prior to startin the conversion
Signed-off-by: Patrick Günzel <patrick.guenzel@kinexon.com>
end frame is used to supply clock pulses so that data goes to last
LED in the chain. Thus, it depends on the number of LEDs in the chain.
Previously, the number of ones sent into the end frame was
hard-coded and limited the usage of the driver to 64 LEDs in the
strip.
Signed-off-by: Cyril Fougeray <cyril.fougeray@toolsforhumanity.com>
Move the SAM V71 register name fixup from the SoC code into the PWM driver
next to the other PWM driver fixup.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit adds support for the STM32WB0 series to
the existing STM32 timer-based counters driver.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>