Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
tle9104.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 SILA Embedded Solutions GmbH
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_TLE9104_H_
7
#define ZEPHYR_INCLUDE_DRIVERS_MFD_TLE9104_H_
8
9
#include <
stdbool.h
>
10
#include <
zephyr/device.h
>
11
12
#define TLE9104_GPIO_COUNT 4
13
14
enum
tle9104_on_state_diagnostics
{
15
/* overtemperature */
16
TLE9104_ONDIAG_OT
= 5,
17
/* overcurrent timeout */
18
TLE9104_ONDIAG_OCTIME
= 4,
19
/* overtemperature during overcurrent */
20
TLE9104_ONDIAG_OCOT
= 3,
21
/* short to battery */
22
TLE9104_ONDIAG_SCB
= 2,
23
/* no failure */
24
TLE9104_ONDIAG_NOFAIL
= 1,
25
/* no diagnosis done */
26
TLE9104_ONDIAG_UNKNOWN
= 0,
27
};
28
29
enum
tle9104_off_state_diagnostics
{
30
/* short to ground */
31
TLE9104_OFFDIAG_SCG
= 3,
32
/* open load */
33
TLE9104_OFFDIAG_OL
= 2,
34
/* no failure */
35
TLE9104_OFFDIAG_NOFAIL
= 1,
36
/* no diagnosis done */
37
TLE9104_OFFDIAG_UNKNOWN
= 0,
38
};
39
40
struct
gpio_tle9104_channel_diagnostics
{
41
enum
tle9104_on_state_diagnostics
on
: 3;
42
enum
tle9104_off_state_diagnostics
off
: 2;
43
};
44
53
int
tle9104_get_diagnostics
(
const
struct
device
*dev,
54
struct
gpio_tle9104_channel_diagnostics
diag[
TLE9104_GPIO_COUNT
]);
62
int
tle9104_clear_diagnostics
(
const
struct
device
*dev);
71
int
tle9104_write_state
(
const
struct
device
*dev,
uint8_t
state
);
72
73
#endif
/* ZEPHYR_INCLUDE_DRIVERS_MFD_TLE9104_H_ */
device.h
tle9104_clear_diagnostics
int tle9104_clear_diagnostics(const struct device *dev)
clear the diagnostics of the outputs
TLE9104_GPIO_COUNT
#define TLE9104_GPIO_COUNT
Definition
tle9104.h:12
tle9104_get_diagnostics
int tle9104_get_diagnostics(const struct device *dev, struct gpio_tle9104_channel_diagnostics diag[4])
get the diagnostics of the outputs
tle9104_write_state
int tle9104_write_state(const struct device *dev, uint8_t state)
write output state
tle9104_on_state_diagnostics
tle9104_on_state_diagnostics
Definition
tle9104.h:14
TLE9104_ONDIAG_OT
@ TLE9104_ONDIAG_OT
Definition
tle9104.h:16
TLE9104_ONDIAG_OCTIME
@ TLE9104_ONDIAG_OCTIME
Definition
tle9104.h:18
TLE9104_ONDIAG_NOFAIL
@ TLE9104_ONDIAG_NOFAIL
Definition
tle9104.h:24
TLE9104_ONDIAG_OCOT
@ TLE9104_ONDIAG_OCOT
Definition
tle9104.h:20
TLE9104_ONDIAG_SCB
@ TLE9104_ONDIAG_SCB
Definition
tle9104.h:22
TLE9104_ONDIAG_UNKNOWN
@ TLE9104_ONDIAG_UNKNOWN
Definition
tle9104.h:26
tle9104_off_state_diagnostics
tle9104_off_state_diagnostics
Definition
tle9104.h:29
TLE9104_OFFDIAG_NOFAIL
@ TLE9104_OFFDIAG_NOFAIL
Definition
tle9104.h:35
TLE9104_OFFDIAG_SCG
@ TLE9104_OFFDIAG_SCG
Definition
tle9104.h:31
TLE9104_OFFDIAG_OL
@ TLE9104_OFFDIAG_OL
Definition
tle9104.h:33
TLE9104_OFFDIAG_UNKNOWN
@ TLE9104_OFFDIAG_UNKNOWN
Definition
tle9104.h:37
state
state
Definition
parser_state.h:29
stdbool.h
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
device
Runtime device structure (in ROM) per driver instance.
Definition
device.h:513
gpio_tle9104_channel_diagnostics
Definition
tle9104.h:40
gpio_tle9104_channel_diagnostics::on
enum tle9104_on_state_diagnostics on
Definition
tle9104.h:41
gpio_tle9104_channel_diagnostics::off
enum tle9104_off_state_diagnostics off
Definition
tle9104.h:42
zephyr
drivers
mfd
tle9104.h
Generated on
for Zephyr API by
1.17.0