Add pwm device
This commit is contained in:
parent
7d68083bd7
commit
319a73c2e7
@ -26,6 +26,9 @@ if GetDepend(['RT_USING_I2C']):
|
||||
if GetDepend('BSP_USING_HW_I2C3') or GetDepend('BSP_USING_HW_I2C6'):
|
||||
src += ['drv_i2c.c']
|
||||
|
||||
if GetDepend(['BSP_USING_PWM']):
|
||||
src += ['drv_pwm.c']
|
||||
|
||||
if GetDepend(['RT_USING_ADC']):
|
||||
src += ['drv_adc.c']
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-09-03 AisinoChip first implementation.
|
||||
* 2022-07-08 Rbb666 first implementation.
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
|
269
bsp/cypress/libraries/HAL_Drivers/drv_pwm.c
Normal file
269
bsp/cypress/libraries/HAL_Drivers/drv_pwm.c
Normal file
@ -0,0 +1,269 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2022-07-13 Rbb666 first version
|
||||
*/
|
||||
#include "drv_pwm.h"
|
||||
|
||||
#ifdef RT_USING_PWM
|
||||
|
||||
#include <drivers/rt_drv_pwm.h>
|
||||
#include "drv_gpio.h"
|
||||
|
||||
//#define DRV_DEBUG
|
||||
#define LOG_TAG "drv.pwm"
|
||||
#include <drv_log.h>
|
||||
|
||||
struct rt_device_pwm pwm_device;
|
||||
|
||||
struct ifx_pwm
|
||||
{
|
||||
struct rt_device_pwm pwm_device;
|
||||
cyhal_pwm_t *pwm_obj;
|
||||
rt_uint8_t channel;
|
||||
char *name;
|
||||
rt_uint8_t gpio;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
#ifdef BSP_USING_PWM0
|
||||
PWM0_INDEX,
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct ifx_pwm ifx_pwm_obj[] =
|
||||
{
|
||||
#ifdef BSP_USING_PWM0
|
||||
PWM0_CONFIG,
|
||||
#endif
|
||||
};
|
||||
|
||||
static void pwm_get_pin_number(void)
|
||||
{
|
||||
#ifdef BSP_USING_PWM0_CH7
|
||||
#ifdef BSP_USING_PWM0_PORT2
|
||||
ifx_pwm_obj[PWM0_INDEX].gpio = GET_PIN(2, 2);
|
||||
#endif
|
||||
#ifdef BSP_USING_PWM0_PORT5
|
||||
ifx_pwm_obj[PWM0_INDEX].gpio = GET_PIN(5, 6);
|
||||
#endif
|
||||
#ifdef BSP_USING_PWM0_PORT7
|
||||
ifx_pwm_obj[PWM0_INDEX].gpio = GET_PIN(7, 7);
|
||||
#endif
|
||||
#ifdef BSP_USING_PWM0_PORT9
|
||||
ifx_pwm_obj[PWM0_INDEX].gpio = GET_PIN(9, 4);
|
||||
#endif
|
||||
#ifdef BSP_USING_PWM0_PORT10
|
||||
ifx_pwm_obj[PWM0_INDEX].gpio = GET_PIN(10, 2);
|
||||
#endif
|
||||
#ifdef BSP_USING_PWM0_PORT12
|
||||
ifx_pwm_obj[PWM0_INDEX].gpio = GET_PIN(12, 6);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void pwm_get_channel(void)
|
||||
{
|
||||
#ifdef BSP_USING_PWM0_CH7
|
||||
ifx_pwm_obj[PWM0_INDEX].channel = 7;
|
||||
#endif
|
||||
}
|
||||
|
||||
static rt_err_t drv_pwm_enable(cyhal_pwm_t *htim, struct rt_pwm_configuration *configuration, rt_bool_t enable)
|
||||
{
|
||||
/* get the value of channel */
|
||||
rt_uint32_t channel = configuration->channel;
|
||||
|
||||
if (!configuration->complementary || configuration->complementary)
|
||||
{
|
||||
if (!enable)
|
||||
{
|
||||
if (channel == 7)
|
||||
{
|
||||
cyhal_pwm_stop(htim);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (channel == 7)
|
||||
{
|
||||
cyhal_pwm_start(htim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static rt_err_t drv_pwm_set(cyhal_pwm_t *htim, struct rt_pwm_configuration *configuration)
|
||||
{
|
||||
rt_uint64_t tim_clock;
|
||||
rt_uint32_t period, pulse;
|
||||
|
||||
tim_clock = (rt_uint32_t)(htim->tcpwm.clock_hz);
|
||||
|
||||
period = (unsigned long long)configuration->period / 1000ULL;
|
||||
|
||||
pulse = (unsigned long long)configuration->pulse / 1000ULL;
|
||||
|
||||
cyhal_pwm_set_period(htim, period, pulse);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static rt_err_t drv_pwm_get(cyhal_pwm_t *htim, struct rt_pwm_configuration *configuration)
|
||||
{
|
||||
uint32_t Period = Cy_TCPWM_PWM_GetPeriod0(htim->tcpwm.base, _CYHAL_TCPWM_CNT_NUMBER(htim->tcpwm.resource));
|
||||
|
||||
uint32_t Compare = Cy_TCPWM_PWM_GetCounter(htim->tcpwm.base, _CYHAL_TCPWM_CNT_NUMBER(htim->tcpwm.resource));
|
||||
|
||||
configuration->period = Period;
|
||||
|
||||
configuration->pulse = Compare;
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg)
|
||||
{
|
||||
struct rt_pwm_configuration *configuration = (struct rt_pwm_configuration *)arg;
|
||||
cyhal_pwm_t *htim = (cyhal_pwm_t *)device->parent.user_data;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case PWMN_CMD_ENABLE:
|
||||
configuration->complementary = RT_TRUE;
|
||||
case PWM_CMD_ENABLE:
|
||||
return drv_pwm_enable(htim, configuration, RT_TRUE);
|
||||
case PWMN_CMD_DISABLE:
|
||||
configuration->complementary = RT_FALSE;
|
||||
case PWM_CMD_DISABLE:
|
||||
return drv_pwm_enable(htim, configuration, RT_FALSE);
|
||||
case PWM_CMD_SET:
|
||||
return drv_pwm_set(htim, configuration);
|
||||
case PWM_CMD_GET:
|
||||
return drv_pwm_get(htim, configuration);
|
||||
default:
|
||||
return RT_EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static struct rt_pwm_ops drv_ops =
|
||||
{
|
||||
drv_pwm_control
|
||||
};
|
||||
|
||||
static rt_err_t ifx_hw_pwm_init(struct ifx_pwm *device)
|
||||
{
|
||||
rt_err_t result = RT_EOK;
|
||||
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
|
||||
/* config pwm channel */
|
||||
if (device->channel == 0x07)
|
||||
{
|
||||
if (cyhal_pwm_init_adv(device->pwm_obj, device->gpio, NC, CYHAL_PWM_LEFT_ALIGN, true, 0u, false, RT_NULL) != RT_EOK)
|
||||
{
|
||||
LOG_E("%s channel7 config failed", device->name);
|
||||
result = -RT_ERROR;
|
||||
goto __exit;
|
||||
}
|
||||
}
|
||||
|
||||
__exit:
|
||||
return result;
|
||||
}
|
||||
|
||||
static int rt_hw_pwm_init(void)
|
||||
{
|
||||
int i = 0;
|
||||
int result = RT_EOK;
|
||||
|
||||
pwm_get_pin_number();
|
||||
pwm_get_channel();
|
||||
|
||||
for (i = 0; i < sizeof(ifx_pwm_obj) / sizeof(ifx_pwm_obj[0]); i++)
|
||||
{
|
||||
ifx_pwm_obj[i].pwm_obj = rt_malloc(sizeof(cyhal_pwm_t));
|
||||
|
||||
/* pwm init */
|
||||
if (ifx_hw_pwm_init(&ifx_pwm_obj[i]) != RT_EOK)
|
||||
{
|
||||
LOG_E("%s init failed", ifx_pwm_obj[i].name);
|
||||
result = -RT_ERROR;
|
||||
goto __exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rt_device_pwm_register(&ifx_pwm_obj[i].pwm_device, ifx_pwm_obj[i].name, &drv_ops, ifx_pwm_obj[i].pwm_obj) == RT_EOK)
|
||||
{
|
||||
LOG_D("%s register success", ifx_pwm_obj[i].name);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_D("%s register failed", ifx_pwm_obj[i].name);
|
||||
result = -RT_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__exit:
|
||||
rt_free(ifx_pwm_obj[i].pwm_obj);
|
||||
return result;
|
||||
}
|
||||
INIT_BOARD_EXPORT(rt_hw_pwm_init);
|
||||
|
||||
#define PWM_DEV_NAME "pwm0"
|
||||
#define PWM_DEV_CHANNEL 7
|
||||
|
||||
struct rt_device_pwm *pwm_dev;
|
||||
|
||||
static int pwm_sample(int argc, char *argv[])
|
||||
{
|
||||
rt_uint32_t period, pulse, dir;
|
||||
|
||||
period = 500000;
|
||||
dir = 1;
|
||||
pulse = 0;
|
||||
|
||||
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
|
||||
if (pwm_dev == RT_NULL)
|
||||
{
|
||||
rt_kprintf("pwm sample run failed! can't find %s device!\n", PWM_DEV_NAME);
|
||||
return RT_ERROR;
|
||||
}
|
||||
|
||||
rt_pwm_set(pwm_dev, PWM_DEV_CHANNEL, period, pulse);
|
||||
rt_pwm_enable(pwm_dev, PWM_DEV_CHANNEL);
|
||||
|
||||
while (1)
|
||||
{
|
||||
rt_thread_mdelay(50);
|
||||
|
||||
if (dir)
|
||||
{
|
||||
pulse += 5000;
|
||||
}
|
||||
else
|
||||
{
|
||||
pulse -= 5000;
|
||||
}
|
||||
if (pulse >= period)
|
||||
{
|
||||
dir = 0;
|
||||
}
|
||||
if (0 == pulse)
|
||||
{
|
||||
dir = 1;
|
||||
}
|
||||
|
||||
rt_pwm_set(pwm_dev, PWM_DEV_CHANNEL, period, pulse);
|
||||
}
|
||||
}
|
||||
MSH_CMD_EXPORT(pwm_sample, <pwm0> channel7 sample);
|
||||
#endif
|
38
bsp/cypress/libraries/HAL_Drivers/drv_pwm.h
Normal file
38
bsp/cypress/libraries/HAL_Drivers/drv_pwm.h
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2022-03-10 leo first version
|
||||
*/
|
||||
|
||||
#ifndef __PWM_CONFIG_H__
|
||||
#define __PWM_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <board.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAX_PERIOD 65535
|
||||
|
||||
#ifdef BSP_USING_PWM0
|
||||
#ifndef PWM0_CONFIG
|
||||
#define PWM0_CONFIG \
|
||||
{ \
|
||||
.name = "pwm0", \
|
||||
.channel = 0, \
|
||||
.gpio = 0, \
|
||||
}
|
||||
#endif /* PWM0_CONFIG */
|
||||
#endif /* BSP_USING_PWM0 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -76,6 +76,13 @@ if GetDepend(['RT_USING_QSPI']):
|
||||
src += ['mtb_shared/serial-flash/cy_serial_flash_qspi.c']
|
||||
src += ['TARGET_CY8CKIT-062S2-43012/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c']
|
||||
|
||||
if GetDepend(['RT_USING_PWM']):
|
||||
src += ['mtb-hal-cat1/source/cyhal_pwm.c']
|
||||
src += ['mtb-hal-cat1/source/cyhal_timer.c']
|
||||
src += ['mtb-hal-cat1/source/cyhal_tcpwm_common.c']
|
||||
src += ['mtb-pdl-cat1/drivers/source/cy_tcpwm_pwm.c']
|
||||
src += ['mtb-pdl-cat1/drivers/source/cy_tcpwm_counter.c']
|
||||
|
||||
if GetDepend(['RT_USING_I2C']):
|
||||
src += ['mtb-hal-cat1/source/cyhal_i2c.c']
|
||||
|
||||
|
@ -119,7 +119,7 @@ CONFIG_DFS_FILESYSTEM_TYPES_MAX=4
|
||||
CONFIG_DFS_FD_MAX=16
|
||||
# CONFIG_RT_USING_DFS_MNTTABLE is not set
|
||||
# CONFIG_RT_USING_DFS_ELMFAT is not set
|
||||
# CONFIG_RT_USING_DFS_DEVFS is not set
|
||||
CONFIG_RT_USING_DFS_DEVFS=y
|
||||
# CONFIG_RT_USING_DFS_ROMFS is not set
|
||||
# CONFIG_RT_USING_DFS_RAMFS is not set
|
||||
# CONFIG_RT_USING_FAL is not set
|
||||
@ -138,25 +138,23 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64
|
||||
# CONFIG_RT_USING_CAN is not set
|
||||
# CONFIG_RT_USING_HWTIMER is not set
|
||||
# CONFIG_RT_USING_CPUTIME is not set
|
||||
CONFIG_RT_USING_I2C=y
|
||||
# CONFIG_RT_I2C_DEBUG is not set
|
||||
CONFIG_RT_USING_I2C_BITOPS=y
|
||||
CONFIG_RT_I2C_BITOPS_DEBUG=y
|
||||
# CONFIG_RT_USING_I2C is not set
|
||||
# CONFIG_RT_USING_PHY is not set
|
||||
CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_ADC is not set
|
||||
# CONFIG_RT_USING_DAC is not set
|
||||
# CONFIG_RT_USING_PWM is not set
|
||||
CONFIG_RT_USING_PWM=y
|
||||
# CONFIG_RT_USING_MTD_NOR is not set
|
||||
# CONFIG_RT_USING_MTD_NAND is not set
|
||||
# CONFIG_RT_USING_PM is not set
|
||||
# CONFIG_RT_USING_RTC is not set
|
||||
CONFIG_RT_USING_RTC=y
|
||||
# CONFIG_RT_USING_ALARM is not set
|
||||
# CONFIG_RT_USING_SOFT_RTC is not set
|
||||
# CONFIG_RT_USING_SDIO is not set
|
||||
# CONFIG_RT_USING_SPI is not set
|
||||
# CONFIG_RT_USING_WDT is not set
|
||||
# CONFIG_RT_USING_AUDIO is not set
|
||||
CONFIG_RT_USING_SENSOR=y
|
||||
CONFIG_RT_USING_SENSOR_CMD=y
|
||||
# CONFIG_RT_USING_SENSOR is not set
|
||||
# CONFIG_RT_USING_TOUCH is not set
|
||||
# CONFIG_RT_USING_HWCRYPTO is not set
|
||||
# CONFIG_RT_USING_PULSE_ENCODER is not set
|
||||
@ -179,18 +177,19 @@ CONFIG_RT_LIBC_DEFAULT_TIMEZONE=8
|
||||
# POSIX (Portable Operating System Interface) layer
|
||||
#
|
||||
CONFIG_RT_USING_POSIX_FS=y
|
||||
# CONFIG_RT_USING_POSIX_DEVIO is not set
|
||||
# CONFIG_RT_USING_POSIX_STDIO is not set
|
||||
CONFIG_RT_USING_POSIX_DEVIO=y
|
||||
CONFIG_RT_USING_POSIX_STDIO=y
|
||||
# CONFIG_RT_USING_POSIX_POLL is not set
|
||||
# CONFIG_RT_USING_POSIX_SELECT is not set
|
||||
# CONFIG_RT_USING_POSIX_SOCKET is not set
|
||||
# CONFIG_RT_USING_POSIX_TERMIOS is not set
|
||||
# CONFIG_RT_USING_POSIX_AIO is not set
|
||||
# CONFIG_RT_USING_POSIX_MMAN is not set
|
||||
# CONFIG_RT_USING_POSIX_DELAY is not set
|
||||
# CONFIG_RT_USING_POSIX_CLOCK is not set
|
||||
CONFIG_RT_USING_POSIX_DELAY=y
|
||||
CONFIG_RT_USING_POSIX_CLOCK=y
|
||||
# CONFIG_RT_USING_POSIX_TIMER is not set
|
||||
# CONFIG_RT_USING_PTHREADS is not set
|
||||
CONFIG_RT_USING_PTHREADS=y
|
||||
CONFIG_PTHREAD_NUM_MAX=8
|
||||
# CONFIG_RT_USING_MODULE is not set
|
||||
|
||||
#
|
||||
@ -521,68 +520,7 @@ CONFIG_RT_USING_POSIX_FS=y
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
#
|
||||
CONFIG_PKG_USING_SENSORS_DRIVERS=y
|
||||
# CONFIG_PKG_USING_FINGERPRINT is not set
|
||||
# CONFIG_PKG_USING_LSM6DSM is not set
|
||||
# CONFIG_PKG_USING_LSM6DSL is not set
|
||||
# CONFIG_PKG_USING_LPS22HB is not set
|
||||
# CONFIG_PKG_USING_HTS221 is not set
|
||||
# CONFIG_PKG_USING_LSM303AGR is not set
|
||||
# CONFIG_PKG_USING_BME280 is not set
|
||||
# CONFIG_PKG_USING_BME680 is not set
|
||||
# CONFIG_PKG_USING_BMA400 is not set
|
||||
# CONFIG_PKG_USING_BMI160_BMX160 is not set
|
||||
# CONFIG_PKG_USING_SPL0601 is not set
|
||||
# CONFIG_PKG_USING_MS5805 is not set
|
||||
# CONFIG_PKG_USING_DA270 is not set
|
||||
# CONFIG_PKG_USING_DF220 is not set
|
||||
# CONFIG_PKG_USING_HSHCAL001 is not set
|
||||
# CONFIG_PKG_USING_BH1750 is not set
|
||||
CONFIG_PKG_USING_MPU6XXX=y
|
||||
CONFIG_PKG_MPU6XXX_PATH="/packages/peripherals/sensors/mpu6xxx"
|
||||
# CONFIG_PKG_USING_MPU6XXX_V001 is not set
|
||||
# CONFIG_PKG_USING_MPU6XXX_V100 is not set
|
||||
# CONFIG_PKG_USING_MPU6XXX_V110 is not set
|
||||
CONFIG_PKG_USING_MPU6XXX_LATEST_VERSION=y
|
||||
CONFIG_PKG_MPU6XXX_VER="latest"
|
||||
CONFIG_PKG_USING_MPU6XXX_ACCE=y
|
||||
CONFIG_PKG_USING_MPU6XXX_GYRO=y
|
||||
CONFIG_PKG_USING_MPU6XXX_MAG=y
|
||||
# CONFIG_PKG_USING_AHT10 is not set
|
||||
# CONFIG_PKG_USING_AP3216C is not set
|
||||
# CONFIG_PKG_USING_TSL4531 is not set
|
||||
# CONFIG_PKG_USING_DS18B20 is not set
|
||||
# CONFIG_PKG_USING_DHT11 is not set
|
||||
# CONFIG_PKG_USING_DHTXX is not set
|
||||
# CONFIG_PKG_USING_GY271 is not set
|
||||
# CONFIG_PKG_USING_GP2Y10 is not set
|
||||
# CONFIG_PKG_USING_SGP30 is not set
|
||||
# CONFIG_PKG_USING_HDC1000 is not set
|
||||
# CONFIG_PKG_USING_BMP180 is not set
|
||||
# CONFIG_PKG_USING_BMP280 is not set
|
||||
# CONFIG_PKG_USING_SHTC1 is not set
|
||||
# CONFIG_PKG_USING_BMI088 is not set
|
||||
# CONFIG_PKG_USING_HMC5883 is not set
|
||||
# CONFIG_PKG_USING_MAX6675 is not set
|
||||
# CONFIG_PKG_USING_TMP1075 is not set
|
||||
# CONFIG_PKG_USING_SR04 is not set
|
||||
# CONFIG_PKG_USING_CCS811 is not set
|
||||
# CONFIG_PKG_USING_PMSXX is not set
|
||||
# CONFIG_PKG_USING_RT3020 is not set
|
||||
# CONFIG_PKG_USING_MLX90632 is not set
|
||||
# CONFIG_PKG_USING_MLX90393 is not set
|
||||
# CONFIG_PKG_USING_MS5611 is not set
|
||||
# CONFIG_PKG_USING_MAX31865 is not set
|
||||
# CONFIG_PKG_USING_VL53L0X is not set
|
||||
# CONFIG_PKG_USING_INA260 is not set
|
||||
# CONFIG_PKG_USING_MAX30102 is not set
|
||||
# CONFIG_PKG_USING_INA226 is not set
|
||||
# CONFIG_PKG_USING_LIS2DH12 is not set
|
||||
# CONFIG_PKG_USING_HS300X is not set
|
||||
# CONFIG_PKG_USING_ZMOD4410 is not set
|
||||
# CONFIG_PKG_USING_ISL29035 is not set
|
||||
# CONFIG_PKG_USING_MMC3680KJ is not set
|
||||
# CONFIG_PKG_USING_QMP6989 is not set
|
||||
# CONFIG_PKG_USING_SENSORS_DRIVERS is not set
|
||||
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
|
||||
# CONFIG_PKG_USING_SHT2X is not set
|
||||
# CONFIG_PKG_USING_SHT3X is not set
|
||||
@ -753,18 +691,24 @@ CONFIG_BSP_USING_USB_TO_USART=y
|
||||
#
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
CONFIG_BSP_USING_UART=y
|
||||
# CONFIG_BSP_USING_UART0 is not set
|
||||
# CONFIG_BSP_USING_UART1 is not set
|
||||
# CONFIG_BSP_USING_UART2 is not set
|
||||
# CONFIG_BSP_USING_UART3 is not set
|
||||
# CONFIG_BSP_USING_UART4 is not set
|
||||
CONFIG_BSP_USING_UART5=y
|
||||
CONFIG_BSP_USING_UART2=y
|
||||
CONFIG_BSP_USING_PWM=y
|
||||
CONFIG_BSP_USING_PWM0=y
|
||||
CONFIG_BSP_USING_PWM0_CH7=y
|
||||
# CONFIG_BSP_USING_PWM0_PORT2 is not set
|
||||
# CONFIG_BSP_USING_PWM0_PORT5 is not set
|
||||
# CONFIG_BSP_USING_PWM0_PORT7 is not set
|
||||
CONFIG_BSP_USING_PWM0_PORT9=y
|
||||
# CONFIG_BSP_USING_PWM0_PORT10 is not set
|
||||
# CONFIG_BSP_USING_PWM0_PORT12 is not set
|
||||
# CONFIG_BSP_USING_ADC is not set
|
||||
# CONFIG_BSP_USING_QSPI_FLASH is not set
|
||||
CONFIG_BSP_USING_HW_I2C=y
|
||||
CONFIG_BSP_USING_HW_I2C1=y
|
||||
|
||||
#
|
||||
# Notice: P6_0 --> 48; P6_1 --> 49
|
||||
#
|
||||
CONFIG_BSP_I2C1_SCL_PIN=48
|
||||
CONFIG_BSP_I2C1_SDA_PIN=49
|
||||
# CONFIG_BSP_USING_HW_I2C is not set
|
||||
# CONFIG_BSP_USING_I2C is not set
|
||||
|
||||
#
|
||||
|
@ -49,6 +49,51 @@ menu "On-chip Peripheral Drivers"
|
||||
default y
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM
|
||||
bool "Enable PWM"
|
||||
default n
|
||||
select RT_USING_PWM
|
||||
if BSP_USING_PWM
|
||||
menuconfig BSP_USING_PWM0
|
||||
bool "Enable timer0 output pwm"
|
||||
default n
|
||||
if BSP_USING_PWM0
|
||||
menuconfig BSP_USING_PWM0_CH7
|
||||
bool "Enable PWM0 channel7"
|
||||
default n
|
||||
if BSP_USING_PWM0_CH7
|
||||
config BSP_USING_PWM0_PORT2
|
||||
bool "Enable PWM0-PORT2 output pwm"
|
||||
default n
|
||||
endif
|
||||
if BSP_USING_PWM0_CH7
|
||||
config BSP_USING_PWM0_PORT5
|
||||
bool "Enable PWM0-PORT5 output pwm"
|
||||
default n
|
||||
endif
|
||||
if BSP_USING_PWM0_CH7
|
||||
config BSP_USING_PWM0_PORT7
|
||||
bool "Enable PWM0-PORT7 output pwm"
|
||||
default n
|
||||
endif
|
||||
if BSP_USING_PWM0_CH7
|
||||
config BSP_USING_PWM0_PORT9
|
||||
bool "Enable PWM0-PORT9 output pwm"
|
||||
default n
|
||||
endif
|
||||
if BSP_USING_PWM0_CH7
|
||||
config BSP_USING_PWM0_PORT10
|
||||
bool "Enable PWM0-PORT10 output pwm"
|
||||
default n
|
||||
endif
|
||||
if BSP_USING_PWM0_CH7
|
||||
config BSP_USING_PWM0_PORT12
|
||||
bool "Enable PWM0-PORT12 output pwm"
|
||||
default n
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_ADC
|
||||
bool "Enable ADC"
|
||||
default n
|
||||
|
Loading…
x
Reference in New Issue
Block a user