Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
MFD TLE927x Interface

Files

file  tle927x.h
 Public API for the Infineon TLE927x System Basis Chip MFD driver.

Enumerations

enum  tle927x_mode { TLE927X_MODE_NORMAL = 0U , TLE927X_MODE_SLEEP = 1U , TLE927X_MODE_STOP = 2U }
 SBC operating modes selectable over SPI. More...

Functions

int mfd_tle927x_read_reg (const struct device *dev, uint8_t reg, uint8_t *val)
 Read a TLE927x register.
int mfd_tle927x_write_reg (const struct device *dev, uint8_t reg, uint8_t val)
 Write a TLE927x register, writing a status register clears it.
int mfd_tle927x_update_reg (const struct device *dev, uint8_t reg, uint8_t mask, uint8_t val)
 Read-modify-write a TLE927x control register, atomically.
int mfd_tle927x_set_mode (const struct device *dev, enum tle927x_mode mode)
 Request an SBC mode transition.
int mfd_tle927x_get_mode (const struct device *dev, enum tle927x_mode *mode)
 Get the current SBC mode.
int mfd_tle927x_read_faults (const struct device *dev, uint8_t *sup, uint8_t *therm, uint8_t *dev_stat)
 Read the global fault status, leaving the registers latched.

Control registers

#define TLE927X_REG_MS_CTRL   0x01U
 M_S_CTRL, mode and supply control.
#define TLE927X_REG_HW_CTRL   0x02U
 HW_CTRL, hardware control.
#define TLE927X_REG_WD_CTRL   0x03U
 WD_CTRL, watchdog control.
#define TLE927X_REG_BUS_CTRL_1   0x04U
 BUS_CTRL_1, HS-CAN and LIN1 control.
#define TLE927X_REG_BUS_CTRL_2   0x05U
 BUS_CTRL_2, LIN2 control.
#define TLE927X_REG_WK_CTRL_1   0x06U
 WK_CTRL_1, wake input control.
#define TLE927X_REG_WK_CTRL_2   0x07U
 WK_CTRL_2, wake source control.

Status registers

#define TLE927X_REG_SUP_STAT   0x41U
 SUP_STAT, supply voltage fail status.
#define TLE927X_REG_THERM_STAT   0x42U
 THERM_STAT, thermal protection status.
#define TLE927X_REG_DEV_STAT   0x43U
 DEV_STAT, device information status.
#define TLE927X_REG_BUS_STAT_1   0x44U
 BUS_STAT_1, HS-CAN and LIN1 failure status.
#define TLE927X_REG_BUS_STAT_2   0x45U
 BUS_STAT_2, LIN2 failure status.
#define TLE927X_REG_WK_STAT_1   0x46U
 WK_STAT_1, wake source status.
#define TLE927X_REG_WK_STAT_2   0x47U
 WK_STAT_2, LIN wake source status.
#define TLE927X_REG_SMPS_STAT   0x4CU
 SMPS_STAT, buck and boost regulator status.

M_S_CTRL fields

#define TLE927X_MS_CTRL_MODE_MASK   GENMASK(7, 6)
 SBC mode, see enum tle927x_mode.
#define TLE927X_MS_CTRL_VCC2_ON_MASK   GENMASK(4, 3)
 SBC modes in which VCC2 is on.
#define TLE927X_MS_CTRL_VCC1_OV_RST_MASK   BIT(2)
 Reset on VCC1 overvoltage.
#define TLE927X_MS_CTRL_VCC1_RT_MASK   GENMASK(1, 0)
 VCC1 undervoltage reset threshold.

M_S_CTRL.VCC2_ON values

#define TLE927X_VCC2_ON_OFF   0x0U
 VCC2 off.
#define TLE927X_VCC2_ON_NORMAL   0x1U
 VCC2 on in Normal mode.
#define TLE927X_VCC2_ON_NORMAL_STOP   0x2U
 VCC2 on in Normal and Stop mode.
#define TLE927X_VCC2_ON_ALL_MODES   0x3U
 VCC2 always on, Sleep mode included.

M_S_CTRL.VCC1_RT values

#define TLE927X_VCC1_RT_VRT1   0x0U
 Vrt1, the highest threshold.
#define TLE927X_VCC1_RT_VRT2   0x1U
 Vrt2.
