Lines Matching +full:invert +full:- +full:x
4 * SPDX-License-Identifier: Apache-2.0
39 /* See PCA9585 datasheet Rev. 4 - 16 April 2015 section 7.3.5 */
91 const struct pca9685_config *config = dev->config; in set_reg()
95 ret = i2c_write_dt(&config->i2c, buf, sizeof(buf)); in set_reg()
97 LOG_ERR("I2C write [0x%02X]=0x%02X: %d", addr, value, ret); in set_reg()
99 LOG_DBG("[0x%02X]=0x%02X", addr, value); in set_reg()
106 const struct pca9685_config *config = dev->config; in get_reg()
109 ret = i2c_write_read_dt(&config->i2c, &addr, sizeof(addr), value, in get_reg()
112 LOG_ERR("I2C write [0x%02X]=0x%02X: %d", addr, *value, ret); in get_reg()
119 struct pca9685_data *data = dev->data; in set_pre_scale()
124 k_mutex_lock(&data->mutex, K_FOREVER); in set_pre_scale()
146 /* Clear SLEEP bit - See datasheet section 7.3.1.1 */ in set_pre_scale()
160 k_mutex_unlock(&data->mutex); in set_pre_scale()
169 const struct pca9685_config *config = dev->config; in pca9685_set_cycles()
170 struct pca9685_data *data = dev->data; in pca9685_set_cycles()
180 return -EINVAL; in pca9685_set_cycles()
183 pre_scale = DIV_ROUND_UP((int64_t)period_count, PWM_STEPS) - 1; in pca9685_set_cycles()
188 return -ENOTSUP; in pca9685_set_cycles()
192 return -ENOTSUP; in pca9685_set_cycles()
195 /* Only one output frequency - simple conversion to equivalent PWM */ in pca9685_set_cycles()
196 if (pre_scale != data->pre_scale) { in pca9685_set_cycles()
197 data->pre_scale = pre_scale; in pca9685_set_cycles()
218 return i2c_write_dt(&config->i2c, buf, sizeof(buf)); in pca9685_set_cycles()
239 const struct pca9685_config *config = dev->config; in pca9685_init()
240 struct pca9685_data *data = dev->data; in pca9685_init()
244 (void)k_mutex_init(&data->mutex); in pca9685_init()
246 if (!i2c_is_ready_dt(&config->i2c)) { in pca9685_init()
248 return -ENODEV; in pca9685_init()
258 if (!config->outdrv_open_drain) { in pca9685_init()
261 if (config->och_on_ack) { in pca9685_init()
278 .invrt = DT_INST_PROP(inst, invert), \