2020-03-11 18:13:06 -04:00
|
|
|
/*
|
|
|
|
* This file is part of the MicroPython project, http://micropython.org/
|
|
|
|
*
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
|
|
|
* Copyright (c) 2019 Lucian Copeland for Adafruit Industries
|
|
|
|
* Uses code from Micropython, Copyright (c) 2013-2016 Damien P. George
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "py/runtime.h"
|
2020-08-18 16:08:33 -04:00
|
|
|
#include "common-hal/pwmio/PWMOut.h"
|
|
|
|
#include "shared-bindings/pwmio/PWMOut.h"
|
2020-03-11 18:13:06 -04:00
|
|
|
|
2020-04-24 09:44:51 -04:00
|
|
|
#include STM32_HAL_H
|
2020-07-22 14:11:00 -04:00
|
|
|
#include "shared-bindings/microcontroller/Pin.h"
|
2020-03-11 18:13:06 -04:00
|
|
|
|
2020-07-01 10:07:45 -04:00
|
|
|
#include "timers.h"
|
|
|
|
|
2022-11-13 18:17:47 -05:00
|
|
|
// Bitmask of channels taken.
|
|
|
|
STATIC uint8_t tim_channels_taken[TIM_BANK_ARRAY_LEN];
|
|
|
|
// Initial frequency timer is set to.
|
2020-03-11 18:13:06 -04:00
|
|
|
STATIC uint32_t tim_frequencies[TIM_BANK_ARRAY_LEN];
|
2023-02-17 19:13:18 -05:00
|
|
|
STATIC uint8_t never_reset_tim[TIM_BANK_ARRAY_LEN];
|
|
|
|
STATIC TIM_HandleTypeDef *active_handles[TIM_BANK_ARRAY_LEN];
|
2020-03-11 18:13:06 -04:00
|
|
|
|
|
|
|
STATIC uint32_t timer_get_internal_duty(uint16_t duty, uint32_t period) {
|
2021-03-15 09:57:36 -04:00
|
|
|
// duty cycle is duty/0xFFFF fraction x (number of pulses per period)
|
2022-11-13 18:17:47 -05:00
|
|
|
return (duty * period) / 0xffff;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
|
2021-03-19 11:04:46 -04:00
|
|
|
STATIC bool timer_get_optimal_divisors(uint32_t *period, uint32_t *prescaler,
|
2021-03-15 09:57:36 -04:00
|
|
|
uint32_t frequency, uint32_t source_freq) {
|
|
|
|
// Find the largest possible period supported by this frequency
|
2022-11-13 18:17:47 -05:00
|
|
|
*prescaler = 0;
|
|
|
|
for (uint32_t i = 1; i <= 0xffff; i++) {
|
2020-03-11 18:13:06 -04:00
|
|
|
*period = source_freq / (i * frequency);
|
2022-11-13 18:17:47 -05:00
|
|
|
if (*period <= 0xffff && *period >= 2) {
|
2020-03-11 18:13:06 -04:00
|
|
|
*prescaler = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2021-03-19 11:04:46 -04:00
|
|
|
// Return success or failure.
|
2021-03-11 08:52:47 -05:00
|
|
|
return *prescaler != 0;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void pwmout_reset(void) {
|
|
|
|
for (int i = 0; i < TIM_BANK_ARRAY_LEN; i++) {
|
2023-02-17 19:13:18 -05:00
|
|
|
if (active_handles[i] == NULL) {
|
|
|
|
continue;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
2023-02-17 19:13:18 -05:00
|
|
|
for (int c = 0; c < 8; c++) {
|
|
|
|
if ((never_reset_tim[i] & (1 << c)) != 0 ||
|
|
|
|
(tim_channels_taken[i] & (1 << c)) == 0) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
HAL_TIM_PWM_Stop(active_handles[i], c);
|
|
|
|
}
|
|
|
|
// TODO: Actually shut down individual channels and PWM.
|
|
|
|
if (never_reset_tim[i] != 0) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
tim_channels_taken[i] = 0x00;
|
|
|
|
tim_frequencies[i] = 0;
|
|
|
|
stm_peripherals_timer_free(mcu_tim_banks[i]);
|
|
|
|
HAL_TIM_PWM_DeInit(active_handles[i]);
|
|
|
|
active_handles[i] = NULL;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self,
|
|
|
|
const mcu_pin_obj_t *pin,
|
|
|
|
uint16_t duty,
|
|
|
|
uint32_t frequency,
|
|
|
|
bool variable_frequency) {
|
2022-11-13 18:17:47 -05:00
|
|
|
// Default error is no timer at all on pin.
|
|
|
|
pwmout_result_t last_failure = PWMOUT_INVALID_PIN;
|
2020-03-11 18:13:06 -04:00
|
|
|
bool first_time_setup = true;
|
|
|
|
|
2022-11-13 18:17:47 -05:00
|
|
|
uint8_t tim_index;
|
|
|
|
uint8_t tim_channel_index;
|
|
|
|
|
|
|
|
self->tim = NULL;
|
|
|
|
for (uint i = 0; i < MP_ARRAY_SIZE(mcu_tim_pin_list); i++) {
|
|
|
|
const mcu_tim_pin_obj_t *tim = &mcu_tim_pin_list[i];
|
|
|
|
tim_index = tim->tim_index;
|
|
|
|
tim_channel_index = tim->channel_index;
|
2020-03-11 18:13:06 -04:00
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
// if pin is same
|
2022-11-13 18:17:47 -05:00
|
|
|
if (tim->pin == pin) {
|
2021-03-15 09:57:36 -04:00
|
|
|
// check if the timer has a channel active, or is reserved by main timer system
|
2022-11-13 18:17:47 -05:00
|
|
|
if (tim_index < TIM_BANK_ARRAY_LEN && tim_channels_taken[tim_index] != 0) {
|
2020-07-01 10:07:45 -04:00
|
|
|
// Timer has already been reserved by an internal module
|
2022-11-13 18:17:47 -05:00
|
|
|
if (stm_peripherals_timer_is_reserved(mcu_tim_banks[tim_index])) {
|
|
|
|
last_failure = PWMOUT_ALL_TIMERS_ON_PIN_IN_USE;
|
2021-03-15 09:57:36 -04:00
|
|
|
continue; // keep looking
|
2020-07-01 10:07:45 -04:00
|
|
|
}
|
2021-03-15 09:57:36 -04:00
|
|
|
// is it the same channel? (or all channels reserved by a var-freq)
|
2022-11-13 18:17:47 -05:00
|
|
|
if (tim_channels_taken[tim_index] & (1 << tim_channel_index)) {
|
|
|
|
last_failure = PWMOUT_ALL_TIMERS_ON_PIN_IN_USE;
|
2021-03-15 09:57:36 -04:00
|
|
|
continue; // keep looking, might be another viable option
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
2021-03-15 09:57:36 -04:00
|
|
|
// If the frequencies are the same it's ok
|
2022-11-13 18:17:47 -05:00
|
|
|
if (tim_frequencies[tim_index] != frequency) {
|
|
|
|
last_failure = PWMOUT_INVALID_FREQUENCY_ON_PIN;
|
2021-03-15 09:57:36 -04:00
|
|
|
continue; // keep looking
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
2021-03-15 09:57:36 -04:00
|
|
|
// you can't put a variable frequency on a partially reserved timer
|
2020-03-11 18:13:06 -04:00
|
|
|
if (variable_frequency) {
|
2022-11-13 18:17:47 -05:00
|
|
|
last_failure = PWMOUT_VARIABLE_FREQUENCY_NOT_AVAILABLE;
|
2021-03-15 09:57:36 -04:00
|
|
|
continue; // keep looking
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
2021-03-15 09:57:36 -04:00
|
|
|
first_time_setup = false; // skip setting up the timer
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
2021-03-15 09:57:36 -04:00
|
|
|
// No problems taken, so set it up
|
2022-11-13 18:17:47 -05:00
|
|
|
self->tim = tim;
|
2020-03-11 18:13:06 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-13 18:17:47 -05:00
|
|
|
TIM_TypeDef *TIMx;
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
// handle valid/invalid timer instance
|
2020-03-11 18:13:06 -04:00
|
|
|
if (self->tim != NULL) {
|
2021-03-15 09:57:36 -04:00
|
|
|
// create instance
|
2022-11-13 18:17:47 -05:00
|
|
|
TIMx = mcu_tim_banks[tim_index];
|
2021-03-15 09:57:36 -04:00
|
|
|
// reserve timer/channel
|
2020-03-11 18:13:06 -04:00
|
|
|
if (variable_frequency) {
|
2022-11-13 18:17:47 -05:00
|
|
|
// Take all the channels.
|
|
|
|
tim_channels_taken[tim_index] = 0x0F;
|
2020-03-11 18:13:06 -04:00
|
|
|
} else {
|
2022-11-13 18:17:47 -05:00
|
|
|
tim_channels_taken[tim_index] |= 1 << tim_channel_index;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
2022-11-13 18:17:47 -05:00
|
|
|
tim_frequencies[tim_index] = frequency;
|
2020-07-01 10:07:45 -04:00
|
|
|
stm_peripherals_timer_reserve(TIMx);
|
2022-11-13 18:17:47 -05:00
|
|
|
} else {
|
|
|
|
// no match found
|
|
|
|
return last_failure;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
|
2021-07-21 19:27:09 -04:00
|
|
|
uint32_t prescaler = 0; // prescaler is 15 bit
|
|
|
|
uint32_t period = 0; // period is 16 bit
|
|
|
|
uint32_t source_freq = stm_peripherals_timer_get_source_freq(TIMx);
|
|
|
|
if (!timer_get_optimal_divisors(&period, &prescaler, frequency, source_freq)) {
|
|
|
|
return PWMOUT_INVALID_FREQUENCY;
|
|
|
|
}
|
|
|
|
|
2020-03-11 18:13:06 -04:00
|
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
|
GPIO_InitStruct.Pin = pin_mask(pin->number);
|
|
|
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
|
|
|
GPIO_InitStruct.Alternate = self->tim->altfn_index;
|
|
|
|
HAL_GPIO_Init(pin_port(pin->port), &GPIO_InitStruct);
|
2021-07-21 19:27:09 -04:00
|
|
|
self->pin = pin;
|
2020-03-11 18:13:06 -04:00
|
|
|
|
2022-11-13 18:17:47 -05:00
|
|
|
tim_clock_enable(1 << tim_index);
|
2020-03-11 18:13:06 -04:00
|
|
|
|
2022-11-13 18:17:47 -05:00
|
|
|
// translate channel into handle value: TIM_CHANNEL_1, _2, _3, _4.
|
|
|
|
self->channel = 4 * tim_channel_index;
|
2020-03-11 18:13:06 -04:00
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
// Timer init
|
2020-03-11 18:13:06 -04:00
|
|
|
self->handle.Instance = TIMx;
|
|
|
|
self->handle.Init.Period = period - 1;
|
|
|
|
self->handle.Init.Prescaler = prescaler - 1;
|
|
|
|
self->handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
|
|
|
self->handle.Init.CounterMode = TIM_COUNTERMODE_UP;
|
|
|
|
self->handle.Init.RepetitionCounter = 0;
|
2022-11-13 18:17:47 -05:00
|
|
|
self->handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
2020-03-11 18:13:06 -04:00
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
// only run init if this is the first instance of this timer
|
2020-03-11 18:13:06 -04:00
|
|
|
if (first_time_setup) {
|
|
|
|
if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) {
|
2021-03-11 08:52:47 -05:00
|
|
|
return PWMOUT_INITIALIZATION_ERROR;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
2023-02-17 19:13:18 -05:00
|
|
|
active_handles[tim_index] = &self->handle;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
|
2021-04-30 11:47:37 -04:00
|
|
|
// Channel/PWM init
|
2020-03-11 18:13:06 -04:00
|
|
|
self->chan_handle.OCMode = TIM_OCMODE_PWM1;
|
|
|
|
self->chan_handle.Pulse = timer_get_internal_duty(duty, period);
|
|
|
|
self->chan_handle.OCPolarity = TIM_OCPOLARITY_HIGH;
|
|
|
|
self->chan_handle.OCFastMode = TIM_OCFAST_DISABLE;
|
|
|
|
if (HAL_TIM_PWM_ConfigChannel(&self->handle, &self->chan_handle, self->channel) != HAL_OK) {
|
2021-03-11 08:52:47 -05:00
|
|
|
return PWMOUT_INITIALIZATION_ERROR;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
if (HAL_TIM_PWM_Start(&self->handle, self->channel) != HAL_OK) {
|
2021-03-11 08:52:47 -05:00
|
|
|
return PWMOUT_INITIALIZATION_ERROR;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
self->variable_frequency = variable_frequency;
|
|
|
|
self->frequency = frequency;
|
|
|
|
self->duty_cycle = duty;
|
|
|
|
self->period = period;
|
|
|
|
|
|
|
|
return PWMOUT_OK;
|
|
|
|
}
|
|
|
|
|
2020-08-18 16:08:33 -04:00
|
|
|
void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) {
|
2020-03-11 18:13:06 -04:00
|
|
|
for (size_t i = 0; i < TIM_BANK_ARRAY_LEN; i++) {
|
|
|
|
if (mcu_tim_banks[i] == self->handle.Instance) {
|
|
|
|
never_reset_tim[i] = true;
|
2021-07-21 19:27:09 -04:00
|
|
|
common_hal_never_reset_pin(self->pin);
|
2020-03-11 18:13:06 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t *self) {
|
2020-03-11 18:13:06 -04:00
|
|
|
return self->tim == NULL;
|
|
|
|
}
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) {
|
2020-08-18 16:08:33 -04:00
|
|
|
if (common_hal_pwmio_pwmout_deinited(self)) {
|
2020-03-11 18:13:06 -04:00
|
|
|
return;
|
|
|
|
}
|
2021-03-15 09:57:36 -04:00
|
|
|
// var freq shuts down entire timer, others just their channel
|
2020-03-11 18:13:06 -04:00
|
|
|
if (self->variable_frequency) {
|
2022-11-13 18:17:47 -05:00
|
|
|
tim_channels_taken[self->tim->tim_index] = 0x00;
|
2020-03-11 18:13:06 -04:00
|
|
|
} else {
|
2022-11-13 18:17:47 -05:00
|
|
|
tim_channels_taken[self->tim->tim_index] &= ~(1 << self->tim->channel_index);
|
2020-03-11 18:13:06 -04:00
|
|
|
HAL_TIM_PWM_Stop(&self->handle, self->channel);
|
|
|
|
}
|
2021-07-21 19:27:09 -04:00
|
|
|
common_hal_reset_pin(self->pin);
|
2020-03-11 18:13:06 -04:00
|
|
|
|
2023-02-17 19:13:18 -05:00
|
|
|
never_reset_tim[self->tim->tim_index] &= ~(1 << self->tim->channel_index);
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
// if reserved timer has no active channels, we can disable it
|
2022-11-13 18:17:47 -05:00
|
|
|
if (tim_channels_taken[self->tim->tim_index] == 0) {
|
2021-07-21 19:27:09 -04:00
|
|
|
tim_frequencies[self->tim->tim_index] = 0x00;
|
2023-02-17 19:13:18 -05:00
|
|
|
HAL_TIM_PWM_DeInit(&self->handle);
|
|
|
|
active_handles[self->tim->tim_index] = NULL;
|
2020-07-22 13:58:57 -04:00
|
|
|
stm_peripherals_timer_free(self->handle.Instance);
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
2020-08-24 17:59:13 -04:00
|
|
|
|
|
|
|
self->tim = NULL;
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t duty) {
|
2020-03-11 18:13:06 -04:00
|
|
|
uint32_t internal_duty_cycle = timer_get_internal_duty(duty, self->period);
|
|
|
|
__HAL_TIM_SET_COMPARE(&self->handle, self->channel, internal_duty_cycle);
|
|
|
|
self->duty_cycle = duty;
|
|
|
|
}
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t *self) {
|
2020-03-11 18:13:06 -04:00
|
|
|
return self->duty_cycle;
|
|
|
|
}
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t frequency) {
|
|
|
|
// don't halt setup for the same frequency
|
2020-03-11 18:13:06 -04:00
|
|
|
if (frequency == self->frequency) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t prescaler = 0;
|
|
|
|
uint32_t period = 0;
|
2020-07-01 10:07:45 -04:00
|
|
|
uint32_t source_freq = stm_peripherals_timer_get_source_freq(self->handle.Instance);
|
|
|
|
timer_get_optimal_divisors(&period, &prescaler, frequency, source_freq);
|
2020-03-11 18:13:06 -04:00
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
// shut down
|
2020-03-11 18:13:06 -04:00
|
|
|
HAL_TIM_PWM_Stop(&self->handle, self->channel);
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
// Only change altered values
|
2020-03-11 18:13:06 -04:00
|
|
|
self->handle.Init.Period = period - 1;
|
|
|
|
self->handle.Init.Prescaler = prescaler - 1;
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
// restart everything, adjusting for new speed
|
2020-03-11 18:13:06 -04:00
|
|
|
if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) {
|
2022-05-20 10:10:55 -04:00
|
|
|
mp_raise_RuntimeError(translate("timer re-init"));
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
self->chan_handle.Pulse = timer_get_internal_duty(self->duty_cycle, period);
|
|
|
|
|
|
|
|
if (HAL_TIM_PWM_ConfigChannel(&self->handle, &self->chan_handle, self->channel) != HAL_OK) {
|
2022-05-20 10:10:55 -04:00
|
|
|
mp_raise_RuntimeError(translate("channel re-init"));
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
if (HAL_TIM_PWM_Start(&self->handle, self->channel) != HAL_OK) {
|
2022-05-20 10:10:55 -04:00
|
|
|
mp_raise_RuntimeError(translate("PWM restart"));
|
2020-03-11 18:13:06 -04:00
|
|
|
}
|
|
|
|
|
2021-07-21 19:27:09 -04:00
|
|
|
tim_frequencies[self->tim->tim_index] = frequency;
|
2020-03-11 18:13:06 -04:00
|
|
|
self->frequency = frequency;
|
|
|
|
self->period = period;
|
|
|
|
}
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self) {
|
2020-03-11 18:13:06 -04:00
|
|
|
return self->frequency;
|
|
|
|
}
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self) {
|
2020-03-11 18:13:06 -04:00
|
|
|
return self->variable_frequency;
|
|
|
|
}
|
2021-07-21 19:27:09 -04:00
|
|
|
|
|
|
|
const mcu_pin_obj_t *common_hal_pwmio_pwmout_get_pin(pwmio_pwmout_obj_t *self) {
|
|
|
|
return self->pin;
|
|
|
|
}
|