#define TLE927X_VCC1_RT_VRT3   0x2U
 Vrt3.
#define TLE927X_VCC1_RT_DISABLED   0x3U
 VCC1 undervoltage reset disabled.

HW_CTRL fields

#define TLE927X_HW_CTRL_FSI_FO2_MASK   BIT(7)
 Fail-safe input disabled, pin used as FO2.
#define TLE927X_HW_CTRL_FO_ON   BIT(5)
 Failure outputs activated by software.

WD_CTRL fields

#define TLE927X_WD_CTRL_CHECKSUM   BIT(7)
 Checksum, bits 7 to 0 must sum to even.
#define TLE927X_WD_CTRL_WD_STM_EN_0   BIT(6)
 Watchdog deactivation in Stop mode, bit 0.
#define TLE927X_WD_CTRL_WD_WIN   BIT(5)
 Window watchdog enabled.
#define TLE927X_WD_CTRL_WD_EN_WK_BUS   BIT(4)
 Watchdog restart on a bus wake in Stop mode.
#define TLE927X_WD_CTRL_MAX_3_RST   BIT(3)
 Fail-Safe mode after 3 watchdog resets.
#define TLE927X_WD_CTRL_WD_TIMER   GENMASK(2, 0)
 Watchdog timer period.

BUS_CTRL_1 fields

#define TLE927X_BUS_CTRL_1_LIN1   GENMASK(4, 3)
 LIN1 module mode.
#define TLE927X_BUS_CTRL_1_CAN_MASK   GENMASK(1, 0)
 HS-CAN module mode.

BUS_CTRL_1.CAN values

#define TLE927X_CAN_OFF   0x0U
 HS-CAN off.
#define TLE927X_CAN_WAKE_CAPABLE   0x1U
 HS-CAN off, wake capable.
#define TLE927X_CAN_RECEIVE_ONLY   0x2U
 HS-CAN receive only.
#define TLE927X_CAN_NORMAL   0x3U
 HS-CAN normal mode.

WK_CTRL_2 fields

#define TLE927X_WK_CTRL_2_WK_EN   BIT(0)
 WK pin enabled as wake source.

SUP_STAT fields

#define TLE927X_SUP_STAT_POR   BIT(7)
 Power-on reset detected.
#define TLE927X_SUP_STAT_VLIN_UV   BIT(6)
 VLIN undervoltage detected.
#define TLE927X_SUP_STAT_VCC1_OV   BIT(5)
 VCC1 overvoltage detected.
#define TLE927X_SUP_STAT_VCC2_OT   BIT(4)
 VCC2 overtemperature detected.
#define TLE927X_SUP_STAT_VCC2_UV   BIT(3)
 VCC2 undervoltage detected.
#define TLE927X_SUP_STAT_VCC1_SC   BIT(2)
 VCC1 short to GND detected.
#define TLE927X_SUP_STAT_VCC1_UV   BIT(0)
 VCC1 undervoltage detected.

THERM_STAT fields

#define TLE927X_THERM_STAT_TSD2   BIT(2)
 TSD2 thermal shutdown detected.
#define TLE927X_THERM_STAT_TSD1   BIT(1)
 TSD1 thermal shutdown detected.
#define TLE927X_THERM_STAT_TPW   BIT(0)
 Thermal prewarning detected.

DEV_STAT fields

#define TLE927X_DEV_STAT_PREV   GENMASK(7, 6)
 Device status before Restart mode.
#define TLE927X_DEV_STAT_RO_CL_HIGH   BIT(5)
 RO pin detected clamped high.
#define TLE927X_DEV_STAT_FSI_FAIL   BIT(4)
 Fail-safe input failure detected.
#define TLE927X_DEV_STAT_WD_FAIL   GENMASK(3, 2)
 Number of watchdog failures.
#define TLE927X_DEV_STAT_SPI_FAIL   BIT(1)
 SPI failure detected.
#define TLE927X_DEV_STAT_FO_ON_STATE   BIT(0)
 Failure outputs activated.

DEV_STAT.PREV values, the device status before Restart mode

#define TLE927X_PREV_CLEARED   0x0U
 Cleared, no Restart mode since the last clear.
