Lines Matching refs:shctx
40 static inline int parse_device(const struct shell *shctx, size_t argc, char *argv[], in parse_device() argument
47 shell_error(shctx, "Timer: Device %s not found", argv[ARGV_DEV]); in parse_device()
54 static int cmd_timer_free_running(const struct shell *shctx, size_t argc, char **argv) in cmd_timer_free_running() argument
57 int err = parse_device(shctx, argc, argv, &timer_dev); in cmd_timer_free_running()
66 shell_error(shctx, "%s is not available err:%d", argv[ARGV_DEV], err); in cmd_timer_free_running()
70 shell_info(shctx, "%s: Timer is freerunning", argv[ARGV_DEV]); in cmd_timer_free_running()
75 static int cmd_timer_stop(const struct shell *shctx, size_t argc, char **argv) in cmd_timer_stop() argument
79 int err = parse_device(shctx, argc, argv, &timer_dev); in cmd_timer_stop()
91 shell_info(shctx, "Timer Stopped"); in cmd_timer_stop()
93 shell_error(shctx, "Failed to stop timer"); in cmd_timer_stop()
100 static int cmd_timer_oneshot(const struct shell *shctx, size_t argc, char **argv) in cmd_timer_oneshot() argument
105 int err = parse_device(shctx, argc, argv, &timer_dev); in cmd_timer_oneshot()
116 shell_error(shctx, "invalid delay parameter"); in cmd_timer_oneshot()
119 shell_error(shctx, "delay out of range"); in cmd_timer_oneshot()
125 shell_error(shctx, "invalid channel parameter"); in cmd_timer_oneshot()
128 shell_error(shctx, "channel out of range"); in cmd_timer_oneshot()
140 shell_error(shctx, "%s:Failed to set channel alarm, err:%d", argv[ARGV_DEV], err); in cmd_timer_oneshot()
146 shell_info(shctx, "%s: Alarm triggered", argv[ARGV_DEV]); in cmd_timer_oneshot()
151 static int cmd_timer_periodic(const struct shell *shctx, size_t argc, char **argv) in cmd_timer_periodic() argument
157 int err = parse_device(shctx, argc, argv, &timer_dev); in cmd_timer_periodic()
168 shell_error(shctx, "invalid delay parameter"); in cmd_timer_periodic()
171 shell_error(shctx, "delay out of range"); in cmd_timer_periodic()
184 shell_error(shctx, "%s: failed to set top value, err: %d", argv[ARGV_DEV], err); in cmd_timer_periodic()
195 shell_info(shctx, "%s: periodic timer triggered for %d times", argv[ARGV_DEV], count); in cmd_timer_periodic()