This patch allows to _safely_ configure GPIO ports that have their pad
on FAST_ACTIVE1 domain.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
It's not possible to get pinconfig of specific pin
in ambiq_gpio_port_get_raw function, change to use
OR value of RD and WT registers for one group of gpio.
Signed-off-by: Hao Luo <hluo@ambiq.com>
The sys_write32 function expects a value as the first parameter and the
memory location where the value should be written as the second parameter.
Signed-off-by: Nils Bosbach <bosbach@ice.rwth-aachen.de>
Implement the parallel mode in the powertrain switch TLE9104.
This allows that OUT1 and OUT2 are controlled together, as well
as OUT3 and OUT4.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
The Drivers using Pinctrl should be turning Pinctrl on
this should not be the responsibility of the board. This
commit removes CONFIG_PINCTRL from the boards side for nxp boards.
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Industrial 8 channel output with advanced diagnostics.
Allowing giagnostic configuration both on per channel or global bases
In SPI communication diagnostic status transmitted on every
READ/WRITE which includes generic status of chip.
Diagnostics includes :
* Oveload
* Open Wire
* Over current
* Short to VDD
* Thermal Shutdown
* VDD Warn
* Watch Dog Error
* Communication Error
* VDD under voltage
Add app.overlay for MAX14916 driver.
Tested with adopted basic/blinky example.
Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
MAX14906 in 4 channel I/O with advanced diagnostic.
In SPI communication diagnostic status transmitted on every
READ/WRITE which includes generic status of chip.
Configuration both on global level and on per channel bases.
Diagnostics includes :
* Thermal overload
* current limit
* open wire detection
* short to VDD
* Above VDD
* Safe DEmagnitization fault
* VDD warning
* VDD low
* SPI/CRC Error
* WDog Error
* Loss GND
Add app.overlay for MAX14906 driver.
Tested with adopted basic/button and basic/blinky sample.
Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Since the log module entity is not defined anywhere,
LOG_MODULE_REGISTER should be used here instead of LOG_MODULE_DECLARE.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Update the GPIO driver to use PDL API instead of HAL API to fix the
issue with configuring interrupts on both edges
Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
The driver enables the clock of a gpio-port if any of the
pins use the port. This is done by calling pm_device_runtime_get
when a pin is used and pm_device_runtime_put when the pin is not
used anymore.
These calls needs to be balanced. But if a single pin was configured
as GPIO_DISCONNECTED multiple times, every time pm_device_runtime_put
was called.
This caused the clock of the port to be stopped and therefore also
other pins on the same port stopped working.
This commit fixes this by keeping track of which pin on a port
has requested the clock and only call pm_device_runtime_get or
pm_device_runtime_put when the clock-request for the specific pin
changes.
Fixes#77698
Signed-off-by: Jeroen Broersen <jbroersen@interact.nl>
Fixed uninitialized return value variable issue, which would cause
functions to wrongly return non-zero value despite a successful
execution.
Signed-off-by: Chew Zeh Yang <zeon.chew@ambiq.com>
The local function ll_gpio_get_pin_pull() is not always referenced. Add
the __maybe_unused attribute to avoid compiler warnings (which may be
promoted to errors by downstream users).
Signed-off-by: Keith Short <keithshort@google.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
There are numbers of drivers for different PCA(L) series chip. They
share similiar register layout and control logic. This driver intends
to unify these drivers for PCA(L)xxxx series i2c gpio expanders.
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
Implement an option manual reset of the PCAL64XXA to allow the external
implementation of a retention of the port expander state.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Extract method which applies the initial state in the driver
for the port expander PCAL64XXA.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Remove all entries that as not being used.
This also update hal to re-enable warning flags
as such as -Wno-unused-variable.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This commit rebrands the STM32 EXTI API to a more hardware-agnostic
"GPIO interrupt controller" API, in anticipation of the introduction of
new series lacking the EXTI peripheral. The GPIO and EXTI drivers are
updated to match the rebranded API.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
This commit makes the contents of the stm32_exti_line_t data type opaque to
the EXTI GPIO interrupt controller API users. The GPIO driver is updated
to comply with this API change.
N.B.: while some assertions are removed as part of this commit, they were
broken since forever anyways, so nothing of value is lost.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Move the functions that interact with EXTI configuration registers to
select or get the GPIO port that triggers events on a given EXTI line
to the EXTI driver.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Modify all functions in the GPIO driver that interact with the EXTI
so that names, signatures and comments match what they do better.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Use the `gpio_pin_t` type for all variables that hold a pin number (0..15).
Change all `int` to `uint32_t` instead, as signedness is unwanted.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
This commit changes the EXTI driver API to use unsigned types
for all parameters previously typed as `int`, as the signedness
is unneeded and unwanted.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
- Removed zero initialization of `pincfg` structure as all members
are guaranteed to be set.
- Introduced `pfs_cfg` as an intermediate variable to store data in
the CPU register instead of stack.
- Simplified pin setting logic by relying on `pfs_cfg` being
zero-initialized, eliminating the need for explicit bit clearing.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This is just the driver for banks 0 to 3. Bank 4 will come via a
separate commit since it needs a different driver.
Signed-off-by: Michael Zimmermann <michael.zimmermann@grandcentrix.net>
Add checks to return value of esp_intr_alloc to avoid drivers init
returning 0 when interrupt allocation fails.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Introduced `GPIO_DEVICE_INIT_RA_IF_OKAY` which utilizes `COND_CODE_1`
to reduce the chain of #if DT_NODE_HAS_STATUS(...) #endif
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Writing directly to Px_DATA_REG modifies pins which are not
indicated by mask, causing gpio_basic_api test to fail.
Use Px_SET_DATA_REG and Px_RESET_DATA_REG to modify only
pins indicated by mask.
Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
Set pin to input with no resistors selected when it is configured as
GPIO_DISCONNECTED.
Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
Background of this modification is to make gpio driver code
provided by Renesas vendor to be an official support for Renesas
MCU on Zephyr
Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
RGPIO model on RT1180 is same with igpio, however,
current driver can't support.
Update gpio driver to support gpio pad control
Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>