Lines Matching +full:pin +full:- +full:location
4 * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/dt-bindings/pwm/pwm.h>
21 uint8_t location; member
23 uint8_t pin; member
31 const struct pwm_gecko_config *cfg = dev->config; in pwm_gecko_set_cycles()
33 if (BUS_RegMaskedRead(&cfg->timer->CC[channel].CTRL, in pwm_gecko_set_cycles()
37 BUS_RegMaskedWrite(&cfg->timer->ROUTE, in pwm_gecko_set_cycles()
39 cfg->location << _TIMER_ROUTE_LOCATION_SHIFT); in pwm_gecko_set_cycles()
40 BUS_RegMaskedSet(&cfg->timer->ROUTE, 1 << channel); in pwm_gecko_set_cycles()
42 BUS_RegMaskedWrite(&cfg->timer->ROUTELOC0, in pwm_gecko_set_cycles()
45 cfg->location << (channel * _TIMER_ROUTELOC0_CC1LOC_SHIFT)); in pwm_gecko_set_cycles()
46 BUS_RegMaskedSet(&cfg->timer->ROUTEPEN, 1 << channel); in pwm_gecko_set_cycles()
52 TIMER_InitCC(cfg->timer, channel, &compare_config); in pwm_gecko_set_cycles()
55 cfg->timer->CC[channel].CTRL |= (flags & PWM_POLARITY_INVERTED) ? in pwm_gecko_set_cycles()
58 TIMER_TopSet(cfg->timer, period_cycles); in pwm_gecko_set_cycles()
60 TIMER_CompareBufSet(cfg->timer, channel, pulse_cycles); in pwm_gecko_set_cycles()
68 const struct pwm_gecko_config *cfg = dev->config; in pwm_gecko_get_cycles_per_sec()
70 *cycles = CMU_ClockFreqGet(cfg->clock) / cfg->prescaler; in pwm_gecko_get_cycles_per_sec()
83 const struct pwm_gecko_config *cfg = dev->config; in pwm_gecko_init()
85 CMU_ClockEnable(cfg->clock, true); in pwm_gecko_init()
88 GPIO_PinModeSet(cfg->port, cfg->pin, gpioModePushPull, 0); in pwm_gecko_init()
90 timer.prescale = cfg->prescale_enum; in pwm_gecko_init()
91 TIMER_Init(cfg->timer, &timer); in pwm_gecko_init()
107 .location = DT_INST_PROP_BY_IDX(index, pin_location, 0), \
110 .pin = DT_INST_PROP_BY_IDX(index, pin_location, 2), \