Fix channel ID check in dac_esp32_channel_setup as it was allowing to
set up a channel with ID greater than the number of channels.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Initial DAC driver for TI DAC161S997. This is a 1 channel 16 bit
DAC designed for 4-20 mA loops.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Fixed a typo in BUILD_ASSERT macro causing driver to effectively fail to
compile as seen in:
west twister -p sam_v71_xult/samv71q21b -s drivers.dac.api
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The MAX22017 is a two-channel industrial-grade software-configurable
analog output device that can be used in either voltage or current output
mode.
Signed-off-by: Guillaume Ranquet <granquet@baylibre.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 Atmel SAM0 SoC enable peripherals clocks in distinct places: PM and
MCLK. The old devices had defined the peripheral clock enable bit at PM.
On the newer devices this was extracted on a dedicated memory section
called Master Clock (MCLK). This change excludes the dedicated bindings
in favor of a generic approach that cover all cases.
Now the clocks properties is complemented by the atmel,assigned-clocks
property. It gives the liberty to user to customize the clock source
from a generic clock or configure the direct connections.
All peripherals drivers were reworked with the newer solution.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
The parameter provided to the `BIT()` macro must be checked so that
the shift operation does not overflow the variable.
Fixes#81990
Signed-off-by: Martin Jäger <martin@libre.solar>
Use shell_device_get_binding() instead of device_get_binding() so that
we get the device based on its name and in addition by its label.
Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
Optionally write to ad559x register bit which increases DAC output range
from 0V to 2 x Vref.
The functionality has been tested on AD5593r.
The voltage at 4095 has been measured to 5.01 volts.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.sam*.
Fixes#78619
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.gd32.
Fixes#78619
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
The dacx3608 line supports a broadcast register so all configured channels
can output a singular value, simultaneously. This drastically reduces I2C
overhead when using multi-channel control. An API addition was necessary
to support a global broadcast channel number. The API addition does not
break the write_value() implementation for other DAC drivers in the repo.
This change is based on an out-of-tree driver developed internally to
handle this use case.
Alternative to the API change, could be a KConfig option or device tree
entry. Also, no support for the Broadcast channel was added to the
channel_setup() implementation - this may or may not be confusing. I
believe it makes sense to maintain explicit setup calls for each channel
intended to be configured.
Signed-off-by: Ben Booher <benbooher@pull-repo.com>
The buffered and internal options were not assigned in the channel_cfg,
so they would end up at a random state.
The cfg struct is now properly zero-initialized and both options can
be set using optional parameters -b and -i.
Fixes#75884
Signed-off-by: Martin Jäger <martin@libre.solar>
Now that we support internally connected channels we should make the
pinctrl configuration optional.
Signed-off-by: Corey Wharton <xodus7@cwharton.com>
Adds support for configuring the STM32 DAC channel mode for internal
connections. This is only enabled for SOCs that support it.
Signed-off-by: Corey Wharton <xodus7@cwharton.com>
Select PINCTRL subsystem by drivers which require it.
Prevent the need from enabling this symbol at board or soc level.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
The 14/12-bit variants (AD5692R/AD5691R) require the data to be in the
upper bits of the two byte data field of the write command. See table 12
and the associated footnotes in the AD5693R/AD5692R/AD5691R/AD5693
datasheet.
Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
The intention here appears to be to return an error. Use an early return
to implement this.
Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
An off by one error in the channel range check results in an out of
bound access to the channel lookup array.
Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.
Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.
Updated the includes path of in-tree sources accordingly.
Most of the changes here are scripted, check the PR for more
info.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Adds a DAC driver for Texas Instruments DACx0501 family of devices
Signed-off-by: Eran Gal <erang@google.com>
Co-authored-by: Martin Jäger <17674105+martinjaeger@users.noreply.github.com>
Rename ad5592 files in dts, driver and include to ad559x and add support
for I2C bus which is required for AD5593.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Presently, this driver cannot handle multiple
DACs of the same type without throwing a
compile error due to a missing line ending.
This PR fixes that issue by adding the missing
line ending.
Signed-off-by: Kyle Kotowick <kotowick@invictonlabs.com>
Compare value and DAC resolution in `dac_write_value` and return -EINVAL
if the value is above supported resolution.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Add max size check to dac sam and sam0
There is no size check in dac_sam_write_value and dac_sam0_write_value.
Besides, the ret value should also be different.
Fixes#65021
signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
Do not enable subsystem/driver shell modules by default and stop abusing
CONFIG_SHELL_MINIMAL, which is internal to the shell subsystem, to decide
when to enable a driver shell.
The list of shell modules has grown considerably through the
years. Enabling CONFIG_SHELL for doing e.g. an interactive debug session
leads to a large number of shell modules also being enabled unless
explicitly disabled, which again leads to non-negligible increases in
RAM/ROM usage.
This commit attempts to establish a policy of subsystem/driver shell
modules being disabled by default, requiring the user/application to
explicitly enable only those needed.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Move the syscall_handler.h header, used internally only to a dedicated
internal folder that should not be used outside of Zephyr.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Create dac_mcxu_lpdac.c file to implement mcux lpdac, add binding for
the mcux lpdac, update Kconfig.mcux and CMakeLists.txt file to support
mcux lpdac.
Signed-off-by: Albort Xue <yao.xue@nxp.com>