Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
tcpci_priv.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 Google LLC
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
15#ifndef ZEPHYR_INCLUDE_DRIVERS_USBC_TCPCI_PRIV_H_
16#define ZEPHYR_INCLUDE_DRIVERS_USBC_TCPCI_PRIV_H_
17
18#include <stdint.h>
19#include <zephyr/drivers/i2c.h>
20#include <zephyr/usb_c/usbc.h>
21
33
35#define TCPCI_STD_REGS_SIZE 38
43
52int tcpci_read_reg8(const struct i2c_dt_spec *bus, uint8_t reg, uint8_t *value);
53
62int tcpci_write_reg8(const struct i2c_dt_spec *bus, uint8_t reg, uint8_t value);
63
74int tcpci_update_reg8(const struct i2c_dt_spec *bus, uint8_t reg, uint8_t mask, uint8_t value);
75
84int tcpci_read_reg16(const struct i2c_dt_spec *bus, uint8_t reg, uint16_t *value);
85
94int tcpci_write_reg16(const struct i2c_dt_spec *bus, uint8_t reg, uint16_t value);
95
105
116int tcpci_tcpm_get_cc(const struct i2c_dt_spec *bus, enum tc_cc_voltage_state *cc1,
117 enum tc_cc_voltage_state *cc2);
118
119#endif /* ZEPHYR_INCLUDE_DRIVERS_USBC_TCPCI_PRIV_H_ */
Public APIs for the I2C drivers.
tcpc_alert
TCPC Alert bits.
Definition usbc_tcpc.h:41
tc_cc_voltage_state
CC Voltage status.
Definition usbc_tc.h:308
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Complete I2C DT information.
Definition i2c.h:77
Structure used to bind the register address to name in registers dump.
Definition tcpci_priv.h:25
const char * name
Human readable name of register.
Definition tcpci_priv.h:29
uint8_t size
Size in bytes of the register.
Definition tcpci_priv.h:31
uint8_t addr
Address of I2C device register.
Definition tcpci_priv.h:27
int tcpci_read_reg16(const struct i2c_dt_spec *bus, uint8_t reg, uint16_t *value)
Function to read the 16-bit register of TCPCI device.
#define TCPCI_STD_REGS_SIZE
Size of the array containing the standard registers used by tcpci dump command.
Definition tcpci_priv.h:35
int tcpci_update_reg8(const struct i2c_dt_spec *bus, uint8_t reg, uint8_t mask, uint8_t value)
Function to read and update part of the 8-bit register of TCPCI device The function is NOT performing...
int tcpci_write_reg16(const struct i2c_dt_spec *bus, uint8_t reg, uint16_t value)
Function to write a value to the 16-bit register of TCPCI device.
int tcpci_read_reg8(const struct i2c_dt_spec *bus, uint8_t reg, uint8_t *value)
Function to read the 8-bit register of TCPCI device.
const struct tcpci_reg_dump_map tcpci_std_regs[38]
Array containing the standard TCPCI registers list.
enum tcpc_alert tcpci_alert_reg_to_enum(uint16_t reg)
Function that converts the TCPCI alert register to the tcpc_alert enum The hard reset value takes pri...
int tcpci_write_reg8(const struct i2c_dt_spec *bus, uint8_t reg, uint8_t value)
Function to write a value to the 8-bit register of TCPCI device.
int tcpci_tcpm_get_cc(const struct i2c_dt_spec *bus, enum tc_cc_voltage_state *cc1, enum tc_cc_voltage_state *cc2)
Function that reads the CC status registers and converts read values to enums representing voltages s...
USB-C Device APIs.