Bridle API 4.1.99
A Zephyr based application framework
Loading...
Searching...
No Matches
mfd_sc18is604.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 TiaC Systems
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
11#ifndef ZEPHYR_DRIVERS_MFD_SC18IS604_H_
12#define ZEPHYR_DRIVERS_MFD_SC18IS604_H_
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include <zephyr/kernel.h>
19#include <zephyr/drivers/gpio.h>
20#include <zephyr/drivers/spi.h>
21
23
24/*
25 * Values in Hz, intentionally to be comparable with the spi-max-frequency
26 * property from DT bindings in spi-device.yaml.
27 */
28#define MFD_SC18IS604_SPI_HZ_MIN 100000
29#define MFD_SC18IS604_SPI_HZ_MAX 1200000
30
31#define MFD_SC18IS604_SPI_DELAY_USEC 8 /* between two SPI bytes */
32#define MFD_SC18IS604_RESET_SETUP_USEC 1 /* >= 125ns acceptance time */
33#define MFD_SC18IS604_RESET_TIME_USEC 500
34
35/* timeout for about two times a maximum command (three byte) at 100kHz */
36#define MFD_SC18IS604_CMD_MAX_TOUT_USEC 200
37
38/* expected chip in version string */
39#define MFD_SC18IS604_VERSION_CHIP "SC18IS604"
41 "Chip name too long");
42
52struct mfd_sc18is604_config {
54 const struct spi_dt_spec spi;
56 const struct gpio_dt_spec interrupt;
58 const struct gpio_dt_spec reset;
59};
60
70struct mfd_sc18is604_data {
72 const struct device *dev;
74 struct k_sem lock;
76 struct gpio_callback interrupt_cb;
78 struct k_sem interrupt_signal;
80 sys_slist_t child_callbacks;
81#ifdef CONFIG_MFD_SC18IS604_ASYNC
83 struct k_work_q work_queue;
85 k_thread_stack_t *work_queue_stack;
86#endif /* CONFIG_MFD_SC18IS604_ASYNC */
87};
88
89#ifdef __cplusplus
90}
91#endif
92
93#endif /* ZEPHYR_DRIVERS_MFD_SC18IS604_H_ */
#define MFD_SC18IS604_VERSION_CHIP
Definition mfd_sc18is604.h:39
MFD Interface for an SC18IM604 bridge.
#define SC18IS604_VERSION_STRING_SIZE
Definition sc18is604.h:42