Lines Matching full:pwm
10 #include <zephyr/drivers/pwm.h>
20 /* 16-bit period cycles/prescaler in NPCX PWM modules */
24 /* PWM clock sources */
30 /* PWM heart-beat mode selection */
38 /* pwm controller base address */
48 /* PWM cycles per second */
52 /* PWM local functions */
58 /* Disable PWM for module configuration first */ in pwm_npcx_configure()
61 /* Set default PWM polarity to normal */ in pwm_npcx_configure()
64 /* Turn off PWM heart-beat mode */ in pwm_npcx_configure()
68 /* Select APB CLK/LFCLK clock sources to PWM module by default */ in pwm_npcx_configure()
80 /* PWM api functions */
85 /* Single channel for each pwm device */ in pwm_npcx_set_cycles()
98 /* Select PWM inverted polarity (ie. active-low pulse). */ in pwm_npcx_set_cycles()
105 /* If pulse_cycles is 0, switch PWM off and return. */ in pwm_npcx_set_cycles()
113 * Calculate PWM prescaler that let period_cycles map to in pwm_npcx_set_cycles()
114 * maximum pwm period cycles and won't exceed it. in pwm_npcx_set_cycles()
122 /* Set PWM prescaler. */ in pwm_npcx_set_cycles()
125 /* Set PWM period cycles. */ in pwm_npcx_set_cycles()
128 /* Set PWM pulse cycles. */ in pwm_npcx_set_cycles()
136 /* Disable PWM before configuring. */ in pwm_npcx_set_cycles()
143 /* Enable PWM now. */ in pwm_npcx_set_cycles()
157 /* Single channel for each pwm device */ in pwm_npcx_get_cycles_per_sec()
165 /* PWM driver registration */
166 static DEVICE_API(pwm, pwm_npcx_driver_api) = {
180 * NPCX PWM module mixes byte and word registers together. Make sure in pwm_npcx_init()
196 LOG_ERR("Turn on PWM clock fail %d", ret); in pwm_npcx_init()
203 LOG_ERR("Get PWM clock rate error %d", ret); in pwm_npcx_init()
207 /* Configure PWM device initially */ in pwm_npcx_init()
210 /* Configure pin-mux for PWM device */ in pwm_npcx_init()
213 LOG_ERR("PWM pinctrl setup failed (%d)", ret); in pwm_npcx_init()