For use in tests where the existing "vnd,dac" driver doesn't work as it
returns error codes for all API functions. The approach is mimicked from
the adc-emul driver.
Signed-off-by: Henrik Lindblom <henrik.lindblom@vaisala.com>
Adapt all Espressif SoC and driver code to the updated
hal_espressif module synced with IDF master branch.
Main changes:
- clock control: delegate peripheral clock gating to HAL
layer using new clock/reset APIs
- SPI/GDMA: adapt to restructured DMA HAL with new channel
allocation and configuration interfaces
- ethernet: add RMII clock configuration and PHY management
- GPIO: simplify using direct HAL function calls
- flash: adapt to updated SPI flash HAL interfaces
- linker scripts: update IRAM/DRAM mappings for new HAL
object files
- DTS: fix ESP32-S2 PSRAM dcache1 address to match actual
MMU mapping region (0x3f800000 DRAM1 instead of 0x3f500000
DPORT which lacks 8-bit access capability)
- west.yml: update hal_espressif revision
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add shared code in 'dac_dacx311.c' and configuration files.
Support power mode bits via configuration.
Signed-off-by: Andreas Wolf <awolf002@gmail.com>
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Most drivers for Series 2 depend on clock control, but didn't
declare it. Enable clock control by default for Series 2 SoCs.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Use the "zephyr-keep-sorted-start/stop" comment to have CI check
the alphabetical order of includes, to help reducing the chance
of conflicts while contributing drivers.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Use STM32_CLOCK_INFO(), STM32_DT_INST_CLOCK_INFO(),
STM32_CLOCK_INFO_BY_NAME() and STM32_DT_INST_CLOCK_INFO_BY_NAME()
helper macros in STM32 drivers.
Using these macros ensure the clock division factor is properly
populated according to DT information. Prior these changes some
drivers only got the bus and bits position information and missed
the clock division information which is fine only when this division
factor information is 0.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
The Analog Device AD5601, AD5611, and AD5621 devices are 8, 10 and 12
bits DAC respectively.
These devices use a 16 bits SPI communication protocol.
The 2 first bit encode the low power mode (this driver do not use the
low power mode, it always run in the 'normal' mode).
The next 14 bits contain the left aligned value. The 2, 4, or 6
remaining bits (depending on the resolution) are set to 0.
Signed-off-by: Mickael Bosch <mickael.bosch@linux.com>
The SAMC21 has a different revision of the DAC peripheral.
This change adds an ifdef to handle the changed SYNCBUSY register.
Signed-off-by: Stefan Giroux <stefan.g@feniex.com>
Added support for selecting channels A, B, both together, and all channels
on the AD5686 DAC driver. This improves flexibility for multi-channel
DAC applications.
Signed-off-by: Aditya Ganesh <adga5133@colorado.edu>
This implements the DAC driver for silabs VDAC peripherals
using the silabs,vdac compatible binding.
Signed-off-by: Bastien Beauchamp <bastien.beauchamp@silabs.com>
Added driver and binding file for samd5x dac peripheral, the already
implemented dac_sam0.c lacks the configuration registers for this
microcontroller family and is fixed to only have one dac channel output,
also, the code gets too bulky when adding the samd5x dac configuration
using preprocessor directives that’s why I moved the implementation to its
own file.
Added dac to the supported list of same54_xpro.yaml, fixed Kconfig.samd5x
help spacing, added board defines to test_dac.c and test it out with
twister script on board.
Signed-off-by: Rafael Aldo Hernández Luna <aldo.hernandez@daikincomfort.com>
Change license owner to Prevas due to initially wrong owner due to company
mix-up during co-development.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
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>