#define TLE927X_PREV_RESTART_FAILURE   0x1U
 Restart after a failure or a Fail-Safe wake.
#define TLE927X_PREV_WAKE_FROM_SLEEP   0x2U
 Wake from Sleep mode.

BUS_STAT_1 fields

#define TLE927X_BUS_STAT_1_CAN_FAIL   GENMASK(2, 1)
 HS-CAN failure status.
#define TLE927X_BUS_STAT_1_VCAN_UV   BIT(0)
 VCAN undervoltage detected.

WK_STAT_1 fields

#define TLE927X_WK_STAT_1_PFM_PWM   BIT(7)
 Automatic PFM to PWM transition detected.
#define TLE927X_WK_STAT_1_CAN_WU   BIT(5)
 Wake up via HS-CAN.
#define TLE927X_WK_STAT_1_TIMER_WU   BIT(4)
 Wake up via timer.
#define TLE927X_WK_STAT_1_WK_WU   BIT(0)
 Wake up via the WK pin.

WK_STAT_2 fields

#define TLE927X_WK_STAT_2_LIN2_WU   BIT(1)
 Wake up via LIN2.
#define TLE927X_WK_STAT_2_LIN1_WU   BIT(0)
 Wake up via LIN1.

Detailed Description

Macro Definition Documentation

◆ TLE927X_BUS_CTRL_1_CAN_MASK

#define TLE927X_BUS_CTRL_1_CAN_MASK   GENMASK(1, 0)

#include <zephyr/drivers/mfd/tle927x.h>

HS-CAN module mode.

◆ TLE927X_BUS_CTRL_1_LIN1

#define TLE927X_BUS_CTRL_1_LIN1   GENMASK(4, 3)

#include <zephyr/drivers/mfd/tle927x.h>

LIN1 module mode.

◆ TLE927X_BUS_STAT_1_CAN_FAIL

#define TLE927X_BUS_STAT_1_CAN_FAIL   GENMASK(2, 1)

#include <zephyr/drivers/mfd/tle927x.h>

HS-CAN failure status.

◆ TLE927X_BUS_STAT_1_VCAN_UV

#define TLE927X_BUS_STAT_1_VCAN_UV   BIT(0)

#include <zephyr/drivers/mfd/tle927x.h>

VCAN undervoltage detected.

◆ TLE927X_CAN_NORMAL

#define TLE927X_CAN_NORMAL   0x3U

#include <zephyr/drivers/mfd/tle927x.h>

HS-CAN normal mode.

◆ TLE927X_CAN_OFF

#define TLE927X_CAN_OFF   0x0U

#include <zephyr/drivers/mfd/tle927x.h>

HS-CAN off.

◆ TLE927X_CAN_RECEIVE_ONLY

#define TLE927X_CAN_RECEIVE_ONLY   0x2U

#include <zephyr/drivers/mfd/tle927x.h>

HS-CAN receive only.

◆ TLE927X_CAN_WAKE_CAPABLE

#define TLE927X_CAN_WAKE_CAPABLE   0x1U

#include <zephyr/drivers/mfd/tle927x.h>

HS-CAN off, wake capable.

◆ TLE927X_DEV_STAT_FO_ON_STATE

#define TLE927X_DEV_STAT_FO_ON_STATE   BIT(0)

#include <zephyr/drivers/mfd/tle927x.h>

Failure outputs activated.

◆ TLE927X_DEV_STAT_FSI_FAIL

#define TLE927X_DEV_STAT_FSI_FAIL   BIT(4)

#include <zephyr/drivers/mfd/tle927x.h>

Fail-safe input failure detected.

◆ TLE927X_DEV_STAT_PREV

#define TLE927X_DEV_STAT_PREV   GENMASK(7, 6)

#include <zephyr/drivers/mfd/tle927x.h>

Device status before Restart mode.

◆ TLE927X_DEV_STAT_RO_CL_HIGH

#define TLE927X_DEV_STAT_RO_CL_HIGH   BIT(5)

#include <zephyr/drivers/mfd/tle927x.h>

RO pin detected clamped high.

◆ TLE927X_DEV_STAT_SPI_FAIL

#define TLE927X_DEV_STAT_SPI_FAIL   BIT(1)

#include <zephyr/drivers/mfd/tle927x.h>

