Lines Matching full:i2c
9 #include <zephyr/drivers/i2c.h>
33 struct i2c_dt_spec i2c; member
36 static int is31fl3216a_write_buffer(const struct i2c_dt_spec *i2c, in is31fl3216a_write_buffer() argument
41 status = i2c_write_dt(i2c, buffer, num_bytes); in is31fl3216a_write_buffer()
50 static int is31fl3216a_write_reg(const struct i2c_dt_spec *i2c, uint8_t reg, in is31fl3216a_write_reg() argument
55 return is31fl3216a_write_buffer(i2c, buffer, sizeof(buffer)); in is31fl3216a_write_reg()
58 static int is31fl3216a_update_pwm(const struct i2c_dt_spec *i2c) in is31fl3216a_update_pwm() argument
60 return is31fl3216a_write_reg(i2c, IS31FL3216A_REG_UPDATE, 0); in is31fl3216a_update_pwm()
97 status = is31fl3216a_write_buffer(&config->i2c, i2c_buffer, in is31fl3216a_led_write_channels()
103 return is31fl3216a_update_pwm(&config->i2c); in is31fl3216a_led_write_channels()
119 status = is31fl3216a_write_reg(&config->i2c, pwm_reg, pwm_value); in is31fl3216a_led_set_brightness()
124 return is31fl3216a_update_pwm(&config->i2c); in is31fl3216a_led_set_brightness()
137 static int is31fl3216a_init_registers(const struct i2c_dt_spec *i2c) in is31fl3216a_init_registers() argument
142 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_CTL_1, 0xFF); in is31fl3216a_init_registers()
147 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_CTL_2, 0xFF); in is31fl3216a_init_registers()
152 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_LIGHT_EFFECT, 0x00); in is31fl3216a_init_registers()
157 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_CHANNEL_CONFIG, in is31fl3216a_init_registers()
163 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_GPIO_CONFIG, 0x00); in is31fl3216a_init_registers()
168 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_OUTPUT_PORT, 0x00); in is31fl3216a_init_registers()
173 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_INT_CONTROL, 0x00); in is31fl3216a_init_registers()
178 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_ADC_SAMPLE_RATE, in is31fl3216a_init_registers()
184 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_FRAME_DELAY, 0x00); in is31fl3216a_init_registers()
189 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_FRAME_START, 0x00); in is31fl3216a_init_registers()
197 status = is31fl3216a_write_reg(i2c, i, 0); in is31fl3216a_init_registers()
203 status = is31fl3216a_write_reg(i2c, IS31FL3216A_REG_UPDATE, 0); in is31fl3216a_init_registers()
208 return is31fl3216a_write_reg(i2c, IS31FL3216A_REG_CONFIG, 0x00); in is31fl3216a_init_registers()
215 LOG_DBG("Initializing @0x%x...", config->i2c.addr); in is31fl3216a_init()
217 if (!i2c_is_ready_dt(&config->i2c)) { in is31fl3216a_init()
218 LOG_ERR("I2C device not ready"); in is31fl3216a_init()
222 return is31fl3216a_init_registers(&config->i2c); in is31fl3216a_init()
234 .i2c = I2C_DT_SPEC_INST_GET(id), \