Home
last modified time | relevance | path

Searched refs:data (Results 1 – 25 of 1574) sorted by relevance

12345678910>>...63

/Zephyr-Core-2.7.6/drivers/modem/
Dmodem_cmd_handler.c37 static void skipcrlf(struct modem_cmd_handler_data *data) in skipcrlf() argument
39 while (data->rx_buf && data->rx_buf->len && in skipcrlf()
40 is_crlf(*data->rx_buf->data)) { in skipcrlf()
41 net_buf_pull_u8(data->rx_buf); in skipcrlf()
42 if (!data->rx_buf->len) { in skipcrlf()
43 data->rx_buf = net_buf_frag_del(NULL, data->rx_buf); in skipcrlf()
48 static uint16_t findcrlf(struct modem_cmd_handler_data *data, in findcrlf() argument
51 struct net_buf *buf = data->rx_buf; in findcrlf()
54 while (buf && buf->len && !is_crlf(*(buf->data + pos))) { in findcrlf()
64 if (buf && buf->len && is_crlf(*(buf->data + pos))) { in findcrlf()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/lis2ds12/
Dlis2ds12_trigger.c25 struct lis2ds12_data *data = in lis2ds12_gpio_callback() local
27 const struct lis2ds12_config *cfg = data->dev->config; in lis2ds12_gpio_callback()
31 gpio_pin_interrupt_configure(data->gpio, cfg->irq_pin, in lis2ds12_gpio_callback()
35 k_sem_give(&data->trig_sem); in lis2ds12_gpio_callback()
37 k_work_submit(&data->work); in lis2ds12_gpio_callback()
43 struct lis2ds12_data *data = dev->data; in lis2ds12_handle_drdy_int() local
45 if (data->data_ready_handler != NULL) { in lis2ds12_handle_drdy_int()
46 data->data_ready_handler(dev, &data->data_ready_trigger); in lis2ds12_handle_drdy_int()
52 struct lis2ds12_data *data = dev->data; in lis2ds12_handle_int() local
56 if (data->hw_tf->read_reg(data, LIS2DS12_REG_STATUS, &status) < 0) { in lis2ds12_handle_int()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/adxl345/
Dadxl345.c23 struct adxl345_dev_data *data = dev->data; in adxl345_read_sample() local
27 int rc = i2c_burst_read(data->i2c_master, in adxl345_read_sample()
28 data->i2c_addr, in adxl345_read_sample()
62 struct adxl345_dev_data *data = dev->data; in adxl345_sample_fetch() local
67 data->sample_number = 0; in adxl345_sample_fetch()
68 rc = i2c_reg_read_byte(data->i2c_master, data->i2c_addr, in adxl345_sample_fetch()
75 __ASSERT_NO_MSG(samples_count <= ARRAY_SIZE(data->bufx)); in adxl345_sample_fetch()
83 data->bufx[s] = sample.x; in adxl345_sample_fetch()
84 data->bufy[s] = sample.y; in adxl345_sample_fetch()
85 data->bufz[s] = sample.z; in adxl345_sample_fetch()
[all …]
/Zephyr-Core-2.7.6/tests/drivers/sensor/generic/src/
Dmain.c22 struct sensor_value data; member
27 struct sensor_value data; member
109 struct sensor_value data; in test_sensor_get_channels() local
119 &data), RETURN_SUCCESS, "fail to get channel."); in test_sensor_get_channels()
120 zassert_equal(data.val1, chan_elements[0].data.val1, in test_sensor_get_channels()
122 zassert_equal(data.val2, chan_elements[0].data.val2, in test_sensor_get_channels()
131 &data), RETURN_SUCCESS, "fail to get channel."); in test_sensor_get_channels()
132 zassert_equal(data.val1, chan_elements[i].data.val1, in test_sensor_get_channels()
134 zassert_equal(data.val2, chan_elements[i].data.val2, in test_sensor_get_channels()
140 &data), RETURN_SUCCESS, "should fail for invalid channel."); in test_sensor_get_channels()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/hts221/
Dhts221_trigger.c24 struct hts221_data *data = dev->data; in setup_drdy() local
30 gpio_pin_interrupt_configure(data->drdy_dev, cfg->drdy_pin, flags); in setup_drdy()
35 struct hts221_data *data = dev->data; in handle_drdy() local
40 k_sem_give(&data->drdy_sem); in handle_drdy()
42 k_work_submit(&data->work); in handle_drdy()
48 struct hts221_data *data = dev->data; in process_drdy() local
50 if (data->data_ready_handler != NULL) { in process_drdy()
51 data->data_ready_handler(dev, &data->data_ready_trigger); in process_drdy()
54 if (data->data_ready_handler != NULL) { in process_drdy()
63 struct hts221_data *data = dev->data; in hts221_trigger_set() local
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/fxos8700/
Dfxos8700_trigger.c17 struct fxos8700_data *data = in fxos8700_gpio_callback() local
20 if ((pin_mask & BIT(data->gpio_pin)) == 0U) { in fxos8700_gpio_callback()
24 gpio_pin_interrupt_configure(data->gpio, data->gpio_pin, in fxos8700_gpio_callback()
28 k_sem_give(&data->trig_sem); in fxos8700_gpio_callback()
30 k_work_submit(&data->work); in fxos8700_gpio_callback()
36 struct fxos8700_data *data = dev->data; in fxos8700_handle_drdy_int() local
43 if (data->drdy_handler) { in fxos8700_handle_drdy_int()
44 data->drdy_handler(dev, &drdy_trig); in fxos8700_handle_drdy_int()
54 struct fxos8700_data *data = dev->data; in fxos8700_handle_pulse_int() local
62 k_sem_take(&data->sem, K_FOREVER); in fxos8700_handle_pulse_int()
[all …]
/Zephyr-Core-2.7.6/drivers/i2c/slave/
Deeprom_slave.c41 ((struct i2c_eeprom_slave_data * const)(dev)->data)
46 struct i2c_eeprom_slave_data *data = dev->data; in eeprom_slave_program() local
48 if (length > data->buffer_size) { in eeprom_slave_program()
52 memcpy(data->buffer, eeprom_data, length); in eeprom_slave_program()
60 struct i2c_eeprom_slave_data *data = dev->data; in eeprom_slave_read() local
62 if (!data || offset >= data->buffer_size) { in eeprom_slave_read()
66 *eeprom_data = data->buffer[offset]; in eeprom_slave_read()
73 struct i2c_eeprom_slave_data *data = CONTAINER_OF(config, in eeprom_slave_write_requested() local
79 data->first_write = true; in eeprom_slave_write_requested()
87 struct i2c_eeprom_slave_data *data = CONTAINER_OF(config, in eeprom_slave_read_requested() local
[all …]
/Zephyr-Core-2.7.6/drivers/video/
Dvideo_mcux_csi.c53 struct video_mcux_csi_data *data = user_data; in __frame_done_cb() local
54 const struct device *dev = data->dev; in __frame_done_cb()
66 status = CSI_TransferGetFullBuffer(config->base, &(data->csi_handle), in __frame_done_cb()
74 while ((vbuf = k_fifo_get(&data->fifo_in, K_NO_WAIT))) { in __frame_done_cb()
83 k_fifo_put(&data->fifo_in, vbuf); in __frame_done_cb()
105 k_fifo_put(&data->fifo_out, vbuf); in __frame_done_cb()
109 if (IS_ENABLED(CONFIG_POLL) && data->signal) { in __frame_done_cb()
110 k_poll_signal_raise(data->signal, result); in __frame_done_cb()
121 struct video_mcux_csi_data *data = dev->data; in video_mcux_csi_set_fmt() local
129 data->pixelformat = fmt->pixelformat; in video_mcux_csi_set_fmt()
[all …]
Dvideo_sw_generator.c30 struct video_sw_generator_data *data = dev->data; in video_sw_generator_set_fmt() local
36 data->fmt = *fmt; in video_sw_generator_set_fmt()
45 struct video_sw_generator_data *data = dev->data; in video_sw_generator_get_fmt() local
51 *fmt = data->fmt; in video_sw_generator_get_fmt()
58 struct video_sw_generator_data *data = dev->data; in video_sw_generator_stream_start() local
60 return k_work_schedule(&data->buf_work, K_MSEC(33)); in video_sw_generator_stream_start()
65 struct video_sw_generator_data *data = dev->data; in video_sw_generator_stream_stop() local
67 k_work_cancel_delayable_sync(&data->buf_work, &data->work_sync); in video_sw_generator_stream_stop()
76 static void __fill_buffer_colorbar(struct video_sw_generator_data *data, in __fill_buffer_colorbar() argument
79 int bw = data->fmt.width / 8; in __fill_buffer_colorbar()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/vcnl4040/
Dvcnl4040_trigger.c12 static void vcnl4040_handle_cb(struct vcnl4040_data *data) in vcnl4040_handle_cb() argument
14 gpio_pin_interrupt_configure(data->gpio, data->gpio_pin, in vcnl4040_handle_cb()
18 k_sem_give(&data->trig_sem); in vcnl4040_handle_cb()
20 k_work_submit(&data->work); in vcnl4040_handle_cb()
28 struct vcnl4040_data *data = in vcnl4040_gpio_callback() local
31 if ((pin_mask & BIT(data->gpio_pin)) == 0U) { in vcnl4040_gpio_callback()
35 vcnl4040_handle_cb(data); in vcnl4040_gpio_callback()
40 struct vcnl4040_data *data = dev->data; in vcnl4040_handle_proxy_int() local
46 if (data->proxy_handler) { in vcnl4040_handle_proxy_int()
47 data->proxy_handler(dev, &proxy_trig); in vcnl4040_handle_proxy_int()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/ms5837/
Dms5837.c48 static void ms5837_compensate(struct ms5837_data *data, in ms5837_compensate() argument
65 dT = adc_temperature - ((uint32_t)(data->t_ref) << 8); in ms5837_compensate()
66 data->temperature = 2000 + (dT * data->tempsens) / (1ll << 23); in ms5837_compensate()
67 OFF = ((int64_t)(data->off_t1) << 16) + (dT * data->tco) / (1ll << 7); in ms5837_compensate()
68 SENS = ((int64_t)(data->sens_t1) << 15) + (dT * data->tcs) / (1ll << 8); in ms5837_compensate()
75 temp_sq = (data->temperature - 2000) * (data->temperature - 2000); in ms5837_compensate()
76 if (data->temperature < 2000) { in ms5837_compensate()
80 if (data->temperature < -1500) { in ms5837_compensate()
81 temp_sq = (data->temperature + 1500) * in ms5837_compensate()
82 (data->temperature + 1500); in ms5837_compensate()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/bmc150_magn/
Dbmc150_magn_trigger.c21 struct bmc150_magn_data *data = dev->data; in setup_drdy() local
25 gpio_pin_interrupt_configure(data->gpio_drdy, in setup_drdy()
37 struct bmc150_magn_data *data = dev->data; in bmc150_magn_trigger_set() local
51 data->handler_drdy = handler; in bmc150_magn_trigger_set()
52 data->trigger_drdy = *trig; in bmc150_magn_trigger_set()
54 if (i2c_reg_update_byte(data->i2c_master, in bmc150_magn_trigger_set()
75 struct bmc150_magn_data *data = in bmc150_magn_gpio_drdy_callback() local
80 setup_drdy(data->dev, false); in bmc150_magn_gpio_drdy_callback()
82 k_sem_give(&data->sem); in bmc150_magn_gpio_drdy_callback()
85 static void bmc150_magn_thread_main(struct bmc150_magn_data *data) in bmc150_magn_thread_main() argument
[all …]
/Zephyr-Core-2.7.6/drivers/disk/
Dsdmmc_spi.c53 struct sdhc_spi_data *data = dev->data; in sdhc_spi_set_status() local
56 data->status = status; in sdhc_spi_set_status()
58 data->spi_cfg = &cfg->init_cfg; in sdhc_spi_set_status()
60 data->spi_cfg = &cfg->oper_cfg; in sdhc_spi_set_status()
65 static int sdhc_spi_trace(struct sdhc_spi_data *data, int dir, int err, in sdhc_spi_trace() argument
71 data->trace_dir = 0; in sdhc_spi_trace()
74 if (dir != data->trace_dir) { in sdhc_spi_trace()
75 data->trace_dir = dir; in sdhc_spi_trace()
94 static int sdhc_spi_rx_bytes(struct sdhc_spi_data *data, uint8_t *buf, int len) in sdhc_spi_rx_bytes() argument
120 return sdhc_spi_trace(data, -1, in sdhc_spi_rx_bytes()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/sx9500/
Dsx9500_trigger.c31 struct sx9500_data *data = dev->data; in sx9500_trigger_set() local
35 if (i2c_reg_update_byte(data->i2c_master, in sx9500_trigger_set()
36 data->i2c_slave_addr, in sx9500_trigger_set()
42 data->handler_drdy = handler; in sx9500_trigger_set()
43 data->trigger_drdy = *trig; in sx9500_trigger_set()
47 if (i2c_reg_update_byte(data->i2c_master, in sx9500_trigger_set()
48 data->i2c_slave_addr, in sx9500_trigger_set()
54 data->handler_near_far = handler; in sx9500_trigger_set()
55 data->trigger_near_far = *trig; in sx9500_trigger_set()
67 struct sx9500_data *data = dev->data; in sx9500_gpio_thread_cb() local
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/fxas21002/
Dfxas21002_trigger.c17 struct fxas21002_data *data = in fxas21002_gpio_callback() local
20 if ((pin_mask & BIT(data->gpio_pin)) == 0U) { in fxas21002_gpio_callback()
24 gpio_pin_interrupt_configure(data->gpio, data->gpio_pin, in fxas21002_gpio_callback()
28 k_sem_give(&data->trig_sem); in fxas21002_gpio_callback()
30 k_work_submit(&data->work); in fxas21002_gpio_callback()
36 struct fxas21002_data *data = dev->data; in fxas21002_handle_drdy_int() local
43 if (data->drdy_handler) { in fxas21002_handle_drdy_int()
44 data->drdy_handler(dev, &drdy_trig); in fxas21002_handle_drdy_int()
53 struct fxas21002_data *data = dev->data; in fxas21002_handle_int() local
56 k_sem_take(&data->sem, K_FOREVER); in fxas21002_handle_int()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/lsm9ds0_gyro/
Dlsm9ds0_gyro_trigger.c26 struct lsm9ds0_gyro_data *data = dev->data; in setup_drdy() local
29 gpio_pin_interrupt_configure(data->gpio_drdy, in setup_drdy()
40 struct lsm9ds0_gyro_data *data = dev->data; in lsm9ds0_gyro_trigger_set() local
53 data->handler_drdy = handler; in lsm9ds0_gyro_trigger_set()
54 data->trigger_drdy = *trig; in lsm9ds0_gyro_trigger_set()
56 if (i2c_reg_update_byte(data->i2c_master, in lsm9ds0_gyro_trigger_set()
76 struct lsm9ds0_gyro_data *data = in lsm9ds0_gyro_gpio_drdy_callback() local
79 setup_drdy(data->dev, false); in lsm9ds0_gyro_gpio_drdy_callback()
81 k_sem_give(&data->sem); in lsm9ds0_gyro_gpio_drdy_callback()
84 static void lsm9ds0_gyro_thread_main(struct lsm9ds0_gyro_data *data) in lsm9ds0_gyro_thread_main() argument
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/sht3xd/
Dsht3xd_trigger.c40 struct sht3xd_data *data = dev->data; in sht3xd_attr_set() local
45 data->t_low = sht3xd_temp_processed_to_raw(val); in sht3xd_attr_set()
47 data->rh_low = sht3xd_rh_processed_to_raw(val); in sht3xd_attr_set()
54 temp = data->t_low; in sht3xd_attr_set()
55 rh = data->rh_low; in sht3xd_attr_set()
58 data->t_high = sht3xd_temp_processed_to_raw(val); in sht3xd_attr_set()
60 data->rh_high = sht3xd_rh_processed_to_raw(val); in sht3xd_attr_set()
67 temp = data->t_high; in sht3xd_attr_set()
68 rh = data->rh_high; in sht3xd_attr_set()
87 struct sht3xd_data *data = (struct sht3xd_data *)dev->data; in setup_alert() local
[all …]
/Zephyr-Core-2.7.6/drivers/counter/
Drtc_mcp7940n.c76 struct mcp7940n_data *data = dev->data; in decode_rtc() local
80 time.tm_sec = RTC_BCD_DECODE(data->registers.rtc_sec.sec); in decode_rtc()
81 time.tm_min = RTC_BCD_DECODE(data->registers.rtc_min.min); in decode_rtc()
82 time.tm_hour = RTC_BCD_DECODE(data->registers.rtc_hours.hr); in decode_rtc()
83 time.tm_mday = RTC_BCD_DECODE(data->registers.rtc_date.date); in decode_rtc()
84 time.tm_wday = data->registers.rtc_weekday.weekday; in decode_rtc()
86 time.tm_mon = RTC_BCD_DECODE(data->registers.rtc_month.month) - 1; in decode_rtc()
88 time.tm_year = RTC_BCD_DECODE(data->registers.rtc_year.year) + in decode_rtc()
109 struct mcp7940n_data *data = dev->data; in encode_rtc() local
122 data->registers.rtc_sec.start_osc = 1; in encode_rtc()
[all …]
Dmaxim_ds3231.c151 struct ds3231_data *data = dev->data; in sc_ctrl() local
153 struct register_map *rp = &data->registers; in sc_ctrl()
162 rc = i2c_write(data->i2c, buf, sizeof(buf), cfg->addr); in sc_ctrl()
175 struct ds3231_data *data = dev->data; in maxim_ds3231_ctrl_update() local
177 k_sem_take(&data->lock, K_FOREVER); in maxim_ds3231_ctrl_update()
181 k_sem_give(&data->lock); in maxim_ds3231_ctrl_update()
203 struct ds3231_data *data = dev->data; in rsc_stat() local
205 struct register_map *rp = &data->registers; in rsc_stat()
209 rc = i2c_write_read(data->i2c, cfg->addr, in rsc_stat()
220 rc = i2c_write(data->i2c, buf, sizeof(buf), cfg->addr); in rsc_stat()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/bme680/
Dbme680.c42 static void bme680_calc_temp(struct bme680_data *data, uint32_t adc_temp) in bme680_calc_temp() argument
46 var1 = ((int32_t)adc_temp >> 3) - ((int32_t)data->par_t1 << 1); in bme680_calc_temp()
47 var2 = (var1 * (int32_t)data->par_t2) >> 11; in bme680_calc_temp()
49 var3 = ((var3) * ((int32_t)data->par_t3 << 4)) >> 14; in bme680_calc_temp()
50 data->t_fine = var2 + var3; in bme680_calc_temp()
51 data->calc_temp = ((data->t_fine * 5) + 128) >> 8; in bme680_calc_temp()
54 static void bme680_calc_press(struct bme680_data *data, uint32_t adc_press) in bme680_calc_press() argument
58 var1 = (((int32_t)data->t_fine) >> 1) - 64000; in bme680_calc_press()
60 (int32_t)data->par_p6) >> 2; in bme680_calc_press()
61 var2 = var2 + ((var1 * (int32_t)data->par_p5) << 1); in bme680_calc_press()
[all …]
/Zephyr-Core-2.7.6/drivers/sensor/sm351lt/
Dsm351lt.c28 struct sm351lt_data *data = dev->data; in sm351lt_trigger_set() local
32 data->changed_handler = handler; in sm351lt_trigger_set()
33 ret = gpio_pin_interrupt_configure(data->bus, config->gpio_pin, in sm351lt_trigger_set()
34 (handler ? data->trigger_type in sm351lt_trigger_set()
42 ret = gpio_add_callback(data->bus, &data->gpio_cb); in sm351lt_trigger_set()
44 ret = gpio_remove_callback(data->bus, &data->gpio_cb); in sm351lt_trigger_set()
54 struct sm351lt_data *data = in sm351lt_gpio_callback() local
58 k_sem_give(&data->gpio_sem); in sm351lt_gpio_callback()
60 k_work_submit(&data->work); in sm351lt_gpio_callback()
66 struct sm351lt_data *data = dev->data; in sm351lt_thread_cb() local
[all …]
/Zephyr-Core-2.7.6/drivers/virtualization/
Dvirt_ivshmem.c40 struct ivshmem *data = dev->data; in ivshmem_configure_interrupts() local
48 n_vectors = pcie_msi_vectors_allocate(data->bdf, in ivshmem_configure_interrupts()
50 data->vectors, in ivshmem_configure_interrupts()
61 data->params[i].dev = dev; in ivshmem_configure_interrupts()
62 data->params[i].vector = i; in ivshmem_configure_interrupts()
64 if (!pcie_msi_vector_connect(data->bdf, in ivshmem_configure_interrupts()
65 &data->vectors[i], in ivshmem_configure_interrupts()
67 &data->params[i], 0)) { in ivshmem_configure_interrupts()
75 if (!pcie_msi_enable(data->bdf, data->vectors, n_vectors, 0)) { in ivshmem_configure_interrupts()
80 data->n_vectors = n_vectors; in ivshmem_configure_interrupts()
[all …]
/Zephyr-Core-2.7.6/drivers/serial/
Duart_stm32.c50 ((struct uart_stm32_data *const)(dev)->data)
87 struct uart_stm32_data *data = DEV_DATA(dev); in uart_stm32_pm_constraint_set() local
89 if (!data->pm_constraint_on) { in uart_stm32_pm_constraint_set()
90 data->pm_constraint_on = true; in uart_stm32_pm_constraint_set()
97 struct uart_stm32_data *data = DEV_DATA(dev); in uart_stm32_pm_constraint_release() local
99 if (data->pm_constraint_on) { in uart_stm32_pm_constraint_release()
100 data->pm_constraint_on = false; in uart_stm32_pm_constraint_release()
110 struct uart_stm32_data *data = DEV_DATA(dev); in uart_stm32_set_baudrate() local
116 if (clock_control_get_rate(data->clock, in uart_stm32_set_baudrate()
404 struct uart_stm32_data *data = DEV_DATA(dev); in uart_stm32_configure() local
[all …]
/Zephyr-Core-2.7.6/drivers/adc/
Dadc_emul.c111 struct adc_emul_data *data = dev->data; in adc_emul_const_value_set() local
119 chan_cfg = &data->chan_cfg[chan]; in adc_emul_const_value_set()
121 k_mutex_lock(&data->cfg_mtx, K_FOREVER); in adc_emul_const_value_set()
126 k_mutex_unlock(&data->cfg_mtx); in adc_emul_const_value_set()
135 struct adc_emul_data *data = dev->data; in adc_emul_value_func_set() local
143 chan_cfg = &data->chan_cfg[chan]; in adc_emul_value_func_set()
145 k_mutex_lock(&data->cfg_mtx, K_FOREVER); in adc_emul_value_func_set()
151 k_mutex_unlock(&data->cfg_mtx); in adc_emul_value_func_set()
160 struct adc_emul_data *data = dev->data; in adc_emul_ref_voltage_set() local
163 k_mutex_lock(&data->cfg_mtx, K_FOREVER); in adc_emul_ref_voltage_set()
[all …]
/Zephyr-Core-2.7.6/samples/net/sockets/echo_client/src/
Dudp.c30 static int send_udp_data(struct data *data) in send_udp_data() argument
35 data->udp.expecting = sys_rand32_get() % ipsum_len; in send_udp_data()
36 } while (data->udp.expecting == 0U || in send_udp_data()
37 data->udp.expecting > data->udp.mtu); in send_udp_data()
39 ret = send(data->udp.sock, lorem_ipsum, data->udp.expecting, 0); in send_udp_data()
41 LOG_DBG("%s UDP: Sent %d bytes", data->proto, data->udp.expecting); in send_udp_data()
43 k_work_reschedule(&data->udp.recv, UDP_WAIT); in send_udp_data()
48 static int compare_udp_data(struct data *data, const char *buf, uint32_t received) in compare_udp_data() argument
50 if (received != data->udp.expecting) { in compare_udp_data()
51 LOG_ERR("Invalid amount of data received: UDP %s", data->proto); in compare_udp_data()
[all …]

12345678910>>...63