2019-01-29 04:48:26 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019, Aurelien Jarno
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <init.h>
|
|
|
|
|
2020-03-31 02:21:26 +08:00
|
|
|
#if defined CONFIG_PWM && DT_HAS_NODE(DT_INST(0, atmel_sam_pwm))
|
2019-01-29 04:48:26 +08:00
|
|
|
/* PWM on EXT1 connector, pin 7, channel 0, inverted */
|
|
|
|
static const struct soc_gpio_pin pwm_ext1_pin7 = {
|
|
|
|
PIO_PA0A_PWM0_PWMH0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A
|
|
|
|
};
|
|
|
|
|
|
|
|
/* PWM on EXT2 connector, pin 7, channel 2, inverted */
|
|
|
|
static const struct soc_gpio_pin pwm_ext2_pin7 = {
|
|
|
|
PIO_PC19B_PWM0_PWMH2, PIOC, ID_PIOC, SOC_GPIO_FUNC_B
|
|
|
|
};
|
|
|
|
|
|
|
|
/* PWM on EXT2 connector, pin 8, channel 2, non-inverted */
|
|
|
|
static const struct soc_gpio_pin pwm_ext2_pin8 = {
|
|
|
|
PIO_PD26A_PWM0_PWML2, PIOD, ID_PIOD, SOC_GPIO_FUNC_A
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static int sam_e70_xplained_init(struct device *dev)
|
|
|
|
{
|
|
|
|
ARG_UNUSED(dev);
|
|
|
|
|
2020-03-31 02:21:26 +08:00
|
|
|
#if defined CONFIG_PWM && DT_HAS_NODE(DT_INST(0, atmel_sam_pwm))
|
2019-01-29 04:48:26 +08:00
|
|
|
soc_gpio_configure(&pwm_ext1_pin7);
|
|
|
|
soc_gpio_configure(&pwm_ext2_pin7);
|
|
|
|
soc_gpio_configure(&pwm_ext2_pin8);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SYS_INIT(sam_e70_xplained_init, PRE_KERNEL_1, 0);
|