Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mfd_ite_it8801.h File Reference

Go to the source code of this file.

Data Structures

struct  it8801_vendor_id_t
 
struct  it8801_mfd_callback
 

Macros

#define IT8801_REG_GISR   0xf9
 
#define IT8801_REG_MASK_GISR_GKSIIS   BIT(6)
 
#define IT8801_REG_GIECR   0xfb
 
#define IT8801_REG_MASK_GKSIIE   BIT(3)
 
#define IT8801_REG_MASK_GGPIOIE   BIT(2)
 
#define IT8801_REG_LBVIDR   0xfe
 
#define IT8801_REG_HBVIDR   0xff
 
#define IT8801_REG_SMBCR   0xfa
 
#define IT8801_REG_MASK_ARE   BIT(4)
 
#define IT8801_GPIOAFS_FUN1   0x0
 
#define IT8801_GPIOAFS_FUN2   0x01
 
#define IT8801_GPIOAFS_FUN3   0x02
 
#define IT8801_GPIODIR   BIT(5)
 
#define IT8801_GPIOIOT_OD   BIT(4)
 
#define IT8801_GPIOIOT_INT_FALL   BIT(4)
 
#define IT8801_GPIOIOT_INT_RISE   BIT(3)
 
#define IT8801_GPIOPOL   BIT(2)
 
#define IT8801_GPIOPDE   BIT(1)
 
#define IT8801_GPIOPUE   BIT(0)
 
#define IT8801_REG_MASK_KSOSDIC   BIT(7)
 
#define IT8801_REG_MASK_KSE   BIT(6)
 
#define IT8801_REG_MASK_AKSOSC   BIT(5)
 
#define PWM_IT8801_FREQ   32895
 
#define PWM_IT8801_PUSH_PULL   BIT(8)
 
#define IT8801_REG_PWMODDSR   0x5f
 
#define IT8801_PWMMCR_MCR_MASK   GENMASK(1, 0)
 
#define IT8801_PWMMCR_MCR_OFF   0
 
#define IT8801_PWMMCR_MCR_BLINKING   1
 
#define IT8801_PWMMCR_MCR_BREATHING   2
 
#define IT8801_PWMMCR_MCR_ON   3
 
#define IT8801_DT_INST_MFDCTRL(inst, idx)
 
#define IT8801_DT_INST_MFDCTRL_LEN(inst)
 
#define IT8801_DEV_MFD(idx, inst)
 
#define IT8801_DEV_MFD_PIN(idx, inst)
 
#define IT8801_DEV_MFD_FUNC(idx, inst)
 
#define IT8801_DT_MFD_ITEMS_FUNC(idx, inst)
 
#define IT8801_DT_MFD_ITEMS_LIST(inst)
 

Typedefs

typedef void(* it8801_callback_handler_t) (const struct device *dev)
 

Functions

int mfd_it8801_configure_pins (const struct i2c_dt_spec *i2c_dev, const struct device *dev, uint8_t pin, uint8_t func)
 
void mfd_it8801_register_interrupt_callback (const struct device *mfd, struct it8801_mfd_callback *callback)
 

Variables

static const struct it8801_vendor_id_t it8801_id_verify []
 

Macro Definition Documentation

◆ IT8801_DEV_MFD

#define IT8801_DEV_MFD ( idx,
inst )
Value:
#define DEVICE_DT_GET(node_id)
Get a device reference from a devicetree node identifier.
Definition device.h:254
#define DT_PHANDLE(node_id, prop)
Get a node identifier for a phandle property's value.
Definition devicetree.h:1789
#define IT8801_DT_INST_MFDCTRL(inst, idx)
Definition mfd_ite_it8801.h:94

◆ IT8801_DEV_MFD_FUNC

#define IT8801_DEV_MFD_FUNC ( idx,
inst )
Value:
DT_PHA(IT8801_DT_INST_MFDCTRL(inst, idx), altctrls, alt_func)
#define DT_PHA(node_id, pha, cell)
Equivalent to DT_PHA_BY_IDX(node_id, pha, 0, cell)
Definition devicetree.h:1590

◆ IT8801_DEV_MFD_PIN

#define IT8801_DEV_MFD_PIN ( idx,
inst )
Value:
DT_PHA(IT8801_DT_INST_MFDCTRL(inst, idx), altctrls, pin)

◆ IT8801_DT_INST_MFDCTRL

#define IT8801_DT_INST_MFDCTRL ( inst,
idx )
Value:
DT_INST_PHANDLE_BY_IDX(inst, mfdctrl, idx)
#define DT_INST_PHANDLE_BY_IDX(inst, prop, idx)
Get a DT_DRV_COMPAT instance's node identifier for a phandle in a property.
Definition devicetree.h:4386

◆ IT8801_DT_INST_MFDCTRL_LEN

#define IT8801_DT_INST_MFDCTRL_LEN ( inst)
Value:
DT_INST_PROP_LEN_OR(inst, mfdctrl, 0)
#define DT_INST_PROP_LEN_OR(inst, prop, default_value)
Like DT_INST_PROP_LEN(), but with a fallback to default_value.
Definition devicetree.h:4207

◆ IT8801_DT_MFD_ITEMS_FUNC