SPI failure detected.

◆ TLE927X_DEV_STAT_WD_FAIL

#define TLE927X_DEV_STAT_WD_FAIL   GENMASK(3, 2)

#include <zephyr/drivers/mfd/tle927x.h>

Number of watchdog failures.

◆ TLE927X_HW_CTRL_FO_ON

#define TLE927X_HW_CTRL_FO_ON   BIT(5)

#include <zephyr/drivers/mfd/tle927x.h>

Failure outputs activated by software.

◆ TLE927X_HW_CTRL_FSI_FO2_MASK

#define TLE927X_HW_CTRL_FSI_FO2_MASK   BIT(7)

#include <zephyr/drivers/mfd/tle927x.h>

Fail-safe input disabled, pin used as FO2.

◆ TLE927X_MS_CTRL_MODE_MASK

#define TLE927X_MS_CTRL_MODE_MASK   GENMASK(7, 6)

#include <zephyr/drivers/mfd/tle927x.h>

SBC mode, see enum tle927x_mode.

◆ TLE927X_MS_CTRL_VCC1_OV_RST_MASK

#define TLE927X_MS_CTRL_VCC1_OV_RST_MASK   BIT(2)

#include <zephyr/drivers/mfd/tle927x.h>

Reset on VCC1 overvoltage.

◆ TLE927X_MS_CTRL_VCC1_RT_MASK

#define TLE927X_MS_CTRL_VCC1_RT_MASK   GENMASK(1, 0)

#include <zephyr/drivers/mfd/tle927x.h>

VCC1 undervoltage reset threshold.

◆ TLE927X_MS_CTRL_VCC2_ON_MASK

#define TLE927X_MS_CTRL_VCC2_ON_MASK   GENMASK(4, 3)

#include <zephyr/drivers/mfd/tle927x.h>

SBC modes in which VCC2 is on.

◆ TLE927X_PREV_CLEARED

#define TLE927X_PREV_CLEARED   0x0U

#include <zephyr/drivers/mfd/tle927x.h>

Cleared, no Restart mode since the last clear.

◆ TLE927X_PREV_RESTART_FAILURE

#define TLE927X_PREV_RESTART_FAILURE   0x1U

#include <zephyr/drivers/mfd/tle927x.h>

Restart after a failure or a Fail-Safe wake.

◆ TLE927X_PREV_WAKE_FROM_SLEEP

#define TLE927X_PREV_WAKE_FROM_SLEEP   0x2U

#include <zephyr/drivers/mfd/tle927x.h>

Wake from Sleep mode.

◆ TLE927X_REG_BUS_CTRL_1

#define TLE927X_REG_BUS_CTRL_1   0x04U

#include <zephyr/drivers/mfd/tle927x.h>

BUS_CTRL_1, HS-CAN and LIN1 control.

◆ TLE927X_REG_BUS_CTRL_2

#define TLE927X_REG_BUS_CTRL_2   0x05U

#include <zephyr/drivers/mfd/tle927x.h>

BUS_CTRL_2, LIN2 control.

◆ TLE927X_REG_BUS_STAT_1

#define TLE927X_REG_BUS_STAT_1   0x44U

#include <zephyr/drivers/mfd/tle927x.h>

BUS_STAT_1, HS-CAN and LIN1 failure status.

◆ TLE927X_REG_BUS_STAT_2

#define TLE927X_REG_BUS_STAT_2   0x45U

#include <zephyr/drivers/mfd/tle927x.h>

BUS_STAT_2, LIN2 failure status.

◆ TLE927X_REG_DEV_STAT

#define TLE927X_REG_DEV_STAT   0x43U

#include <zephyr/drivers/mfd/tle927x.h>

DEV_STAT, device information status.

◆ TLE927X_REG_HW_CTRL

#define TLE927X_REG_HW_CTRL   0x02U

#include <zephyr/drivers/mfd/tle927x.h>

HW_CTRL, hardware control.

◆ TLE927X_REG_MS_CTRL

#define TLE927X_REG_MS_CTRL   0x01U

#include <zephyr/drivers/mfd/tle927x.h>

M_S_CTRL, mode and supply control.

◆ TLE927X_REG_SMPS_STAT

#define TLE927X_REG_SMPS_STAT   0x4CU

