[bsp][lpc55sxx] update pwm driver

This commit is contained in:
螺丝松掉的人 authored and GitHub committed 2023-02-28 17:37:09 -05:00
1 parent 75c3261181
commit 3a08336cb5
6 files changed
+226 -65

No files matched your search

File diff suppressed because it is too large. Load diff
-2
View File
@@ -14,6 +14,4 @@
#include <rtdevice.h>
int rt_hw_pwm_init(void);
#endif
@@ -29,8 +29,8 @@ const pin_map_t pin_map_table[]=
{D3, GET_PINS(1,6)},
{D4, GET_PINS(1,7), "pwm2", 2}, /* PWM */
{D5, GET_PINS(1,4), "pwm2", 1}, /* PWM */
{D6, GET_PINS(1,10)},
{D7, GET_PINS(1,9), "pwm1", 0}, /* PWM */
{D6, GET_PINS(1,10), "pwm1", 0}, /* PWM */
{D7, GET_PINS(1,9)},
{D8, GET_PINS(1,8)},
{D9, GET_PINS(1,5)},
{D10, GET_PINS(1,1)},
+1 -11
View File
@@ -212,21 +212,13 @@ menu "On-chip Peripheral Drivers"
default y
if BSP_USING_PWM
config BSP_USING_CTIMER0_MAT3
bool "Enable CIMER0 Match3 as PWM output"
default y
config BSP_USING_CTIMER1_MAT0
bool "Enable CIMER1 Match0 as PWM output"
default y
config BSP_USING_CTIMER1_MAT3
bool "Enable CIMER1 Match3 as PWM output"
default n
config BSP_USING_CTIMER2_MAT0
bool "Enable CIMER2 Match0 as PWM output"
default y
default n
config BSP_USING_CTIMER2_MAT1
bool "Enable CIMER2 Match1 as PWM output"
@@ -272,11 +264,9 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_ADC0
select BSP_USING_PWM
select BSP_USING_CTIMER1_MAT0
select BSP_USING_CTIMER1_MAT3
select BSP_USING_CTIMER2_MAT0
select BSP_USING_CTIMER2_MAT1
select BSP_USING_CTIMER2_MAT2
select BSP_USING_CTIMER3_MAT2
select BSP_USING_I2C
select BSP_USING_I2C1
imply RTDUINO_USING_SERVO
@@ -338,13 +338,26 @@ void BOARD_InitPins(void)
(~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))
/* Selects pin function.
* : PORT17 (pin 9) is configured as PIO1_7. */
| IOCON_PIO_FUNC(PIO1_7_FUNC_ALT0)
* : PORT17 (pin 9) is configured as CTIMER2_MAT2. */
| IOCON_PIO_FUNC(PIO1_7_FUNC_ALT3)
/* Select Digital mode.
* : Digital mode, digital input is enabled. */
| IOCON_PIO_DIGIMODE(PIO1_7_DIGIMODE_DIGITAL));
IOCON->PIO[1][10] = ((IOCON->PIO[1][10] &
/* Mask bits to zero which are setting */
(~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))
/* Selects pin function.
* : PORT110 (pin 40) is configured as CTIMER1_MAT0. */
| IOCON_PIO_FUNC(PIO1_10_FUNC_ALT3)
/* Select Digital mode.
* : Enable Digital mode.
* Digital input is enabled. */
| IOCON_PIO_DIGIMODE(PIO1_10_DIGIMODE_DIGITAL));
/* I2C4 */
IOCON_PinMuxSet(IOCON, 1U, 20, 5 | IOCON_PIO_MODE_INACT | IOCON_PIO_SLEW_STANDARD | IOCON_PIO_INV_DI | IOCON_PIO_DIGITAL_EN | IOCON_PIO_OPENDRAIN_DI);
IOCON_PinMuxSet(IOCON, 1U, 21, 5 | IOCON_PIO_MODE_INACT | IOCON_PIO_SLEW_STANDARD | IOCON_PIO_INV_DI | IOCON_PIO_DIGITAL_EN | IOCON_PIO_OPENDRAIN_DI);
@@ -174,8 +174,14 @@ void BOARD_InitBootPins(void);
* @brief Select Digital mode.: Digital mode, digital input is enabled. */
#define PIO1_7_DIGIMODE_DIGITAL 0x01u
/*!
* @brief Selects pin function.: Alternative connection 0. */
#define PIO1_7_FUNC_ALT0 0x00u
* @brief Selects pin function.: Alternative connection 3. */
#define PIO1_7_FUNC_ALT3 0x03u
/*!
* @brief Select Digital mode.: Enable Digital mode. Digital input is enabled. */
#define PIO1_10_DIGIMODE_DIGITAL 0x01u
/*!
* @brief Selects pin function.: Alternative connection 3. */
#define PIO1_10_FUNC_ALT3 0x03u
/*!
* @brief Configures pin routing and optionally pin electrical features.