#define IT8801_DT_MFD_ITEMS_FUNC ( idx,
inst )
Value:
{ \
.gpiocr = IT8801_DEV_MFD(idx, inst), \
.pin = IT8801_DEV_MFD_PIN(idx, inst), \
.alt_func = IT8801_DEV_MFD_FUNC(idx, inst), \
}
#define IT8801_DEV_MFD_FUNC(idx, inst)
Definition mfd_ite_it8801.h:101
#define IT8801_DEV_MFD(idx, inst)
Definition mfd_ite_it8801.h:98
#define IT8801_DEV_MFD_PIN(idx, inst)
Definition mfd_ite_it8801.h:100

◆ IT8801_DT_MFD_ITEMS_LIST

#define IT8801_DT_MFD_ITEMS_LIST ( inst)
Value:
inst) }
#define LISTIFY(LEN, F, sep,...)
Generates a sequence of code with configurable separator.
Definition util_macro.h:470
#define IT8801_DT_INST_MFDCTRL_LEN(inst)
Definition mfd_ite_it8801.h:96
#define IT8801_DT_MFD_ITEMS_FUNC(idx, inst)
Definition mfd_ite_it8801.h:103

◆ IT8801_GPIOAFS_FUN1

#define IT8801_GPIOAFS_FUN1   0x0

◆ IT8801_GPIOAFS_FUN2

#define IT8801_GPIOAFS_FUN2   0x01

◆ IT8801_GPIOAFS_FUN3

#define IT8801_GPIOAFS_FUN3   0x02

◆ IT8801_GPIODIR

#define IT8801_GPIODIR   BIT(5)

◆ IT8801_GPIOIOT_INT_FALL

#define IT8801_GPIOIOT_INT_FALL   BIT(4)

◆ IT8801_GPIOIOT_INT_RISE

#define IT8801_GPIOIOT_INT_RISE   BIT(3)

◆ IT8801_GPIOIOT_OD

#define IT8801_GPIOIOT_OD   BIT(4)

◆ IT8801_GPIOPDE

#define IT8801_GPIOPDE   BIT(1)

◆ IT8801_GPIOPOL

#define IT8801_GPIOPOL   BIT(2)

◆ IT8801_GPIOPUE

#define IT8801_GPIOPUE   BIT(0)

◆ IT8801_PWMMCR_MCR_BLINKING

#define IT8801_PWMMCR_MCR_BLINKING   1

◆ IT8801_PWMMCR_MCR_BREATHING

#define IT8801_PWMMCR_MCR_BREATHING   2

◆ IT8801_PWMMCR_MCR_MASK

#define IT8801_PWMMCR_MCR_MASK   GENMASK(1, 0)

◆ IT8801_PWMMCR_MCR_OFF

#define IT8801_PWMMCR_MCR_OFF   0

◆ IT8801_PWMMCR_MCR_ON

#define IT8801_PWMMCR_MCR_ON   3

◆ IT8801_REG_GIECR

#define IT8801_REG_GIECR   0xfb

◆ IT8801_REG_GISR

#define IT8801_REG_GISR   0xf9

◆ IT8801_REG_HBVIDR

#define IT8801_REG_HBVIDR   0xff

◆ IT8801_REG_LBVIDR

#define IT8801_REG_LBVIDR   0xfe

◆ IT8801_REG_MASK_AKSOSC

#define IT8801_REG_MASK_AKSOSC   BIT(5)

◆ IT8801_REG_MASK_ARE

#define IT8801_REG_MASK_ARE   BIT(4)

◆ IT8801_REG_MASK_GGPIOIE

#define IT8801_REG_MASK_GGPIOIE   BIT(2)

◆ IT8801_REG_MASK_GISR_GKSIIS

#define IT8801_REG_MASK_GISR_GKSIIS   BIT(6)

◆ IT8801_REG_MASK_GKSIIE

#define IT8801_REG_MASK_GKSIIE   BIT(3)

◆ IT8801_REG_MASK_KSE

#define IT8801_REG_MASK_KSE   BIT(6)

◆ IT8801_REG_MASK_KSOSDIC

#define IT8801_REG_MASK_KSOSDIC   BIT(7)

◆ IT8801_REG_PWMODDSR

#define IT8801_REG_PWMODDSR   0x5f

◆ IT8801_REG_SMBCR

#define IT8801_REG_SMBCR   0xfa

◆ PWM_IT8801_FREQ

#define PWM_IT8801_FREQ   32895

◆ PWM_IT8801_PUSH_PULL

#define PWM_IT8801_PUSH_PULL   BIT(8)

Typedef Documentation

◆ it8801_callback_handler_t

typedef void(* it8801_callback_handler_t) (const struct device *dev)

Function Documentation

◆ mfd_it8801_configure_pins()

int mfd_it8801_configure_pins ( const struct i2c_dt_spec * i2c_dev,
const struct device * dev,
uint8_t pin,
uint8_t func )

◆ mfd_it8801_register_interrupt_callback()

void mfd_it8801_register_interrupt_callback ( const struct device * mfd,
struct it8801_mfd_callback * callback )

Variable Documentation

◆ it8801_id_verify

const struct it8801_vendor_id_t it8801_id_verify[]
static
Initial value:
= {
{0x12, 0xff },
{0x83, 0xfe },
}