Lines Matching +full:0 +full:x00 +full:- +full:positive

1 /* sensor_sx9500.c - Driver for Semtech SX9500 SAR proximity chip */
6 * SPDX-License-Identifier: Apache-2.0
28 * auto-increments the address for subsequent values in a single
33 0x43, /* Shield enabled, small range. */
34 0x77, /* x8 gain, 167kHz frequency, finest resolution. */
35 0x40, /* Doze enabled, 2x scan period doze, no raw filter. */
36 0x30, /* Average threshold. */
37 0x0f, /* Debouncer off, lowest average negative filter,
38 * highest average positive filter.
40 0x0e, /* Proximity detection threshold: 280 */
41 0x00, /* No automatic compensation, compensate each pin
45 0x00, /* No stuck timeout, no periodic compensation. */
51 struct sx9500_data *data = dev->data; in sx9500_sample_fetch()
52 const struct sx9500_config *cfg = dev->config; in sx9500_sample_fetch()
56 return i2c_reg_read_byte_dt(&cfg->i2c, SX9500_REG_STAT, &data->prox_stat); in sx9500_sample_fetch()
63 struct sx9500_data *data = (struct sx9500_data *) dev->data; in sx9500_channel_get()
68 return -ENOTSUP; in sx9500_channel_get()
71 val->val1 = !!(data->prox_stat & in sx9500_channel_get()
73 val->val2 = 0; in sx9500_channel_get()
75 return 0; in sx9500_channel_get()
88 const struct sx9500_config *cfg = dev->config; in sx9500_init_chip()
91 if (i2c_write_dt(&cfg->i2c, sx9500_reg_defaults, in sx9500_init_chip()
93 < 0) { in sx9500_init_chip()
94 return -EIO; in sx9500_init_chip()
100 if (i2c_reg_write_byte_dt(&cfg->i2c, SX9500_REG_IRQ_MSK, 0) < 0) { in sx9500_init_chip()
101 return -EIO; in sx9500_init_chip()
105 if (i2c_reg_read_byte_dt(&cfg->i2c, SX9500_REG_IRQ_SRC, &val) < 0) { in sx9500_init_chip()
106 return -EIO; in sx9500_init_chip()
109 return i2c_reg_write_byte_dt(&cfg->i2c, SX9500_REG_PROX_CTRL0, in sx9500_init_chip()
115 const struct sx9500_config *cfg = dev->config; in sx9500_init()
117 if (!device_is_ready(cfg->i2c.bus)) { in sx9500_init()
119 return -ENODEV; in sx9500_init()
122 if (sx9500_init_chip(dev) < 0) { in sx9500_init()
124 return -EINVAL; in sx9500_init()
128 if (cfg->int_gpio.port) { in sx9500_init()
129 if (sx9500_setup_interrupt(dev) < 0) { in sx9500_init()
131 return -EINVAL; in sx9500_init()
136 return 0; in sx9500_init()
145 (.int_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, int_gpios, { 0 }),)) \