#include <zephyr/drivers/mfd/tle927x.h>

SMPS_STAT, buck and boost regulator status.

◆ TLE927X_REG_SUP_STAT

#define TLE927X_REG_SUP_STAT   0x41U

#include <zephyr/drivers/mfd/tle927x.h>

SUP_STAT, supply voltage fail status.

◆ TLE927X_REG_THERM_STAT

#define TLE927X_REG_THERM_STAT   0x42U

#include <zephyr/drivers/mfd/tle927x.h>

THERM_STAT, thermal protection status.

◆ TLE927X_REG_WD_CTRL

#define TLE927X_REG_WD_CTRL   0x03U

#include <zephyr/drivers/mfd/tle927x.h>

WD_CTRL, watchdog control.

◆ TLE927X_REG_WK_CTRL_1

#define TLE927X_REG_WK_CTRL_1   0x06U

#include <zephyr/drivers/mfd/tle927x.h>

WK_CTRL_1, wake input control.

◆ TLE927X_REG_WK_CTRL_2

#define TLE927X_REG_WK_CTRL_2   0x07U

#include <zephyr/drivers/mfd/tle927x.h>

WK_CTRL_2, wake source control.

◆ TLE927X_REG_WK_STAT_1

#define TLE927X_REG_WK_STAT_1   0x46U

#include <zephyr/drivers/mfd/tle927x.h>

WK_STAT_1, wake source status.

◆ TLE927X_REG_WK_STAT_2

#define TLE927X_REG_WK_STAT_2   0x47U

#include <zephyr/drivers/mfd/tle927x.h>

WK_STAT_2, LIN wake source status.

◆ TLE927X_SUP_STAT_POR

#define TLE927X_SUP_STAT_POR   BIT(7)

#include <zephyr/drivers/mfd/tle927x.h>

Power-on reset detected.

◆ TLE927X_SUP_STAT_VCC1_OV

#define TLE927X_SUP_STAT_VCC1_OV   BIT(5)

#include <zephyr/drivers/mfd/tle927x.h>

VCC1 overvoltage detected.

◆ TLE927X_SUP_STAT_VCC1_SC

#define TLE927X_SUP_STAT_VCC1_SC   BIT(2)

#include <zephyr/drivers/mfd/tle927x.h>

VCC1 short to GND detected.

◆ TLE927X_SUP_STAT_VCC1_UV

#define TLE927X_SUP_STAT_VCC1_UV   BIT(0)

#include <zephyr/drivers/mfd/tle927x.h>

VCC1 undervoltage detected.

◆ TLE927X_SUP_STAT_VCC2_OT

#define TLE927X_SUP_STAT_VCC2_OT   BIT(4)

#include <zephyr/drivers/mfd/tle927x.h>

VCC2 overtemperature detected.

◆ TLE927X_SUP_STAT_VCC2_UV

#define TLE927X_SUP_STAT_VCC2_UV   BIT(3)

#include <zephyr/drivers/mfd/tle927x.h>

VCC2 undervoltage detected.

◆ TLE927X_SUP_STAT_VLIN_UV

#define TLE927X_SUP_STAT_VLIN_UV   BIT(6)

#include <zephyr/drivers/mfd/tle927x.h>

VLIN undervoltage detected.

◆ TLE927X_THERM_STAT_TPW

#define TLE927X_THERM_STAT_TPW   BIT(0)

#include <zephyr/drivers/mfd/tle927x.h>

Thermal prewarning detected.

◆ TLE927X_THERM_STAT_TSD1

#define TLE927X_THERM_STAT_TSD1   BIT(1)

#include <zephyr/drivers/mfd/tle927x.h>

TSD1 thermal shutdown detected.

◆ TLE927X_THERM_STAT_TSD2

#define TLE927X_THERM_STAT_TSD2   BIT(2)

#include <zephyr/drivers/mfd/tle927x.h>

TSD2 thermal shutdown detected.

◆ TLE927X_VCC1_RT_DISABLED

#define TLE927X_VCC1_RT_DISABLED   0x3U

#include <zephyr/drivers/mfd/tle927x.h>

VCC1 undervoltage reset disabled.

◆ TLE927X_VCC1_RT_VRT1

