Lines Matching +full:timestamp +full:- +full:prescaler

5  * SPDX-License-Identifier: Apache-2.0
33 CAN_SHELL_MODE_MAPPING("listen-only", CAN_MODE_LISTENONLY),
36 CAN_SHELL_MODE_MAPPING("one-shot", CAN_MODE_ONE_SHOT),
37 CAN_SHELL_MODE_MAPPING("triple-sampling", CAN_MODE_3_SAMPLES),
65 uint8_t nbytes = can_dlc_to_bytes(frame->dlc); in can_shell_print_frame()
69 /* Timestamp */ in can_shell_print_frame()
70 shell_fprintf(sh, SHELL_NORMAL, "(%05d) ", frame->timestamp); in can_shell_print_frame()
76 (frame->flags & CAN_FRAME_BRS) == 0 ? '-' : 'B', in can_shell_print_frame()
77 (frame->flags & CAN_FRAME_ESI) == 0 ? '-' : 'P'); in can_shell_print_frame()
82 (frame->flags & CAN_FRAME_IDE) != 0 ? 0 : 5, "", in can_shell_print_frame()
83 (frame->flags & CAN_FRAME_IDE) != 0 ? 8 : 3, in can_shell_print_frame()
84 (frame->flags & CAN_FRAME_IDE) != 0 ? in can_shell_print_frame()
85 frame->id & CAN_EXT_ID_MASK : frame->id & CAN_STD_ID_MASK); in can_shell_print_frame()
89 (frame->flags & CAN_FRAME_FDF) != 0 ? "" : " ", in can_shell_print_frame()
90 (frame->flags & CAN_FRAME_FDF) != 0 ? 2 : 1, in can_shell_print_frame()
94 if ((frame->flags & CAN_FRAME_RTR) != 0) { in can_shell_print_frame()
98 shell_fprintf(sh, SHELL_NORMAL, "%02x ", frame->data[i]); in can_shell_print_frame()
191 return "error-active"; in can_shell_state_to_string()
193 return "error-warning"; in can_shell_state_to_string()
195 return "error-passive"; in can_shell_state_to_string()
197 return "bus-off"; in can_shell_state_to_string()
238 return -ENODEV; in cmd_can_start()
259 return -ENODEV; in cmd_can_stop()
289 return -ENODEV; in cmd_can_show()
299 if (err != 0 && err != -ENOSYS) { in cmd_can_show()
305 if (max_std_filters < 0 && max_std_filters != -ENOSYS) { in cmd_can_show()
306 shell_error(sh, "failed to get maximum standard (11-bit) filters (err %d)", err); in cmd_can_show()
311 if (max_ext_filters < 0 && max_ext_filters != -ENOSYS) { in cmd_can_show()
312 shell_error(sh, "failed to get maximum extended (29-bit) filters (err %d)", err); in cmd_can_show()
345 "phase_seg1 %u..%u, phase_seg2 %u..%u, prescaler %u..%u", in cmd_can_show()
346 timing_min->sjw, timing_max->sjw, in cmd_can_show()
347 timing_min->prop_seg, timing_max->prop_seg, in cmd_can_show()
348 timing_min->phase_seg1, timing_max->phase_seg1, in cmd_can_show()
349 timing_min->phase_seg2, timing_max->phase_seg2, in cmd_can_show()
350 timing_min->prescaler, timing_max->prescaler); in cmd_can_show()
357 "phase_seg1 %u..%u, phase_seg2 %u..%u, prescaler %u..%u", in cmd_can_show()
358 timing_min->sjw, timing_max->sjw, in cmd_can_show()
359 timing_min->prop_seg, timing_max->prop_seg, in cmd_can_show()
360 timing_min->phase_seg1, timing_max->phase_seg1, in cmd_can_show()
361 timing_min->phase_seg2, timing_max->phase_seg2, in cmd_can_show()
362 timing_min->prescaler, timing_max->prescaler); in cmd_can_show()
379 return -ENODEV; in cmd_can_bitrate_set()
385 return -EINVAL; in cmd_can_bitrate_set()
392 return -EINVAL; in cmd_can_bitrate_set()
404 /* Overwrite calculated default SJW with user-provided value */ in cmd_can_bitrate_set()
408 return -EINVAL; in cmd_can_bitrate_set()
413 "(+/- %d.%d%%), sjw %d", in cmd_can_bitrate_set()
417 LOG_DBG("sjw %u, prop_seg %u, phase_seg1 %u, phase_seg2 %u, prescaler %u", in cmd_can_bitrate_set()
419 timing.prescaler); in cmd_can_bitrate_set()
450 return -ENODEV; in cmd_can_dbitrate_set()
456 return -EINVAL; in cmd_can_dbitrate_set()
463 return -EINVAL; in cmd_can_dbitrate_set()
475 /* Overwrite calculated default SJW with user-provided value */ in cmd_can_dbitrate_set()
479 return -EINVAL; in cmd_can_dbitrate_set()
484 "(+/- %d.%d%%), sjw %d", in cmd_can_dbitrate_set()
488 LOG_DBG("sjw %u, prop_seg %u, phase_seg1 %u, phase_seg2 %u, prescaler %u", in cmd_can_dbitrate_set()
490 timing.prescaler); in cmd_can_dbitrate_set()
522 return -ENODEV; in cmd_can_mode_set()
543 return -EINVAL; in cmd_can_mode_set()
574 return -ENODEV; in cmd_can_send()
583 while (argidx < argc && strncmp(argv[argidx], "-", 1) == 0) { in cmd_can_send()
584 if (strcmp(argv[argidx], "--") == 0) { in cmd_can_send()
587 } else if (strcmp(argv[argidx], "-e") == 0) { in cmd_can_send()
591 } else if (strcmp(argv[argidx], "-r") == 0) { in cmd_can_send()
594 } else if (strcmp(argv[argidx], "-f") == 0) { in cmd_can_send()
597 } else if (strcmp(argv[argidx], "-b") == 0) { in cmd_can_send()
617 return -EINVAL; in cmd_can_send()
624 return -EINVAL; in cmd_can_send()
629 nbytes = argc - argidx; in cmd_can_send()
632 return -EINVAL; in cmd_can_send()
642 return -EINVAL; in cmd_can_send()
647 return -EINVAL; in cmd_can_send()
660 shell_print(sh, "enqueuing CAN frame #%u with %s (%d-bit) CAN ID 0x%0*x, " in cmd_can_send()
661 "RTR %d, CAN-FD %d, BRS %d, DLC %d", frame_no, in cmd_can_send()
691 return -ENODEV; in cmd_can_filter_add()
699 while (argidx < argc && strncmp(argv[argidx], "-", 1) == 0) { in cmd_can_filter_add()
700 if (strcmp(argv[argidx], "--") == 0) { in cmd_can_filter_add()
703 } else if (strcmp(argv[argidx], "-e") == 0) { in cmd_can_filter_add()
707 } else if (strcmp(argv[argidx], "-f") == 0) { in cmd_can_filter_add()
710 } else if (strcmp(argv[argidx], "-r") == 0) { in cmd_can_filter_add()
713 } else if (strcmp(argv[argidx], "-R") == 0) { in cmd_can_filter_add()
734 return -EINVAL; in cmd_can_filter_add()
741 return -EINVAL; in cmd_can_filter_add()
751 return -EINVAL; in cmd_can_filter_add()
758 return -EINVAL; in cmd_can_filter_add()
772 shell_print(sh, "adding filter with %s (%d-bit) CAN ID 0x%0*x, " in cmd_can_filter_add()
773 "CAN ID mask 0x%0*x, data frames %d, RTR frames %d, CAN-FD frames %d", in cmd_can_filter_add()
801 return -ENODEV; in cmd_can_filter_remove()
808 return -EINVAL; in cmd_can_filter_remove()
827 return -ENODEV; in cmd_can_recover()
835 return -EINVAL; in cmd_can_recover()
846 shell_error(sh, "failed to recover CAN controller from bus-off (err %d)", err); in cmd_can_recover()
857 entry->syntax = (dev != NULL) ? dev->name : NULL; in cmd_can_device_name()
858 entry->handler = NULL; in cmd_can_device_name()
859 entry->help = NULL; in cmd_can_device_name()
860 entry->subcmd = NULL; in cmd_can_device_name()
872 entry->syntax = can_shell_mode_map[idx].name; in cmd_can_mode()
875 entry->syntax = NULL; in cmd_can_mode()
878 entry->handler = NULL; in cmd_can_mode()
879 entry->help = NULL; in cmd_can_mode()
880 entry->subcmd = &dsub_can_mode; in cmd_can_mode()
887 entry->syntax = (dev != NULL) ? dev->name : NULL; in cmd_can_device_name_mode()
888 entry->handler = NULL; in cmd_can_device_name_mode()
889 entry->help = NULL; in cmd_can_device_name_mode()
890 entry->subcmd = &dsub_can_mode; in cmd_can_device_name_mode()
898 "Usage: can filter add <device> [-e] [-f] [-r] [-R] <CAN ID> [CAN ID mask]\n"
899 "-e use extended (29-bit) CAN ID/CAN ID mask\n"
900 "-f match CAN-FD format frames\n"
901 "-r also match Remote Transmission Request (RTR) frames\n"
902 "-R only match Remote Transmission Request (RTR) frames",
939 "Usage: can send <device> [-e] [-r] [-f] [-b] <CAN ID> [data] [...]\n"
940 "-e use extended (29-bit) CAN ID\n"
941 "-r send Remote Transmission Request (RTR) frame\n"
942 "-f use CAN-FD frame format\n"
943 "-b use CAN-FD Bit Rate Switching (BRS)",
951 "Recover CAN controller from bus-off state\n"