Lines Matching +full:max +full:- +full:load +full:- +full:value

4  * SPDX-License-Identifier: Apache-2.0
29 * prescaler. Count is set to (2^24 - 2) to allow for a glitch free 100% duty
30 * cycle at max. period count.
46 static void write_value(const struct pwm_cc13xx_cc26xx_config *config, uint32_t value, in write_value() argument
49 /* Upper byte represents the prescaler value. */ in write_value()
50 uint8_t prescaleValue = 0xff & (value >> 16); in write_value()
52 HWREG(config->gpt_base + prescale_register) = prescaleValue; in write_value()
54 /* The remaining bytes represent the load / match value. */ in write_value()
55 HWREG(config->gpt_base + value_register) = value & 0xffff; in write_value()
64 TimerDisable(config->gpt_base, TIMER_B); in set_period_and_pulse()
74 return -EINVAL; in set_period_and_pulse()
78 if (period < (match_value - 1) || (match_value < 0)) { in set_period_and_pulse()
80 return -EINVAL; in set_period_and_pulse()
91 TimerEnable(config->gpt_base, TIMER_B); in set_period_and_pulse()
101 const struct pwm_cc13xx_cc26xx_config *config = dev->config; in set_cycles()
104 return -EIO; in set_cycles()
108 HWREG(config->gpt_base + GPT_O_CTL) |= GPT_CTL_TBPWML_INVERTED; in set_cycles()
110 HWREG(config->gpt_base + GPT_O_CTL) |= GPT_CTL_TBPWML_NORMAL; in set_cycles()
121 return -EIO; in get_cycles_per_sec()
139 switch (config->gpt_base) { in get_timer_inst_number()
155 switch (config->gpt_base) { in get_timer_peripheral()
172 const struct pwm_cc13xx_cc26xx_config *config = dev->config; in init_pwm()
173 pinctrl_soc_pin_t pin = config->pcfg->states[0].pins[0]; in init_pwm()
188 /* Load PRCM settings. */ in init_pwm()
195 ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); in init_pwm()
214 TimerDisable(config->gpt_base, TIMER_B); in init_pwm()
216 HWREG(config->gpt_base + GPT_O_CFG) = GPT_CFG_CFG_16BIT_TIMER; in init_pwm()
221 HWREG(config->gpt_base + GPT_O_CTL) |= GPT_CTL_TBSTALL; in init_pwm()
223 HWREG(config->gpt_base + GPT_O_TBMR) = GPT_TBMR_TBAMS_PWM | GPT_TBMR_TBMRSU_TOUPDATE | in init_pwm()