Home
last modified time | relevance | path

Searched full:period (Results 1 – 25 of 487) sorted by relevance

12345678910>>...20

/Zephyr-Core-3.6.0/samples/basic/blinky_pwm/src/
Dmain.c25 uint32_t period; in main() local
50 "does not support a period at least %lu\n", in main()
59 period = max_period; in main()
61 ret = pwm_set_dt(&pwm_led0, period, period / 2U); in main()
67 period = dir ? (period * 2U) : (period / 2U); in main()
68 if (period > max_period) { in main()
69 period = max_period / 2U; in main()
71 } else if (period < MIN_PERIOD) { in main()
72 period = MIN_PERIOD * 2U; in main()
/Zephyr-Core-3.6.0/samples/boards/bbc_microbit/sound/src/
Dmain.c24 static uint32_t period; variable
36 /* The "period / 2" pulse duration gives 50% duty cycle, which in beep()
39 pwm_set_dt(&pwm, period, period / 2U); in beep()
45 /* Ensure there's a clear silent period between two tones */ in beep()
64 if (period < PERIOD_MAX) { in button_pressed()
65 period += PWM_USEC(50U); in button_pressed()
69 if (period > PERIOD_MIN) { in button_pressed()
70 period -= PWM_USEC(50U); in button_pressed()
74 printk("Period is %u us (%u Hz)\n", period / NSEC_PER_USEC, in button_pressed()
75 NS_TO_HZ(period)); in button_pressed()
[all …]
/Zephyr-Core-3.6.0/drivers/pwm/
Dpwm_shell.c19 uint8_t period; member
27 .period = 3,
36 uint32_t period; in cmd_cycles() local
48 period = strtoul(argv[args_indx.period], NULL, 0); in cmd_cycles()
55 err = pwm_set_cycles(dev, channel, period, pulse, flags); in cmd_cycles()
69 uint32_t period; in cmd_usec() local
81 period = strtoul(argv[args_indx.period], NULL, 0); in cmd_usec()
88 err = pwm_set(dev, channel, PWM_USEC(period), PWM_USEC(pulse), flags); in cmd_usec()
101 uint32_t period; in cmd_nsec() local
113 period = strtoul(argv[args_indx.period], NULL, 0); in cmd_nsec()
[all …]
Dpwm_cc13xx_cc26xx_timer.c30 * cycle at max. period count.
58 static int set_period_and_pulse(const struct pwm_cc13xx_cc26xx_config *config, uint32_t period, in set_period_and_pulse() argument
68 match_value = period + 1; in set_period_and_pulse()
71 /* Fail if period is out of range */ in set_period_and_pulse()
72 if ((period > PWM_COUNT_MAX) || (period == 0)) { in set_period_and_pulse()
73 LOG_ERR("Period (%d) is out of range.", period); in set_period_and_pulse()
77 /* Compare to new period and fail if invalid */ in set_period_and_pulse()
78 if (period < (match_value - 1) || (match_value < 0)) { in set_period_and_pulse()
79 LOG_ERR("Period (%d) is shorter than pulse (%d).", period, pulse); in set_period_and_pulse()
83 /* Store new period and update timer */ in set_period_and_pulse()
[all …]
Dpwm_capture.c15 uint32_t period; member
29 data->period = period_cycles; in z_pwm_capture_cycles_callback()
37 pwm_flags_t flags, uint32_t *period, in z_impl_pwm_capture_cycles() argument
73 if (period != NULL) { in z_impl_pwm_capture_cycles()
74 *period = data.period; in z_impl_pwm_capture_cycles()
Dpwm_mcux_ctimer.c50 * All pwm signals generated from the same ctimer must have same period. To avoid this, we check
51 * if the new parameters will NOT change the period for a ctimer with active pulse channels
57 /* if we aren't changing the period, we're ok */ in mcux_ctimer_pwm_is_period_valid()
75 * there is exactly one pulse channel that depends on existing period and its not the in mcux_ctimer_pwm_is_period_valid()
86 * Each ctimer channel can either be used as a pulse or period channel. Each channel has a counter.
87 * The duty cycle is counted by the pulse channel. When the period channel counts down, it resets
89 * specify a period channel (only pulse channel). So we need to figure out an acceptable period
100 LOG_ERR("Cannot set channel %u to %u as period channel", in mcux_ctimer_pwm_select_period_channel()
107 /* the existing period channel will not conflict with new pulse_channel */ in mcux_ctimer_pwm_select_period_channel()
117 LOG_ERR("no available channel for period counter"); in mcux_ctimer_pwm_select_period_channel()
[all …]
Dpwm_mcux_pwt.c153 uint32_t period; in mcux_pwt_calc_period() local
156 if (u32_add_overflow(high_overflows, low_overflows, &period)) { in mcux_pwt_calc_period()
161 if (u32_mul_overflow(period, 0xFFFFU, &period)) { in mcux_pwt_calc_period()
166 if (u32_add_overflow(period, ppw, &period)) { in mcux_pwt_calc_period()
171 if (u32_add_overflow(period, npw, &period)) { in mcux_pwt_calc_period()
175 *result = period; in mcux_pwt_calc_period()
204 uint32_t period = 0; in mcux_pwt_isr() local
245 &period); in mcux_pwt_isr()
252 LOG_DBG("period = %d, pulse = %d, err = %d", period, pulse, in mcux_pwt_isr()
257 period, pulse, err, data->user_data); in mcux_pwt_isr()
Dpwm_handlers.c12 uint32_t channel, uint32_t period, in z_vrfy_pwm_set_cycles() argument
17 period, pulse, flags); in z_vrfy_pwm_set_cycles()
56 uint32_t period; in z_vrfy_pwm_capture_cycles() local
65 flags, &period, &pulse, timeout); in z_vrfy_pwm_capture_cycles()
67 K_OOPS(k_usermode_to_copy(period_cycles, &period, in z_vrfy_pwm_capture_cycles()
/Zephyr-Core-3.6.0/dts/bindings/pwm/
Dnxp,s32-emios-pwm.yaml21 period = <65534>;
53 phandle 'master-bus'. For OPWMB mode, PWM's period is master bus's period and
54 is 2 * master bus's period - 2 for OPWMCB mode. Please notice that the devicetree
74 # Period in terms of nanoseconds
75 - period
106 edge placement. The period is determined by period of
107 an external counter driven in MCB Up Mode. Changing PWM period
109 The new period and cycle take effect in next period boundary.
112 leading or trailing edge. The period is determined by period of
113 an external counter driven in MCB Up Down Mode. Changing PWM period
[all …]
Despressif,esp32-mcpwm.yaml90 Period of PWM_clk = 6.25ns * (PWM_CLK_PRESCALE + 1).
99 Period of PT0_clk = Period of PWM_clk * (PWM_TIMER0_PRESCALE + 1).
105 Period of PT1_clk = Period of PWM_clk * (PWM_TIMER1_PRESCALE + 1).
111 Period of PT2_clk = Period of PWM_clk * (PWM_TIMER2_PRESCALE + 1).
115 - period
/Zephyr-Core-3.6.0/drivers/watchdog/
Dwdt_dw_common.c35 uint32_t period; in dw_wdt_configure() local
43 period = config & ~WDT_DW_FLAG_CONFIGURED; in dw_wdt_configure()
46 dw_wdt_timeout_period_init_set(base, period); in dw_wdt_configure()
49 dw_wdt_timeout_period_set(base, period); in dw_wdt_configure()
62 uint32_t period; in dw_wdt_calc_period() local
77 period = period64 - 1; in dw_wdt_calc_period()
78 period = ilog2(period); in dw_wdt_calc_period()
80 if (period >= dw_wdt_cnt_width_get(base)) { in dw_wdt_calc_period()
86 *period_out = WDT_DW_FLAG_CONFIGURED | (period >= 15 ? period - 15 : 0); in dw_wdt_calc_period()
Dwdt_dw.h104 * Timeout period
109 * Timeout period for initialization
155 * Upper limit of Timeout Period parameters
163 * Upper limit of Initial Timeout Period parameters
195 * Describes the initial timeout period that is available directly after reset. It controls the
196 * reset value of the register. If WDT_HC_TOP is 1, then the default initial time period is the
197 * only possible period.
202 * Selects the timeout period that is available directly after reset. It controls the reset value
203 * of the register. If WDT_HC_TOP is set to 1, then the default timeout period is the only possible
204 * timeout period. Can choose one of 16 values.
[all …]
/Zephyr-Core-3.6.0/tests/drivers/pwm/pwm_api/src/
Dtest_pwm.c15 * -# Set PWM period and pulse using pwm_set_cycles() or pwm_set().
20 * of period and pulse.
21 * Always on -> Period : Pulse (1 : 1) -> 3.3V
22 * Half on -> Period : Pulse (2 : 1) -> 1.65V
23 * Always off -> Period : Pulse (1 : 0) -> 0V
109 static int test_task(uint32_t port, uint32_t period, uint32_t pulse, uint8_t unit) in test_task() argument
111 TC_PRINT("[PWM]: %" PRIu8 ", [period]: %" PRIu32 ", [pulse]: %" PRIu32 "\n", in test_task()
112 port, period, pulse); in test_task()
123 if (pwm_set_cycles(pwm_dev, port, period, pulse, 0)) { in test_task()
124 TC_PRINT("Fail to set the period and pulse width\n"); in test_task()
[all …]
/Zephyr-Core-3.6.0/include/zephyr/drivers/
Dpwm.h52 /** PWM pin capture captures period. */
58 /** PWM pin capture captures both period and pulse width. */
62 /** PWM pin capture captures a single period/pulse width. */
65 /** PWM pin capture captures period/pulse width continuously. */
85 * the PWM device), the PWM signal period in nanoseconds and the flags
101 /** Period in nanoseconds. */
102 uint32_t period; member
133 * // .period = 1000,
141 * a channel, a period in nanoseconds and optionally flags.
155 .period = DT_PWMS_PERIOD_BY_NAME(node_id, name), \
[all …]
/Zephyr-Core-3.6.0/tests/kernel/timer/timer_behavior/
DKconfig21 int "The number of microseconds to for the timer period"
30 int "Maximum drift in microseconds allowed (should be about 1 period allowance)"
34 int "Maximum drift percentage for the timer period"
37 # difference in the test period is nothing unusual (it can happen for
49 Toggles a GPIO pin, on every period, that can be used by an external
63 int "Maximum timer period drift in PPM for tests using external tool"
66 Parts Per Million of allowed period drift when using an external tool
/Zephyr-Core-3.6.0/tests/benchmarks/footprints/src/
Dtimer.c13 #define PERIOD 50 macro
60 k_timer_start(&timer0, K_MSEC(DURATION), K_MSEC(PERIOD)); in thread_fn()
62 busy_wait_ms(DURATION + PERIOD * EXPIRE_TIMES + PERIOD / 2); in thread_fn()
66 k_timer_start(&timer0, K_MSEC(DURATION), K_MSEC(PERIOD)); in thread_fn()
73 k_timer_start(&timer0, K_MSEC(DURATION), K_MSEC(PERIOD)); in thread_fn()
75 busy_wait_ms(DURATION + PERIOD * EXPIRE_TIMES + PERIOD / 2); in thread_fn()
/Zephyr-Core-3.6.0/tests/kernel/timer/timer_api/src/
Dmain.c18 #define PERIOD 50 macro
97 * late to see a full period elapse before the next period. in interval_check()
122 TIMER_ASSERT(interval_check(interval, PERIOD), timer); in duration_expire()
145 TIMER_ASSERT(k_timer_remaining_get(timer) >= PERIOD, timer); in status_expire()
172 * @brief Test duration and period of Timer
174 * Validates initial duration and period of timer.
177 * using k_timer_start() with specific initial duration and period.
179 * of duration and period.
190 k_timer_start(&duration_timer, K_MSEC(DURATION), K_MSEC(PERIOD)); in ZTEST_USER()
191 busy_wait_ms(DURATION + PERIOD * EXPIRE_TIMES + PERIOD / 2); in ZTEST_USER()
[all …]
/Zephyr-Core-3.6.0/subsys/bluetooth/mesh/
Dheartbeat.c26 uint8_t period; member
61 if (pub.period && pub.count > 1) { in hb_publish_end_cb()
62 k_work_reschedule(&pub_timer, K_SECONDS(pub.period)); in hb_publish_end_cb()
173 if (pub.period == 0U || pub.count == 0U) { in hb_publish()
236 pub.period = 0U; in pub_disable()
243 * already checked period for being non-zero. in pub_disable()
275 * after the Heartbeat Publication Period state has been configured for in bt_mesh_hb_pub_set()
296 uint8_t bt_mesh_hb_sub_set(uint16_t src, uint16_t dst, uint32_t period) in bt_mesh_hb_sub_set() argument
309 if (period > (1U << 16)) { in bt_mesh_hb_sub_set()
310 LOG_WRN("Prohibited subscription period %u s", period); in bt_mesh_hb_sub_set()
[all …]
/Zephyr-Core-3.6.0/include/zephyr/dt-bindings/pwm/
Dpwm.h17 * @name PWM period set helpers
18 * The period cell in the PWM specifier needs to be provided in nanoseconds.
23 /** Specify PWM period in nanoseconds */
25 /** Specify PWM period in microseconds */
27 /** Specify PWM period in milliseconds */
29 /** Specify PWM period in seconds */
/Zephyr-Core-3.6.0/dts/bindings/watchdog/
Dti,tps382x.yaml14 WDI gpio. If WDI remains high or low longer than the timeout period,
21 timeout-period:
25 Time-out period in milliseconds. Typical for TPS3823/4/8 and TPS3823A is
27 the watchdog should be kicked within the minimum timeout period. The kick
/Zephyr-Core-3.6.0/tests/drivers/pwm/pwm_loopback/src/
Dtest_pwm_loopback.c38 static void test_capture(uint32_t period, uint32_t pulse, enum test_pwm_unit unit, in test_capture() argument
52 pulse, period); in test_capture()
53 err = pwm_set(out.dev, out.pwm, period, pulse, out.flags ^= in test_capture()
59 pulse, period); in test_capture()
60 err = pwm_set(out.dev, out.pwm, PWM_USEC(period), in test_capture()
75 &pulse_capture, K_NSEC(period * 10)); in test_capture()
80 &pulse_capture, K_USEC(period * 10)); in test_capture()
96 zassert_within(period_capture, period, period / 100, in test_capture()
97 "period capture off by more than 1%"); in test_capture()
160 uint32_t period; in ZTEST_USER() local
[all …]
/Zephyr-Core-3.6.0/include/zephyr/tracing/
Dtracing.h80 * @param timeout Timeout period
87 * @param timeout Timeout period
94 * @param timeout Timeout period
101 * @param timeout Timeout period
107 * @param timeout Timeout period
358 * @param timeout Timeout period
474 * @param delay Delay period
482 * @param delay Delay period
490 * @param delay Delay period
497 * @param delay Delay period
[all …]
/Zephyr-Core-3.6.0/include/zephyr/bluetooth/mesh/
Dhealth_cli.h40 /** @brief Optional callback for Health Period Status messages.
42 * Handles received Health Period Status messages from a Health
43 * server. The @c divisor param represents the period divisor value.
47 * @param divisor Health Period Divisor value.
217 /** @brief Get the target node's Health fast period divisor.
219 * The health period divisor is used to increase the publish rate when a fault
220 * is registered. Normally, the Health server will publish with the period in
222 * period is divided by (1 << divisor). For example, if the target node's
223 * Health server is configured to publish with a period of 16 seconds, and the
224 * Health fast period divisor is 5, the Health server will publish with an
[all …]
/Zephyr-Core-3.6.0/drivers/led/
Dpca9633.c63 uint32_t period; in pca9633_led_blink() local
65 period = delay_on + delay_off; in pca9633_led_blink()
67 if (period < dev_data->min_period || period > dev_data->max_period) { in pca9633_led_blink()
74 * (time_on / period) = (GDC / 256) -> in pca9633_led_blink()
75 * GDC = ((time_on * 256) / period) in pca9633_led_blink()
77 gdc = delay_on * 256U / period; in pca9633_led_blink()
87 * period = ((GFRQ + 1) / 24) in seconds. in pca9633_led_blink()
88 * So, period (in ms) = (((GFRQ + 1) / 24) * 1000) -> in pca9633_led_blink()
89 * GFRQ = ((period * 24 / 1000) - 1) in pca9633_led_blink()
91 gfrq = (period * 24U / 1000) - 1; in pca9633_led_blink()
Dtlc59108.c90 uint32_t period; in tlc59108_led_blink() local
92 period = delay_on + delay_off; in tlc59108_led_blink()
98 if (period < dev_data->min_period || period > dev_data->max_period) { in tlc59108_led_blink()
105 * (time_on / period) = (GDC / 256) -> in tlc59108_led_blink()
106 * GDC = ((time_on * 256) / period) in tlc59108_led_blink()
108 gdc = delay_on * 256U / period; in tlc59108_led_blink()
116 * period = ((GFRQ + 1) / 24) in seconds. in tlc59108_led_blink()
117 * So, period (in ms) = (((GFRQ + 1) / 24) * 1000) -> in tlc59108_led_blink()
118 * GFRQ = ((period * 24 / 1000) - 1) in tlc59108_led_blink()
120 gfrq = (period * 24U / 1000) - 1; in tlc59108_led_blink()

12345678910>>...20