Home
last modified time | relevance | path

Searched refs:err_cnt (Results 1 – 20 of 20) sorted by relevance

/Zephyr-latest/samples/drivers/can/counter/src/
Dmain.c137 struct can_bus_err_cnt err_cnt = {0, 0}; in poll_state_thread() local
144 err = can_get_state(can_dev, &state, &err_cnt); in poll_state_thread()
151 if (err_cnt.tx_err_cnt != err_cnt_prev.tx_err_cnt || in poll_state_thread()
152 err_cnt.rx_err_cnt != err_cnt_prev.rx_err_cnt || in poll_state_thread()
155 err_cnt_prev.tx_err_cnt = err_cnt.tx_err_cnt; in poll_state_thread()
156 err_cnt_prev.rx_err_cnt = err_cnt.rx_err_cnt; in poll_state_thread()
162 err_cnt.rx_err_cnt, err_cnt.tx_err_cnt); in poll_state_thread()
179 struct can_bus_err_cnt err_cnt, void *user_data) in state_change_callback() argument
186 current_err_cnt = err_cnt; in state_change_callback()
/Zephyr-latest/drivers/can/
Dcan_handlers.c242 struct can_bus_err_cnt *err_cnt) in z_vrfy_can_get_state() argument
250 if (err_cnt != NULL) { in z_vrfy_can_get_state()
251 K_OOPS(K_SYSCALL_MEMORY_WRITE(err_cnt, sizeof(*err_cnt))); in z_vrfy_can_get_state()
254 return z_impl_can_get_state(dev, state, err_cnt); in z_vrfy_can_get_state()
Dcan_sja1000.c532 struct can_bus_err_cnt *err_cnt) in can_sja1000_get_state() argument
544 if (err_cnt != NULL) { in can_sja1000_get_state()
545 err_cnt->rx_err_cnt = can_sja1000_read_reg(dev, CAN_SJA1000_RXERR); in can_sja1000_get_state()
546 err_cnt->tx_err_cnt = can_sja1000_read_reg(dev, CAN_SJA1000_TXERR); in can_sja1000_get_state()
708 struct can_bus_err_cnt err_cnt; in can_sja1000_isr() local
740 err_cnt.rx_err_cnt = can_sja1000_read_reg(dev, CAN_SJA1000_RXERR); in can_sja1000_isr()
741 err_cnt.tx_err_cnt = can_sja1000_read_reg(dev, CAN_SJA1000_TXERR); in can_sja1000_isr()
742 cb(dev, data->state, err_cnt, cb_data); in can_sja1000_isr()
Dcan_loopback.c322 struct can_bus_err_cnt *err_cnt) in can_loopback_get_state() argument
334 if (err_cnt) { in can_loopback_get_state()
335 err_cnt->tx_err_cnt = 0; in can_loopback_get_state()
336 err_cnt->rx_err_cnt = 0; in can_loopback_get_state()
Dcan_xmc4xxx.c451 struct can_bus_err_cnt *err_cnt, uint32_t *status) in can_xmc4xxx_get_state_from_status() argument
458 if (err_cnt != NULL) { in can_xmc4xxx_get_state_from_status()
459 err_cnt->tx_err_cnt = tec; in can_xmc4xxx_get_state_from_status()
460 err_cnt->rx_err_cnt = rec; in can_xmc4xxx_get_state_from_status()
484 struct can_bus_err_cnt *err_cnt) in can_xmc4xxx_get_state() argument
491 can_xmc4xxx_get_state_from_status(dev, state, err_cnt, &status); in can_xmc4xxx_get_state()
664 struct can_bus_err_cnt err_cnt; in can_xmc4xxx_state_change_handler() local
666 can_xmc4xxx_get_state_from_status(dev, &new_state, &err_cnt, &status); in can_xmc4xxx_state_change_handler()
670 dev, new_state, err_cnt, in can_xmc4xxx_state_change_handler()
Dcan_native_linux.c357 struct can_bus_err_cnt *err_cnt) in can_native_linux_get_state() argument
370 if (err_cnt) { in can_native_linux_get_state()
371 err_cnt->tx_err_cnt = 0; in can_native_linux_get_state()
372 err_cnt->rx_err_cnt = 0; in can_native_linux_get_state()
Dcan_rcar.c228 struct can_bus_err_cnt *err_cnt) in can_rcar_get_error_count() argument
230 err_cnt->tx_err_cnt = sys_read8(config->reg_addr + RCAR_CAN_TECR); in can_rcar_get_error_count()
231 err_cnt->rx_err_cnt = sys_read8(config->reg_addr + RCAR_CAN_RECR); in can_rcar_get_error_count()
240 struct can_bus_err_cnt err_cnt; in can_rcar_state_change() local
253 can_rcar_get_error_count(config, &err_cnt); in can_rcar_state_change()
254 cb(dev, newstate, err_cnt, state_change_cb_data); in can_rcar_state_change()
807 struct can_bus_err_cnt *err_cnt) in can_rcar_get_state() argument
820 if (err_cnt != NULL) { in can_rcar_get_state()
821 can_rcar_get_error_count(config, err_cnt); in can_rcar_get_state()
Dcan_mcp2515.c713 struct can_bus_err_cnt *err_cnt) in mcp2515_get_state() argument
740 if (err_cnt != NULL) { in mcp2515_get_state()
748 err_cnt->tx_err_cnt = err_cnt_buf[0]; in mcp2515_get_state()
749 err_cnt->rx_err_cnt = err_cnt_buf[1]; in mcp2515_get_state()
775 struct can_bus_err_cnt err_cnt; in mcp2515_handle_errors() local
778 err = mcp2515_get_state(dev, &state, state_change_cb ? &err_cnt : NULL); in mcp2515_handle_errors()
786 state_change_cb(dev, state, err_cnt, state_change_cb_data); in mcp2515_handle_errors()
Dcan_renesas_ra.c392 struct can_bus_err_cnt err_cnt = { in can_renesas_ra_call_state_change_cb() local
397 data->common.state_change_cb(dev, state, err_cnt, data->common.state_change_cb_user_data); in can_renesas_ra_call_state_change_cb()
694 struct can_bus_err_cnt *err_cnt) in can_renesas_ra_get_state() argument
699 if (state == NULL && err_cnt == NULL) { in can_renesas_ra_get_state()
724 if (err_cnt != NULL) { in can_renesas_ra_get_state()
725 err_cnt->tx_err_cnt = fsp_info.error_count_transmit; in can_renesas_ra_get_state()
726 err_cnt->rx_err_cnt = fsp_info.error_count_receive; in can_renesas_ra_get_state()
Dcan_stm32_bxcan.c157 struct can_bus_err_cnt *err_cnt) in can_stm32_get_state() argument
177 if (err_cnt != NULL) { in can_stm32_get_state()
178 err_cnt->tx_err_cnt = in can_stm32_get_state()
180 err_cnt->rx_err_cnt = in can_stm32_get_state()
190 struct can_bus_err_cnt err_cnt; in can_stm32_bus_state_change_isr() local
226 (void)can_stm32_get_state(dev, &state, &err_cnt); in can_stm32_bus_state_change_isr()
232 cb(dev, state, err_cnt, state_change_cb_data); in can_stm32_bus_state_change_isr()
Dcan_mcp251xfd.c672 struct can_bus_err_cnt *err_cnt) in mcp251xfd_get_state() argument
689 if (err_cnt != NULL) { in mcp251xfd_get_state()
690 err_cnt->tx_err_cnt = FIELD_GET(MCP251XFD_REG_TREC_TEC_MASK, tmp); in mcp251xfd_get_state()
691 err_cnt->rx_err_cnt = FIELD_GET(MCP251XFD_REG_TREC_REC_MASK, tmp); in mcp251xfd_get_state()
884 struct can_bus_err_cnt err_cnt; in mcp251xfd_handle_cerrif() local
889 ret = mcp251xfd_get_state(dev, &new_state, &err_cnt); in mcp251xfd_handle_cerrif()
898 LOG_INF("State %d -> %d (tx: %d, rx: %d)", dev_data->state, new_state, err_cnt.tx_err_cnt, in mcp251xfd_handle_cerrif()
899 err_cnt.rx_err_cnt); in mcp251xfd_handle_cerrif()
908 dev_data->common.state_change_cb(dev, new_state, err_cnt, in mcp251xfd_handle_cerrif()
Dcan_nxp_s32_canxl.c360 struct can_bus_err_cnt *err_cnt) in can_nxp_s32_get_state() argument
384 if (err_cnt) { in can_nxp_s32_get_state()
385 Canexcel_Ip_GetControllerTxErrorCounter(config->instance, &err_cnt->tx_err_cnt); in can_nxp_s32_get_state()
386 Canexcel_Ip_GetControllerRxErrorCounter(config->instance, &err_cnt->rx_err_cnt); in can_nxp_s32_get_state()
753 struct can_bus_err_cnt err_cnt; in can_nxp_s32_err_callback() local
804 can_nxp_s32_get_state(dev, &state, &err_cnt); in can_nxp_s32_err_callback()
808 data->common.state_change_cb(dev, state, err_cnt, cb_data); in can_nxp_s32_err_callback()
Dcan_mcan.c461 struct can_bus_err_cnt err_cnt; in can_mcan_state_change_handler() local
466 err = can_mcan_get_state(dev, &state, &err_cnt); in can_mcan_state_change_handler()
472 state_cb(dev, state, err_cnt, state_cb_data); in can_mcan_state_change_handler()
849 struct can_bus_err_cnt *err_cnt) in can_mcan_get_state() argument
874 if (err_cnt != NULL) { in can_mcan_get_state()
880 err_cnt->tx_err_cnt = FIELD_GET(CAN_MCAN_ECR_TEC, reg); in can_mcan_get_state()
881 err_cnt->rx_err_cnt = FIELD_GET(CAN_MCAN_ECR_REC, reg); in can_mcan_get_state()
Dcan_mcux_flexcan.c634 struct can_bus_err_cnt *err_cnt) in mcux_flexcan_get_state() argument
659 if (err_cnt != NULL) { in mcux_flexcan_get_state()
660 FLEXCAN_GetBusErrCount(config->base, &err_cnt->tx_err_cnt, in mcux_flexcan_get_state()
661 &err_cnt->rx_err_cnt); in mcux_flexcan_get_state()
929 struct can_bus_err_cnt err_cnt; in mcux_flexcan_transfer_error_status() local
955 (void)mcux_flexcan_get_state(dev, &state, &err_cnt); in mcux_flexcan_transfer_error_status()
960 cb(dev, state, err_cnt, cb_data); in mcux_flexcan_transfer_error_status()
Dcan_shell.c330 struct can_bus_err_cnt err_cnt; in cmd_can_show() local
370 err = can_get_state(dev, &state, &err_cnt); in cmd_can_show()
390 shell_print(sh, "rx errors: %d", err_cnt.rx_err_cnt); in cmd_can_show()
391 shell_print(sh, "tx errors: %d", err_cnt.tx_err_cnt); in cmd_can_show()
/Zephyr-latest/modules/canopennode/
DCO_driver.c463 struct can_bus_err_cnt err_cnt; in CO_CANverifyErrors() local
475 err = can_get_state(CANmodule->dev, &state, &err_cnt); in CO_CANverifyErrors()
481 errors = ((uint32_t)err_cnt.tx_err_cnt << 16) | in CO_CANverifyErrors()
482 ((uint32_t)err_cnt.rx_err_cnt << 8) | in CO_CANverifyErrors()
496 if ((err_cnt.rx_err_cnt >= 96U) || in CO_CANverifyErrors()
497 (err_cnt.tx_err_cnt >= 96U)) { in CO_CANverifyErrors()
507 if (err_cnt.rx_err_cnt >= 128U) { in CO_CANverifyErrors()
517 if (err_cnt.tx_err_cnt >= 128U && in CO_CANverifyErrors()
/Zephyr-latest/include/zephyr/drivers/
Dcan.h305 struct can_bus_err_cnt err_cnt,
481 struct can_bus_err_cnt *err_cnt);
1422 struct can_bus_err_cnt *err_cnt);
1425 struct can_bus_err_cnt *err_cnt) in z_impl_can_get_state() argument
1429 return api->get_state(dev, state, err_cnt); in z_impl_can_get_state()
/Zephyr-latest/include/zephyr/drivers/can/
Dcan_sja1000.h248 struct can_bus_err_cnt *err_cnt);
Dcan_mcan.h1683 struct can_bus_err_cnt *err_cnt);
/Zephyr-latest/tests/drivers/can/api/src/
Dclassic.c460 struct can_bus_err_cnt err_cnt, void *user_data) in state_change_callback() argument
464 ARG_UNUSED(err_cnt); in state_change_callback()
1171 struct can_bus_err_cnt err_cnt; in ZTEST_USER() local
1181 err = can_get_state(can_dev, NULL, &err_cnt); in ZTEST_USER()
1184 err = can_get_state(can_dev, &state, &err_cnt); in ZTEST_USER()