#define TLE927X_VCC1_RT_VRT1   0x0U

#include <zephyr/drivers/mfd/tle927x.h>

Vrt1, the highest threshold.

◆ TLE927X_VCC1_RT_VRT2

#define TLE927X_VCC1_RT_VRT2   0x1U

#include <zephyr/drivers/mfd/tle927x.h>

Vrt2.

◆ TLE927X_VCC1_RT_VRT3

#define TLE927X_VCC1_RT_VRT3   0x2U

#include <zephyr/drivers/mfd/tle927x.h>

Vrt3.

◆ TLE927X_VCC2_ON_ALL_MODES

#define TLE927X_VCC2_ON_ALL_MODES   0x3U

#include <zephyr/drivers/mfd/tle927x.h>

VCC2 always on, Sleep mode included.

◆ TLE927X_VCC2_ON_NORMAL

#define TLE927X_VCC2_ON_NORMAL   0x1U

#include <zephyr/drivers/mfd/tle927x.h>

VCC2 on in Normal mode.

◆ TLE927X_VCC2_ON_NORMAL_STOP

#define TLE927X_VCC2_ON_NORMAL_STOP   0x2U

#include <zephyr/drivers/mfd/tle927x.h>

VCC2 on in Normal and Stop mode.

◆ TLE927X_VCC2_ON_OFF

#define TLE927X_VCC2_ON_OFF   0x0U

#include <zephyr/drivers/mfd/tle927x.h>

VCC2 off.

◆ TLE927X_WD_CTRL_CHECKSUM

#define TLE927X_WD_CTRL_CHECKSUM   BIT(7)

#include <zephyr/drivers/mfd/tle927x.h>

Checksum, bits 7 to 0 must sum to even.

◆ TLE927X_WD_CTRL_MAX_3_RST

#define TLE927X_WD_CTRL_MAX_3_RST   BIT(3)

#include <zephyr/drivers/mfd/tle927x.h>

Fail-Safe mode after 3 watchdog resets.

◆ TLE927X_WD_CTRL_WD_EN_WK_BUS

#define TLE927X_WD_CTRL_WD_EN_WK_BUS   BIT(4)

#include <zephyr/drivers/mfd/tle927x.h>

Watchdog restart on a bus wake in Stop mode.

◆ TLE927X_WD_CTRL_WD_STM_EN_0

#define TLE927X_WD_CTRL_WD_STM_EN_0   BIT(6)

#include <zephyr/drivers/mfd/tle927x.h>

Watchdog deactivation in Stop mode, bit 0.

◆ TLE927X_WD_CTRL_WD_TIMER

#define TLE927X_WD_CTRL_WD_TIMER   GENMASK(2, 0)

#include <zephyr/drivers/mfd/tle927x.h>

Watchdog timer period.

◆ TLE927X_WD_CTRL_WD_WIN

#define TLE927X_WD_CTRL_WD_WIN   BIT(5)

#include <zephyr/drivers/mfd/tle927x.h>

Window watchdog enabled.

◆ TLE927X_WK_CTRL_2_WK_EN

#define TLE927X_WK_CTRL_2_WK_EN   BIT(0)

#include <zephyr/drivers/mfd/tle927x.h>

WK pin enabled as wake source.

◆ TLE927X_WK_STAT_1_CAN_WU

#define TLE927X_WK_STAT_1_CAN_WU   BIT(5)

#include <zephyr/drivers/mfd/tle927x.h>

Wake up via HS-CAN.

◆ TLE927X_WK_STAT_1_PFM_PWM

#define TLE927X_WK_STAT_1_PFM_PWM   BIT(7)

#include <zephyr/drivers/mfd/tle927x.h>

Automatic PFM to PWM transition detected.

◆ TLE927X_WK_STAT_1_TIMER_WU

#define TLE927X_WK_STAT_1_TIMER_WU   BIT(4)

#include <zephyr/drivers/mfd/tle927x.h>

Wake up via timer.

◆ TLE927X_WK_STAT_1_WK_WU

#define TLE927X_WK_STAT_1_WK_WU   BIT(0)

#include <zephyr/drivers/mfd/tle927x.h>

Wake up via the WK pin.

◆ TLE927X_WK_STAT_2_LIN1_WU

