/Zephyr-latest/tests/drivers/can/api/src/ |
D | classic.c | 31 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_std_callback_1() 46 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_std_callback_2() 61 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_ext_callback_1() 76 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_ext_callback_2() 91 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_callback_1() 108 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_callback_2() 125 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_mask_callback_1() 142 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_mask_callback_2() 159 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_ext_callback_1() 176 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_ext_callback_2() [all …]
|
D | canfd.c | 26 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_std_callback_1() 36 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_std_callback_2() 45 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_callback_1() 56 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_callback_2() 68 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_callback_fd_1() 80 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_callback_fd_2() 185 filter_id_1 = add_rx_msgq(can_dev, filter1); in send_receive() 186 send_test_frame(can_dev, frame1); in send_receive() 192 can_remove_rx_filter(can_dev, filter_id_1); in send_receive() 197 filter_id_1 = add_rx_filter(can_dev, filter1, rx_std_callback_fd_1); in send_receive() [all …]
|
D | stats.c | 26 val = can_stats_get_bit_errors(can_dev); in ZTEST_USER() 27 val = can_stats_get_bit0_errors(can_dev); in ZTEST_USER() 28 val = can_stats_get_bit1_errors(can_dev); in ZTEST_USER() 29 val = can_stats_get_stuff_errors(can_dev); in ZTEST_USER() 30 val = can_stats_get_crc_errors(can_dev); in ZTEST_USER() 31 val = can_stats_get_form_errors(can_dev); in ZTEST_USER() 32 val = can_stats_get_ack_errors(can_dev); in ZTEST_USER() 33 val = can_stats_get_rx_overruns(can_dev); in ZTEST_USER() 38 k_object_access_grant(can_dev, k_current_get()); in can_stats_setup() 40 zassert_true(device_is_ready(can_dev), "CAN device not ready"); in can_stats_setup()
|
D | transceiver.c | 24 const struct device *phy = can_get_transceiver(can_dev); in ZTEST_USER() 33 if (!device_is_ready(can_dev)) { in can_transceiver_predicate() 48 k_object_access_grant(can_dev, k_current_get()); in can_transceiver_setup() 51 zassert_true(device_is_ready(can_dev), "CAN device not ready"); in can_transceiver_setup()
|
D | common.c | 17 ZTEST_DMEM const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); variable 234 k_object_access_grant(can_dev, k_current_get()); in can_common_test_setup() 236 zassert_true(device_is_ready(can_dev), "CAN device not ready"); in can_common_test_setup() 238 (void)can_stop(can_dev); in can_common_test_setup() 240 err = can_set_mode(can_dev, initial_mode); in can_common_test_setup() 242 zassert_equal(initial_mode, can_get_mode(can_dev)); in can_common_test_setup() 244 err = can_start(can_dev); in can_common_test_setup()
|
D | common.h | 54 extern ZTEST_DMEM const struct device *const can_dev;
|
/Zephyr-latest/tests/subsys/canbus/isotp/implementation/src/ |
D | main.c | 28 const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); variable 55 static void send_sf(const struct device *can_dev) in send_sf() argument 59 ret = isotp_send(&send_ctx, can_dev, random_data, DATA_SIZE_SF, in send_sf() 104 static void send_test_data(const struct device *can_dev, const uint8_t *data, in send_test_data() argument 109 ret = isotp_send(&send_ctx, can_dev, data, len, &rx_addr, &tx_addr, in send_test_data() 207 ret = isotp_bind(&recv_ctx, can_dev, &rx_addr, &tx_addr, &fc_opts, in ZTEST() 212 send_sf(can_dev); in ZTEST() 223 ret = isotp_bind(&recv_ctx, can_dev, &rx_addr, &tx_addr, &fc_opts, in ZTEST() 228 send_sf(can_dev); in ZTEST() 239 ret = isotp_bind(&recv_ctx, can_dev, &rx_addr, &tx_addr, &fc_opts, in ZTEST() [all …]
|
/Zephyr-latest/tests/subsys/canbus/isotp/conformance/src/ |
D | mode_check.c | 15 static const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); variable 45 err = isotp_bind(&recv_ctx, can_dev, &rx_addr, &tx_addr, &fc_opts, K_NO_WAIT); in ZTEST() 60 err = isotp_send(&send_ctx, can_dev, buf, sizeof(buf), &rx_addr, &tx_addr, NULL, NULL); in ZTEST() 73 zassert_true(device_is_ready(can_dev), "CAN device not ready"); in isotp_conformance_mode_check_setup() 75 err = can_get_capabilities(can_dev, &cap); in isotp_conformance_mode_check_setup() 80 (void)can_stop(can_dev); in isotp_conformance_mode_check_setup() 82 err = can_set_mode(can_dev, CAN_MODE_LOOPBACK | (canfd_capable ? CAN_MODE_FD : 0)); in isotp_conformance_mode_check_setup() 85 err = can_start(can_dev); in isotp_conformance_mode_check_setup()
|
D | main.c | 150 static const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); variable 195 ret = isotp_send(&send_ctx, can_dev, random_data, DATA_SIZE_SF, in send_sf() 225 ret = isotp_send(&send_ctx, can_dev, data, len, &rx_addr, &tx_addr, in send_test_data() 274 ret = can_send(can_dev, &frame, K_MSEC(500), NULL, NULL); in send_frame_series() 314 filter_id = can_add_rx_filter_msgq(can_dev, &frame_msgq, &filter); in add_rx_msgq() 411 can_remove_rx_filter(can_dev, filter_id); in ZTEST() 421 ret = isotp_bind(&recv_ctx, can_dev, &rx_addr, &tx_addr, in ZTEST() 460 ret = isotp_send(&send_ctx, can_dev, random_data, DATA_SIZE_SF_EXT, in ZTEST() 467 can_remove_rx_filter(can_dev, filter_id); in ZTEST() 477 ret = isotp_bind(&recv_ctx, can_dev, &rx_addr_ext, &tx_addr, in ZTEST() [all …]
|
/Zephyr-latest/samples/subsys/canbus/isotp/src/ |
D | main.c | 40 const struct device *can_dev; variable 67 ret = isotp_bind(&recv_ctx_8_0, can_dev, in rx_8_0_thread() 104 ret = isotp_bind(&recv_ctx_0_5, can_dev, in rx_0_5_thread() 143 can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); in main() 144 if (!device_is_ready(can_dev)) { in main() 151 ret = can_set_mode(can_dev, mode); in main() 157 ret = can_start(can_dev); in main() 187 ret = isotp_send(&send_ctx_0_5, can_dev, in main() 196 ret = isotp_send(&send_ctx_8_0, can_dev, in main()
|
/Zephyr-latest/samples/drivers/can/counter/src/ |
D | main.c | 29 const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); variable 73 filter_id = can_add_rx_filter_msgq(can_dev, &counter_msgq, &filter); in rx_thread() 144 err = can_get_state(can_dev, &state, &err_cnt); in poll_state_thread() 212 if (!device_is_ready(can_dev)) { in main() 213 printf("CAN: Device %s not ready.\n", can_dev->name); in main() 218 ret = can_set_mode(can_dev, CAN_MODE_LOOPBACK); in main() 224 ret = can_start(can_dev); in main() 247 ret = can_add_rx_filter_msgq(can_dev, &change_led_msgq, &change_led_filter); in main() 280 can_set_state_change_callback(can_dev, state_change_callback, &state_change_work); in main() 287 can_send(can_dev, &change_led_frame, K_FOREVER, in main() [all …]
|
/Zephyr-latest/include/zephyr/canbus/ |
D | isotp.h | 247 int isotp_bind(struct isotp_recv_ctx *rctx, const struct device *can_dev, 325 int isotp_send(struct isotp_send_ctx *sctx, const struct device *can_dev, 350 int isotp_send_ctx_buf(const struct device *can_dev, 375 int isotp_send_net_ctx_buf(const struct device *can_dev, 405 int isotp_send_buf(const struct device *can_dev, 423 const struct device *can_dev; member 453 const struct device *can_dev; member
|
/Zephyr-latest/drivers/net/ |
D | canbus.c | 27 const struct device *can_dev; member 74 ret = can_add_rx_filter(cfg->can_dev, net_canbus_recv, context, optval); in net_canbus_setsockopt() 89 can_remove_rx_filter(cfg->can_dev, filter_id); in net_canbus_close() 111 ret = can_send(cfg->can_dev, (struct can_frame *)pkt->frags->data, in net_canbus_send() 140 if (!device_is_ready(cfg->can_dev)) { in net_canbus_init() 158 .can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus))
|
/Zephyr-latest/subsys/canbus/isotp/ |
D | isotp.c | 164 ret = can_send(rctx->can_dev, &frame, K_MSEC(ISOTP_A_TIMEOUT_MS), receive_can_tx, rctx); in receive_send_fc() 606 rctx->filter_id = can_add_rx_filter(rctx->can_dev, receive_can_rx, rctx, &filter); in add_ff_sf_filter() 615 int isotp_bind(struct isotp_recv_ctx *rctx, const struct device *can_dev, in isotp_bind() argument 625 __ASSERT(can_dev, "CAN device is NULL"); in isotp_bind() 629 rctx->can_dev = can_dev; in isotp_bind() 642 ret = can_get_capabilities(can_dev, &cap); in isotp_bind() 676 if (rctx->filter_id >= 0 && rctx->can_dev) { in isotp_unbind() 677 can_remove_rx_filter(rctx->can_dev, rctx->filter_id); in isotp_unbind() 942 ret = can_send(sctx->can_dev, &frame, K_MSEC(ISOTP_A_TIMEOUT_MS), send_can_tx_cb, sctx); in send_sf() 982 ret = can_send(sctx->can_dev, &frame, K_MSEC(ISOTP_A_TIMEOUT_MS), send_can_tx_cb, sctx); in send_ff() [all …]
|
/Zephyr-latest/doc/hardware/peripherals/can/ |
D | controller.rst | 138 const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); 141 ret = can_send(can_dev, &frame, K_MSEC(100), NULL, NULL); 164 int send_function(const struct device *can_dev) 175 return can_send(can_dev, &frame, K_FOREVER, tx_callback, "Sender 1"); 211 const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); 213 filter_id = can_add_rx_filter(can_dev, rx_callback_function, callback_arg, &my_filter); 236 const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); 238 filter_id = can_add_rx_filter_msgq(can_dev, &my_can_msgq, &my_filter); 253 can_remove_rx_filter(can_dev, filter_id); 267 const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); [all …]
|