/Zephyr-latest/samples/drivers/can/counter/src/ |
D | main.c | 137 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/ |
D | can_handlers.c | 242 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()
|
D | can_sja1000.c | 532 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()
|
D | can_loopback.c | 322 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()
|
D | can_xmc4xxx.c | 451 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()
|
D | can_native_linux.c | 357 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()
|
D | can_rcar.c | 228 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()
|
D | can_mcp2515.c | 713 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()
|
D | can_renesas_ra.c | 392 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()
|
D | can_stm32_bxcan.c | 157 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()
|
D | can_mcp251xfd.c | 672 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()
|
D | can_nxp_s32_canxl.c | 360 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()
|
D | can_mcan.c | 461 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()
|
D | can_mcux_flexcan.c | 634 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()
|
D | can_shell.c | 330 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/ |
D | CO_driver.c | 463 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/ |
D | can.h | 305 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/ |
D | can_sja1000.h | 248 struct can_bus_err_cnt *err_cnt);
|
D | can_mcan.h | 1683 struct can_bus_err_cnt *err_cnt);
|
/Zephyr-latest/tests/drivers/can/api/src/ |
D | classic.c | 460 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()
|