#define TLE927X_WK_STAT_2_LIN1_WU   BIT(0)

#include <zephyr/drivers/mfd/tle927x.h>

Wake up via LIN1.

◆ TLE927X_WK_STAT_2_LIN2_WU

#define TLE927X_WK_STAT_2_LIN2_WU   BIT(1)

#include <zephyr/drivers/mfd/tle927x.h>

Wake up via LIN2.

Enumeration Type Documentation

◆ tle927x_mode

#include <zephyr/drivers/mfd/tle927x.h>

SBC operating modes selectable over SPI.

The values are the M_S_CTRL.MODE field encoding.

Enumerator
TLE927X_MODE_NORMAL 

All functions available, watchdog running.

TLE927X_MODE_SLEEP 

VCC1 off, wake through CAN, LIN or WK only.

TLE927X_MODE_STOP 

VCC1 on, configuration frozen, restricted SPI command set.

Function Documentation

◆ mfd_tle927x_get_mode()

int mfd_tle927x_get_mode ( const struct device * dev,
enum tle927x_mode * mode )

#include <zephyr/drivers/mfd/tle927x.h>

Get the current SBC mode.

Parameters
devTLE927x MFD device instance
modeDestination for the current SBC mode
Return values
0If successful.
-EINVALIf mode is NULL.

◆ mfd_tle927x_read_faults()

int mfd_tle927x_read_faults ( const struct device * dev,
uint8_t * sup,
uint8_t * therm,
uint8_t * dev_stat )

#include <zephyr/drivers/mfd/tle927x.h>

Read the global fault status, leaving the registers latched.

Parameters
devTLE927x MFD device instance
supDestination for SUP_STAT, may be NULL
thermDestination for THERM_STAT, may be NULL
dev_statDestination for DEV_STAT, may be NULL
Return values
0If successful.
-errnoNegative errno from the SPI bus.

◆ mfd_tle927x_read_reg()

int mfd_tle927x_read_reg ( const struct device * dev,
uint8_t reg,
uint8_t * val )

#include <zephyr/drivers/mfd/tle927x.h>

Read a TLE927x register.

Parameters
devTLE927x MFD device instance
regRegister address
valDestination for the register value
Return values
0If successful.
-EINVALIf val is NULL or reg is not a valid register address.
-errnoNegative errno from the SPI bus.

◆ mfd_tle927x_set_mode()

int mfd_tle927x_set_mode ( const struct device * dev,
enum tle927x_mode mode )

#include <zephyr/drivers/mfd/tle927x.h>

Request an SBC mode transition.

Sleep is not supported: it switches VCC1 off, and on a board without a usable wake source the SBC cannot be recovered without removing VS.

Parameters
devTLE927x MFD device instance
modeRequested SBC mode
Return values
0If successful.
-ENOTSUPIf mode is Sleep.
-EINVALIf mode is unknown.
-EIOIf the SBC rejected the transition.
-errnoNegative errno from the SPI bus.

◆ mfd_tle927x_update_reg()

int mfd_tle927x_update_reg ( const struct device * dev,
uint8_t reg,
uint8_t mask,
uint8_t val )

#include <zephyr/drivers/mfd/tle927x.h>

Read-modify-write a TLE927x control register, atomically.

Parameters
devTLE927x MFD device instance
regRegister address
maskBits to modify
valNew value for the bits selected by mask
Return values
0If successful.
-EINVALIf reg is WD_CTRL or a status register.
-EBUSYIf the SBC is not in Normal mode.
-errnoNegative errno from the SPI bus.

◆ mfd_tle927x_write_reg()

int mfd_tle927x_write_reg ( const struct device * dev,
uint8_t reg,
uint8_t val )

#include <zephyr/drivers/mfd/tle927x.h>

Write a TLE927x register, writing a status register clears it.

Control registers other than WD_CTRL are writable in Normal mode only. WD_CTRL may be written in any mode, so the watchdog can be triggered in Stop mode. Status registers may be cleared in any mode.

Parameters
devTLE927x MFD device instance
regRegister address
valValue to write
Return values
0If successful.
-EINVALIf reg is not a valid register address.
-EBUSYIf reg is a control register other than WD_CTRL and the SBC is not in Normal mode.
-errnoNegative errno from the SPI bus.