Lines Matching full:result
471 int result = spi_transceive_dt(bus, &tx, &rx); in ads114s0x_read_register() local
473 if (result != 0) { in ads114s0x_read_register()
474 LOG_ERR("spi_transceive failed with error %i", result); in ads114s0x_read_register()
475 return result; in ads114s0x_read_register()
503 int result = spi_write_dt(bus, &tx); in ads114s0x_write_register() local
505 if (result != 0) { in ads114s0x_write_register()
506 LOG_ERR("spi_write failed with error %i", result); in ads114s0x_write_register()
507 return result; in ads114s0x_write_register()
550 int result = spi_write_dt(bus, &tx); in ads114s0x_write_multiple_registers() local
552 if (result != 0) { in ads114s0x_write_multiple_registers()
553 LOG_ERR("spi_write failed with error %i", result); in ads114s0x_write_multiple_registers()
554 return result; in ads114s0x_write_multiple_registers()
575 int result = spi_write_dt(bus, &tx); in ads114s0x_send_command() local
577 if (result != 0) { in ads114s0x_send_command()
578 LOG_ERR("spi_write failed with error %i", result); in ads114s0x_send_command()
579 return result; in ads114s0x_send_command()
597 int result; in ads114s0x_channel_setup() local
822 result = ads114s0x_write_multiple_registers(&config->bus, register_addresses, values, in ads114s0x_channel_setup()
825 if (result != 0) { in ads114s0x_channel_setup()
827 return result; in ads114s0x_channel_setup()
889 int result; in ads114s0x_adc_start_read() local
892 result = ads114s0x_validate_sequence(dev, sequence); in ads114s0x_adc_start_read()
894 if (result != 0) { in ads114s0x_adc_start_read()
896 return result; in ads114s0x_adc_start_read()
904 result = adc_context_wait_for_completion(&data->ctx); in ads114s0x_adc_start_read()
907 return result; in ads114s0x_adc_start_read()
913 int result; in ads114s0x_send_start_read() local
916 result = ads114s0x_send_command(&config->bus, ADS114S0X_COMMAND_START); in ads114s0x_send_start_read()
917 if (result != 0) { in ads114s0x_send_start_read()
919 return result; in ads114s0x_send_start_read()
922 result = gpio_pin_set_dt(&config->gpio_start_sync, 1); in ads114s0x_send_start_read()
924 if (result != 0) { in ads114s0x_send_start_read()
926 return result; in ads114s0x_send_start_read()
932 result = gpio_pin_set_dt(&config->gpio_start_sync, 0); in ads114s0x_send_start_read()
934 if (result != 0) { in ads114s0x_send_start_read()
936 return result; in ads114s0x_send_start_read()
974 int result = spi_transceive_dt(&config->bus, &tx, &rx); in ads114s0x_read_sample() local
976 if (result != 0) { in ads114s0x_read_sample()
977 LOG_ERR("spi_transceive failed with error %i", result); in ads114s0x_read_sample()
978 return result; in ads114s0x_read_sample()
988 int result; in ads114s0x_adc_perform_read() local
993 result = ads114s0x_send_start_read(dev); in ads114s0x_adc_perform_read()
994 if (result != 0) { in ads114s0x_adc_perform_read()
996 adc_context_complete(&data->ctx, result); in ads114s0x_adc_perform_read()
997 return result; in ads114s0x_adc_perform_read()
1000 result = ads114s0x_wait_data_ready(dev); in ads114s0x_adc_perform_read()
1001 if (result != 0) { in ads114s0x_adc_perform_read()
1003 adc_context_complete(&data->ctx, result); in ads114s0x_adc_perform_read()
1004 return result; in ads114s0x_adc_perform_read()
1007 result = ads114s0x_read_sample(dev, data->buffer); in ads114s0x_adc_perform_read()
1008 if (result != 0) { in ads114s0x_adc_perform_read()
1010 adc_context_complete(&data->ctx, result); in ads114s0x_adc_perform_read()
1011 return result; in ads114s0x_adc_perform_read()
1018 return result; in ads114s0x_adc_perform_read()
1025 int result; in ads114s0x_adc_read_async() local
1029 result = ads114s0x_adc_start_read(dev, sequence, true); in ads114s0x_adc_read_async()
1030 adc_context_release(&data->ctx, result); in ads114s0x_adc_read_async()
1032 return result; in ads114s0x_adc_read_async()
1037 int result; in ads114s0x_read() local
1041 result = ads114s0x_adc_start_read(dev, sequence, true); in ads114s0x_read()
1042 adc_context_release(&data->ctx, result); in ads114s0x_read()
1044 return result; in ads114s0x_read()
1050 int result; in ads114s0x_read() local
1054 result = ads114s0x_adc_start_read(dev, sequence, false); in ads114s0x_read()
1056 while (result == 0 && k_sem_take(&data->ctx.sync, K_NO_WAIT) != 0) { in ads114s0x_read()
1057 result = ads114s0x_adc_perform_read(dev); in ads114s0x_read()
1060 adc_context_release(&data->ctx, result); in ads114s0x_read()
1061 return result; in ads114s0x_read()
1111 int result = 0; in ads114s0x_gpio_set_output() local
1129 result = ads114s0x_gpio_write_config(dev); in ads114s0x_gpio_set_output()
1133 return result; in ads114s0x_gpio_set_output()
1139 int result = 0; in ads114s0x_gpio_set_input() local
1152 result = ads114s0x_gpio_write_config(dev); in ads114s0x_gpio_set_input()
1156 return result; in ads114s0x_gpio_set_input()
1162 int result = 0; in ads114s0x_gpio_deconfigure() local
1175 result = ads114s0x_gpio_write_config(dev); in ads114s0x_gpio_deconfigure()
1179 return result; in ads114s0x_gpio_deconfigure()
1185 int result = 0; in ads114s0x_gpio_set_pin_value() local
1196 result = -EINVAL; in ads114s0x_gpio_set_pin_value()
1199 result = -EINVAL; in ads114s0x_gpio_set_pin_value()
1203 result = ads114s0x_gpio_write_value(dev); in ads114s0x_gpio_set_pin_value()
1208 return result; in ads114s0x_gpio_set_pin_value()
1215 int result = 0; in ads114s0x_gpio_get_pin_value() local
1227 result = -EINVAL; in ads114s0x_gpio_get_pin_value()
1230 result = -EINVAL; in ads114s0x_gpio_get_pin_value()
1232 result = ads114s0x_read_register(&config->bus, ADS114S0X_REGISTER_GPIODAT, in ads114s0x_gpio_get_pin_value()
1240 return result; in ads114s0x_gpio_get_pin_value()
1247 int result = 0; in ads114s0x_gpio_port_get_raw() local
1252 result = ads114s0x_read_register(&config->bus, ADS114S0X_REGISTER_GPIODAT, &gpio_dat); in ads114s0x_gpio_port_get_raw()
1258 return result; in ads114s0x_gpio_port_get_raw()
1265 int result = 0; in ads114s0x_gpio_port_set_masked_raw() local
1271 result = ads114s0x_gpio_write_value(dev); in ads114s0x_gpio_port_set_masked_raw()
1275 return result; in ads114s0x_gpio_port_set_masked_raw()
1281 int result = 0; in ads114s0x_gpio_port_toggle_bits() local
1286 result = ads114s0x_gpio_write_value(dev); in ads114s0x_gpio_port_toggle_bits()
1290 return result; in ads114s0x_gpio_port_toggle_bits()
1300 int result; in ads114s0x_init() local
1319 result = gpio_pin_configure_dt(&config->gpio_reset, GPIO_OUTPUT_ACTIVE); in ads114s0x_init()
1320 if (result != 0) { in ads114s0x_init()
1322 return result; in ads114s0x_init()
1327 result = gpio_pin_configure_dt(&config->gpio_start_sync, GPIO_OUTPUT_INACTIVE); in ads114s0x_init()
1328 if (result != 0) { in ads114s0x_init()
1330 return result; in ads114s0x_init()
1334 result = gpio_pin_configure_dt(&config->gpio_data_ready, GPIO_INPUT); in ads114s0x_init()
1335 if (result != 0) { in ads114s0x_init()
1337 return result; in ads114s0x_init()
1340 result = gpio_pin_interrupt_configure_dt(&config->gpio_data_ready, GPIO_INT_EDGE_TO_ACTIVE); in ads114s0x_init()
1341 if (result != 0) { in ads114s0x_init()
1348 result = gpio_add_callback(config->gpio_data_ready.port, &data->callback_data_ready); in ads114s0x_init()
1349 if (result != 0) { in ads114s0x_init()
1365 result = ads114s0x_send_command(&config->bus, ADS114S0X_COMMAND_RESET); in ads114s0x_init()
1366 if (result != 0) { in ads114s0x_init()
1368 return result; in ads114s0x_init()
1377 result = ads114s0x_read_register(&config->bus, ADS114S0X_REGISTER_STATUS, &status); in ads114s0x_init()
1378 if (result != 0) { in ads114s0x_init()
1380 return result; in ads114s0x_init()
1394 result = ads114s0x_write_register(&config->bus, ADS114S0X_REGISTER_REF, reference_control); in ads114s0x_init()
1395 if (result != 0) { in ads114s0x_init()
1397 return result; in ads114s0x_init()
1403 result = ads114s0x_read_register(&config->bus, ADS114S0X_REGISTER_REF, in ads114s0x_init()
1405 if (result != 0) { in ads114s0x_init()
1407 return result; in ads114s0x_init()
1420 result = ads114s0x_gpio_write_config(dev); in ads114s0x_init()
1422 if (result != 0) { in ads114s0x_init()
1424 return result; in ads114s0x_init()
1430 return result; in ads114s0x_init()