[bsp][lpc55sxx]update Kconfig default and delete drv_led drv_key

This commit is contained in:
rose_man 2023-05-18 13:41:57 +08:00 committed by Man, Jianting (Meco)
parent 606ad9272b
commit c349fe68b8
10 changed files with 67 additions and 521 deletions

View File

@ -7,12 +7,6 @@ src = []
if GetDepend('BSP_USING_PIN'): if GetDepend('BSP_USING_PIN'):
src += ['drv_pin.c'] src += ['drv_pin.c']
if GetDepend('BSP_USING_LED'):
src += ['drv_led.c']
if GetDepend('BSP_USING_KEY'):
src += ['drv_key.c']
if GetDepend('BSP_USING_UART'): if GetDepend('BSP_USING_UART'):
src += ['drv_uart.c'] src += ['drv_uart.c']

View File

@ -1,168 +0,0 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-07-19 Magicoe The first version for LPC55S6x, refered github.com/Guozhanxin/RTT-BeepPlayer-pkg
*/
#include <rtthread.h>
#include "rtconfig.h"
#include "fsl_common.h"
#include "fsl_iocon.h"
#include "fsl_gpio.h"
#include "fsl_inputmux.h"
#include "drv_key.h"
/**** Debug ****/
#define DBG_ENABLE
#define DBG_SECTION_NAME "button"
#define DBG_LEVEL DBG_INFO
#define DBG_COLOR
#include <rtdbg.h>
#define MY_BUTTON_CALL(func, argv) \
do { if ((func) != RT_NULL) func argv; } while (0)
struct my_button_manage
{
rt_uint8_t num;
rt_timer_t timer;
struct my_button *button_list[MY_BUTTON_LIST_MAX];
};
static struct my_button_manage button_manage;
int my_button_register(struct my_button *button)
{
if (button->press_logic_level == 0)
{
rt_pin_mode(button->pin, PIN_MODE_INPUT_PULLUP);
}
else
{
rt_pin_mode(button->pin, PIN_MODE_INPUT_PULLDOWN);
}
button->cnt = 0;
button->event = BUTTON_EVENT_NONE;
button_manage.button_list[button_manage.num++] = button;
return 0;
}
static void my_button_scan(void *param)
{
rt_uint8_t i;
rt_uint16_t cnt_old;
for (i = 0; i < button_manage.num; i++)
{
cnt_old = button_manage.button_list[i]->cnt;
if (rt_pin_read(button_manage.button_list[i]->pin) == button_manage.button_list[i]->press_logic_level)
{
button_manage.button_list[i]->cnt ++;
if (button_manage.button_list[i]->cnt == MY_BUTTON_DOWN_MS / MY_BUTTON_SCAN_SPACE_MS) /* BUTTON_DOWN */
{
LOG_D("BUTTON_DOWN");
button_manage.button_list[i]->event = BUTTON_EVENT_CLICK_DOWN;
MY_BUTTON_CALL(button_manage.button_list[i]->cb, (button_manage.button_list[i]));
}
else if (button_manage.button_list[i]->cnt == MY_BUTTON_HOLD_MS / MY_BUTTON_SCAN_SPACE_MS) /* BUTTON_HOLD */
{
LOG_D("BUTTON_HOLD");
button_manage.button_list[i]->event = BUTTON_EVENT_HOLD;
MY_BUTTON_CALL(button_manage.button_list[i]->cb, (button_manage.button_list[i]));
}
else if (button_manage.button_list[i]->cnt > MY_BUTTON_HOLD_MS / MY_BUTTON_SCAN_SPACE_MS) /* BUTTON_HOLD_CYC */
{
LOG_D("BUTTON_HOLD_CYC");
button_manage.button_list[i]->event = BUTTON_EVENT_HOLD_CYC;
if (button_manage.button_list[i]->hold_cyc_period && button_manage.button_list[i]->cnt % (button_manage.button_list[i]->hold_cyc_period / MY_BUTTON_SCAN_SPACE_MS) == 0)
MY_BUTTON_CALL(button_manage.button_list[i]->cb, (button_manage.button_list[i]));
}
}
else
{
button_manage.button_list[i]->cnt = 0;
if (cnt_old >= MY_BUTTON_DOWN_MS / MY_BUTTON_SCAN_SPACE_MS && cnt_old < MY_BUTTON_HOLD_MS / MY_BUTTON_SCAN_SPACE_MS) /* BUTTON_CLICK_UP */
{
LOG_D("BUTTON_CLICK_UP");
button_manage.button_list[i]->event = BUTTON_EVENT_CLICK_UP;
MY_BUTTON_CALL(button_manage.button_list[i]->cb, (button_manage.button_list[i]));
}
else if (cnt_old >= MY_BUTTON_HOLD_MS / MY_BUTTON_SCAN_SPACE_MS) /* BUTTON_HOLD_UP */
{
LOG_D("BUTTON_HOLD_UP");
button_manage.button_list[i]->event = BUTTON_EVENT_HOLD_UP;
MY_BUTTON_CALL(button_manage.button_list[i]->cb, (button_manage.button_list[i]));
}
}
}
}
int my_button_start(void)
{
if (button_manage.timer != RT_NULL)
return -1;
/* Create Timer 1 */
button_manage.timer = rt_timer_create("timer1", /* Timer name is: timer1 */
my_button_scan, /* Timeout callback func */
RT_NULL, /* Timeout func entry */
RT_TICK_PER_SECOND * MY_BUTTON_SCAN_SPACE_MS / 1000,
RT_TIMER_FLAG_PERIODIC | RT_TIMER_FLAG_SOFT_TIMER);
/* Start Timer */
if (button_manage.timer != RT_NULL)
rt_timer_start(button_manage.timer);
return 0;
}
#ifdef RT_USING_FINSH
#include <finsh.h>
#ifdef FINSH_USING_MSH
#define KEY_PIN 51
#define KEY_PRESS_VALUE 0
void key_cb(struct my_button *button)
{
switch (button->event)
{
case BUTTON_EVENT_CLICK_UP:
rt_kprintf("This is click up callback!\n");
break;
case BUTTON_EVENT_HOLD_CYC:
rt_kprintf("This is hold cyc callback!\n");
break;
default:
;
}
}
void key_test(rt_uint32_t led_num, rt_uint32_t value)
{
/* user app entry */
static struct my_button key = {0};
key.press_logic_level = KEY_PRESS_VALUE;
key.hold_cyc_period = 100;
key.cb = (my_button_callback)key_cb;
key.pin = KEY_PIN;
my_button_register(&key);
my_button_start();
}
MSH_CMD_EXPORT(key_test, key_test);
#endif /* FINSH_USING_MSH */
#endif /* RT_USING_FINSH */

View File

@ -1,51 +0,0 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-07-19 Magicoe The first version for LPC55S6x, refered github.com/Guozhanxin/RTT-BeepPlayer-pkg
*/
#ifndef __DRV_KEY_H__
#define __DRV_KEY_H__
#include <rtthread.h>
#include <rtdevice.h>
#define MY_BUTTON_DOWN_MS 50
#define MY_BUTTON_HOLD_MS 700
#define MY_BUTTON_SCAN_SPACE_MS 20
#define MY_BUTTON_LIST_MAX 10
typedef void (*my_button_callback)(void*);
enum my_button_event
{
BUTTON_EVENT_CLICK_DOWN,
BUTTON_EVENT_CLICK_UP,
BUTTON_EVENT_HOLD,
BUTTON_EVENT_HOLD_CYC,
BUTTON_EVENT_HOLD_UP,
BUTTON_EVENT_NONE
};
struct my_button
{
rt_uint8_t press_logic_level;
rt_uint16_t cnt;
rt_uint16_t hold_cyc_period;
rt_uint16_t pin;
enum my_button_event event;
my_button_callback cb;
};
int my_button_register(struct my_button *button);
int my_button_start(void);
#endif

View File

@ -1,160 +0,0 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-07-19 Magicoe The first version for LPC55S6x
*/
#include <rtthread.h>
#include "rtconfig.h"
#include "fsl_common.h"
#include "fsl_iocon.h"
#include "fsl_gpio.h"
#include "fsl_inputmux.h"
#define LED_DEVICE_CTRL 0x81 /*LED control command*/
#define LED_NUM 2
struct led_ctrl
{
uint8_t port;
uint32_t pin;
};
struct lpc_led
{
/* inherit from rt_device */
struct rt_device parent;
struct led_ctrl ctrl[LED_NUM];
};
static struct lpc_led led;
static rt_err_t rt_led_init(rt_device_t dev)
{
gpio_pin_config_t pin_config = {kGPIO_DigitalOutput, 1};
GPIO_PinInit(GPIO, 1, 7, &pin_config);
GPIO_PinInit(GPIO, 1, 6, &pin_config);
led.ctrl[0].pin = 7;
led.ctrl[0].port = 1;
led.ctrl[1].pin = 6;
led.ctrl[1].port = 1;
return RT_EOK;
}
static rt_err_t rt_led_open(rt_device_t dev, rt_uint16_t oflag)
{
return RT_EOK;
}
static rt_err_t rt_led_close(rt_device_t dev)
{
return RT_EOK;
}
static rt_ssize_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer,
rt_size_t size)
{
rt_ubase_t index = 0;
rt_ubase_t nr = size;
rt_uint8_t *value = buffer;
RT_ASSERT(dev == &led.parent);
RT_ASSERT((pos + size) <= LED_NUM);
for (index = 0; index < nr; index++)
{
if(GPIO_PinRead(GPIO, led.ctrl[pos + index].port, led.ctrl[pos + index].pin) == 0)
{
*value = 0;
}
else
{
*value = 1;
}
value++;
}
return index;
}
static rt_ssize_t rt_led_write(rt_device_t dev, rt_off_t pos,
const void *buffer, rt_size_t size)
{
rt_ubase_t index = 0;
rt_ubase_t nw = size;
const rt_uint8_t *value = buffer;
RT_ASSERT(dev == &led.parent);
RT_ASSERT((pos + size) <= LED_NUM);
for (index = 0; index < nw; index++)
{
if (*value++)
{
GPIO_PinWrite(GPIO, led.ctrl[pos + index].port, led.ctrl[pos + index].pin, 0);
}
else
{
GPIO_PinWrite(GPIO, led.ctrl[pos + index].port, led.ctrl[pos + index].pin, 1);
}
}
return index;
}
static rt_err_t rt_led_control(rt_device_t dev, int cmd, void *args)
{
RT_ASSERT(dev == &led.parent);
if (cmd == LED_DEVICE_CTRL)
{
rt_uint32_t *led_num = args;
*led_num = LED_NUM;
}
return RT_EOK;
}
int rt_hw_led_init(void)
{
led.parent.type = RT_Device_Class_Char;
led.parent.rx_indicate = RT_NULL;
led.parent.tx_complete = RT_NULL;
led.parent.init = rt_led_init;
led.parent.open = rt_led_open;
led.parent.close = rt_led_close;
led.parent.read = rt_led_read;
led.parent.write = rt_led_write;
led.parent.control = rt_led_control;
led.parent.user_data = RT_NULL;
/* register a character device */
rt_device_register(&led.parent, "led", RT_DEVICE_FLAG_RDWR);
/* init led device */
rt_led_init(&led.parent);
return 0;
}
INIT_DEVICE_EXPORT(rt_hw_led_init);
#ifdef RT_USING_FINSH
#include <finsh.h>
#include "msh.h"
void led_test(rt_uint32_t led_num, rt_uint32_t value)
{
rt_uint8_t led_value = value;
rt_led_write(&led.parent, led_num, &led_value, 1);
}
FINSH_FUNCTION_EXPORT(led_test, e.g: led_test(0, 1).);
#endif

View File

@ -1,19 +0,0 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-07-19 Magicoe The first version for LPC55S6x
*/
#ifndef __DRV_LED_H__
#define __DRV_LED_H__
#include <rtthread.h>
#include <rtdevice.h>
int rt_hw_led_init(void);
#endif

View File

@ -64,12 +64,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_I2C config BSP_USING_I2C
bool "Enable I2C" bool "Enable I2C"
select RT_USING_I2C select RT_USING_I2C
default y default n
if BSP_USING_I2C if BSP_USING_I2C
config BSP_USING_I2C1 config BSP_USING_I2C1
bool "Enable Flexcomm1 I2C" bool "Enable Flexcomm1 I2C"
default y default n
if BSP_USING_I2C1 if BSP_USING_I2C1
choice choice
prompt "Select I2C1 badurate" prompt "Select I2C1 badurate"
@ -85,7 +85,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_I2C4 config BSP_USING_I2C4
bool "Enable Flexcomm4 I2C" bool "Enable Flexcomm4 I2C"
default y default n
if BSP_USING_I2C4 if BSP_USING_I2C4
choice choice
prompt "Select I2C4 badurate" prompt "Select I2C4 badurate"
@ -104,7 +104,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_SPI config BSP_USING_SPI
bool "Enable SPI" bool "Enable SPI"
select RT_USING_SPI select RT_USING_SPI
default y default n
if BSP_USING_SPI if BSP_USING_SPI
config BSP_USING_SPI3 config BSP_USING_SPI3
@ -113,19 +113,19 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_SPI8 config BSP_USING_SPI8
bool "Enable Flexcomm8 as High Speed SPI" bool "Enable Flexcomm8 as High Speed SPI"
default y default n
endif endif
menuconfig BSP_USING_ADC menuconfig BSP_USING_ADC
config BSP_USING_ADC config BSP_USING_ADC
bool "Enable ADC Channel" bool "Enable ADC Channel"
select RT_USING_ADC select RT_USING_ADC
default y default n
if BSP_USING_ADC if BSP_USING_ADC
config BSP_USING_ADC0_CH0 config BSP_USING_ADC0_CH0
bool "Enable ADC0 Channel0" bool "Enable ADC0 Channel0"
default y default n
config BSP_USING_ADC0_CH1 config BSP_USING_ADC0_CH1
bool "Enable ADC0 Channel1" bool "Enable ADC0 Channel1"
@ -137,12 +137,12 @@ menu "On-chip Peripheral Drivers"
select RT_USING_SDIO select RT_USING_SDIO
select RT_USING_DFS select RT_USING_DFS
select RT_USING_DFS_ELMFAT select RT_USING_DFS_ELMFAT
default y default n
config BSP_USING_RTC config BSP_USING_RTC
bool "Enable RTC" bool "Enable RTC"
select RT_USING_RTC select RT_USING_RTC
default y default n
config BSP_USING_WDT config BSP_USING_WDT
bool "Enable WatchDog" bool "Enable WatchDog"
@ -153,12 +153,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_HWTIMER config BSP_USING_HWTIMER
bool "Enable Timer" bool "Enable Timer"
select RT_USING_HWTIMER select RT_USING_HWTIMER
default y default n
if BSP_USING_HWTIMER if BSP_USING_HWTIMER
config BSP_USING_CTIMER0 config BSP_USING_CTIMER0
bool "Enable CIMER0" bool "Enable CIMER0"
default y default n
config BSP_USING_CTIMER1 config BSP_USING_CTIMER1
bool "Enable CIMER1" bool "Enable CIMER1"
@ -177,12 +177,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_PWM config BSP_USING_PWM
bool "Enable PWM" bool "Enable PWM"
select RT_USING_PWM select RT_USING_PWM
default y default n
if BSP_USING_PWM if BSP_USING_PWM
config BSP_USING_CTIMER2_MAT0 config BSP_USING_CTIMER2_MAT0
bool "Enable CIMER2 Match0 as PWM output" bool "Enable CIMER2 Match0 as PWM output"
default y default n
config BSP_USING_CTIMER2_MAT1 config BSP_USING_CTIMER2_MAT1
bool "Enable CIMER2 Match1 as PWM output" bool "Enable CIMER2 Match1 as PWM output"
@ -195,20 +195,10 @@ menu "On-chip Peripheral Drivers"
endmenu endmenu
menu "Onboard Peripheral Drivers" menu "Onboard Peripheral Drivers"
config BSP_USING_LED
bool "Enable RGB LED"
select RT_USING_LED
default y
config BSP_USING_KEY
bool "Enable Button "
select RT_USING_KEY
default y
config BSP_USING_MMA8562 config BSP_USING_MMA8562
bool "Enable MMA8562" bool "Enable MMA8562"
select BSP_USING_I2C4 select BSP_USING_I2C4
default y default n
if BSP_USING_MMA8562 if BSP_USING_MMA8562
config BSP_USING_MMA8562I2C config BSP_USING_MMA8562I2C
string "the device name for 3-Axis Sensor" string "the device name for 3-Axis Sensor"

View File

@ -64,12 +64,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_I2C config BSP_USING_I2C
bool "Enable I2C" bool "Enable I2C"
select RT_USING_I2C select RT_USING_I2C
default y default n
if BSP_USING_I2C if BSP_USING_I2C
config BSP_USING_I2C1 config BSP_USING_I2C1
bool "Enable Flexcomm1 I2C" bool "Enable Flexcomm1 I2C"
default y default n
if BSP_USING_I2C1 if BSP_USING_I2C1
choice choice
prompt "Select I2C1 badurate" prompt "Select I2C1 badurate"
@ -85,7 +85,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_I2C4 config BSP_USING_I2C4
bool "Enable Flexcomm4 I2C" bool "Enable Flexcomm4 I2C"
default y default n
if BSP_USING_I2C4 if BSP_USING_I2C4
choice choice
prompt "Select I2C4 badurate" prompt "Select I2C4 badurate"
@ -104,7 +104,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_SPI config BSP_USING_SPI
bool "Enable SPI" bool "Enable SPI"
select RT_USING_SPI select RT_USING_SPI
default y default n
if BSP_USING_SPI if BSP_USING_SPI
config BSP_USING_SPI3 config BSP_USING_SPI3
@ -113,19 +113,19 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_SPI8 config BSP_USING_SPI8
bool "Enable Flexcomm8 as High Speed SPI" bool "Enable Flexcomm8 as High Speed SPI"
default y default n
endif endif
menuconfig BSP_USING_ADC menuconfig BSP_USING_ADC
config BSP_USING_ADC config BSP_USING_ADC
bool "Enable ADC Channel" bool "Enable ADC Channel"
select RT_USING_ADC select RT_USING_ADC
default y default n
if BSP_USING_ADC if BSP_USING_ADC
config BSP_USING_ADC0_CH0 config BSP_USING_ADC0_CH0
bool "Enable ADC0 Channel0" bool "Enable ADC0 Channel0"
default y default n
config BSP_USING_ADC0_CH1 config BSP_USING_ADC0_CH1
bool "Enable ADC0 Channel1" bool "Enable ADC0 Channel1"
@ -137,12 +137,12 @@ menu "On-chip Peripheral Drivers"
select RT_USING_SDIO select RT_USING_SDIO
select RT_USING_DFS select RT_USING_DFS
select RT_USING_DFS_ELMFAT select RT_USING_DFS_ELMFAT
default y default n
config BSP_USING_RTC config BSP_USING_RTC
bool "Enable RTC" bool "Enable RTC"
select RT_USING_RTC select RT_USING_RTC
default y default n
config BSP_USING_WDT config BSP_USING_WDT
bool "Enable WatchDog" bool "Enable WatchDog"
@ -153,12 +153,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_HWTIMER config BSP_USING_HWTIMER
bool "Enable Timer" bool "Enable Timer"
select RT_USING_HWTIMER select RT_USING_HWTIMER
default y default n
if BSP_USING_HWTIMER if BSP_USING_HWTIMER
config BSP_USING_CTIMER0 config BSP_USING_CTIMER0
bool "Enable CIMER0" bool "Enable CIMER0"
default y default n
config BSP_USING_CTIMER1 config BSP_USING_CTIMER1
bool "Enable CIMER1" bool "Enable CIMER1"
@ -177,12 +177,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_PWM config BSP_USING_PWM
bool "Enable PWM" bool "Enable PWM"
select RT_USING_PWM select RT_USING_PWM
default y default n
if BSP_USING_PWM if BSP_USING_PWM
config BSP_USING_CTIMER2_MAT0 config BSP_USING_CTIMER2_MAT0
bool "Enable CIMER2 Match0 as PWM output" bool "Enable CIMER2 Match0 as PWM output"
default y default n
config BSP_USING_CTIMER2_MAT1 config BSP_USING_CTIMER2_MAT1
bool "Enable CIMER2 Match1 as PWM output" bool "Enable CIMER2 Match1 as PWM output"
@ -195,20 +195,10 @@ menu "On-chip Peripheral Drivers"
endmenu endmenu
menu "Onboard Peripheral Drivers" menu "Onboard Peripheral Drivers"
config BSP_USING_LED
bool "Enable RGB LED"
select RT_USING_LED
default y
config BSP_USING_KEY
bool "Enable Button "
select RT_USING_KEY
default y
config BSP_USING_MMA8562 config BSP_USING_MMA8562
bool "Enable MMA8562" bool "Enable MMA8562"
select BSP_USING_I2C4 select BSP_USING_I2C4
default y default n
if BSP_USING_MMA8562 if BSP_USING_MMA8562
config BSP_USING_MMA8562I2C config BSP_USING_MMA8562I2C
string "the device name for 3-Axis Sensor" string "the device name for 3-Axis Sensor"

View File

@ -64,12 +64,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_I2C config BSP_USING_I2C
bool "Enable I2C" bool "Enable I2C"
select RT_USING_I2C select RT_USING_I2C
default y default n
if BSP_USING_I2C if BSP_USING_I2C
config BSP_USING_I2C1 config BSP_USING_I2C1
bool "Enable Flexcomm1 I2C" bool "Enable Flexcomm1 I2C"
default y default n
if BSP_USING_I2C1 if BSP_USING_I2C1
choice choice
prompt "Select I2C1 badurate" prompt "Select I2C1 badurate"
@ -85,7 +85,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_I2C4 config BSP_USING_I2C4
bool "Enable Flexcomm4 I2C" bool "Enable Flexcomm4 I2C"
default y default n
if BSP_USING_I2C4 if BSP_USING_I2C4
choice choice
prompt "Select I2C4 badurate" prompt "Select I2C4 badurate"
@ -104,7 +104,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_SPI config BSP_USING_SPI
bool "Enable SPI" bool "Enable SPI"
select RT_USING_SPI select RT_USING_SPI
default y default n
if BSP_USING_SPI if BSP_USING_SPI
config BSP_USING_SPI3 config BSP_USING_SPI3
@ -113,19 +113,19 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_SPI8 config BSP_USING_SPI8
bool "Enable Flexcomm8 as High Speed SPI" bool "Enable Flexcomm8 as High Speed SPI"
default y default n
endif endif
menuconfig BSP_USING_ADC menuconfig BSP_USING_ADC
config BSP_USING_ADC config BSP_USING_ADC
bool "Enable ADC Channel" bool "Enable ADC Channel"
select RT_USING_ADC select RT_USING_ADC
default y default n
if BSP_USING_ADC if BSP_USING_ADC
config BSP_USING_ADC0_CH0 config BSP_USING_ADC0_CH0
bool "Enable ADC0 Channel0" bool "Enable ADC0 Channel0"
default y default n
config BSP_USING_ADC0_CH1 config BSP_USING_ADC0_CH1
bool "Enable ADC0 Channel1" bool "Enable ADC0 Channel1"
@ -137,12 +137,12 @@ menu "On-chip Peripheral Drivers"
select RT_USING_SDIO select RT_USING_SDIO
select RT_USING_DFS select RT_USING_DFS
select RT_USING_DFS_ELMFAT select RT_USING_DFS_ELMFAT
default y default n
config BSP_USING_RTC config BSP_USING_RTC
bool "Enable RTC" bool "Enable RTC"
select RT_USING_RTC select RT_USING_RTC
default y default n
config BSP_USING_WDT config BSP_USING_WDT
bool "Enable WatchDog" bool "Enable WatchDog"
@ -153,12 +153,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_HWTIMER config BSP_USING_HWTIMER
bool "Enable Timer" bool "Enable Timer"
select RT_USING_HWTIMER select RT_USING_HWTIMER
default y default n
if BSP_USING_HWTIMER if BSP_USING_HWTIMER
config BSP_USING_CTIMER0 config BSP_USING_CTIMER0
bool "Enable CIMER0" bool "Enable CIMER0"
default y default n
config BSP_USING_CTIMER1 config BSP_USING_CTIMER1
bool "Enable CIMER1" bool "Enable CIMER1"
@ -177,12 +177,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_PWM config BSP_USING_PWM
bool "Enable PWM" bool "Enable PWM"
select RT_USING_PWM select RT_USING_PWM
default y default n
if BSP_USING_PWM if BSP_USING_PWM
config BSP_USING_CTIMER2_MAT0 config BSP_USING_CTIMER2_MAT0
bool "Enable CIMER2 Match0 as PWM output" bool "Enable CIMER2 Match0 as PWM output"
default y default n
config BSP_USING_CTIMER2_MAT1 config BSP_USING_CTIMER2_MAT1
bool "Enable CIMER2 Match1 as PWM output" bool "Enable CIMER2 Match1 as PWM output"
@ -195,20 +195,10 @@ menu "On-chip Peripheral Drivers"
endmenu endmenu
menu "Onboard Peripheral Drivers" menu "Onboard Peripheral Drivers"
config BSP_USING_LED
bool "Enable RGB LED"
select RT_USING_LED
default y
config BSP_USING_KEY
bool "Enable Button "
select RT_USING_KEY
default y
config BSP_USING_MMA8562 config BSP_USING_MMA8562
bool "Enable MMA8562" bool "Enable MMA8562"
select BSP_USING_I2C4 select BSP_USING_I2C4
default y default n
if BSP_USING_MMA8562 if BSP_USING_MMA8562
config BSP_USING_MMA8562I2C config BSP_USING_MMA8562I2C
string "the device name for 3-Axis Sensor" string "the device name for 3-Axis Sensor"

View File

@ -64,12 +64,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_I2C config BSP_USING_I2C
bool "Enable I2C" bool "Enable I2C"
select RT_USING_I2C select RT_USING_I2C
default y default n
if BSP_USING_I2C if BSP_USING_I2C
config BSP_USING_I2C1 config BSP_USING_I2C1
bool "Enable Flexcomm1 I2C" bool "Enable Flexcomm1 I2C"
default y default n
if BSP_USING_I2C1 if BSP_USING_I2C1
choice choice
prompt "Select I2C1 badurate" prompt "Select I2C1 badurate"
@ -85,7 +85,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_I2C4 config BSP_USING_I2C4
bool "Enable Flexcomm4 I2C" bool "Enable Flexcomm4 I2C"
default y default n
if BSP_USING_I2C4 if BSP_USING_I2C4
choice choice
prompt "Select I2C4 badurate" prompt "Select I2C4 badurate"
@ -104,7 +104,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_SPI config BSP_USING_SPI
bool "Enable SPI" bool "Enable SPI"
select RT_USING_SPI select RT_USING_SPI
default y default n
if BSP_USING_SPI if BSP_USING_SPI
config BSP_USING_SPI3 config BSP_USING_SPI3
@ -113,19 +113,19 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_SPI8 config BSP_USING_SPI8
bool "Enable Flexcomm8 as High Speed SPI" bool "Enable Flexcomm8 as High Speed SPI"
default y default n
endif endif
menuconfig BSP_USING_ADC menuconfig BSP_USING_ADC
config BSP_USING_ADC config BSP_USING_ADC
bool "Enable ADC Channel" bool "Enable ADC Channel"
select RT_USING_ADC select RT_USING_ADC
default y default n
if BSP_USING_ADC if BSP_USING_ADC
config BSP_USING_ADC0_CH0 config BSP_USING_ADC0_CH0
bool "Enable ADC0 Channel0" bool "Enable ADC0 Channel0"
default y default n
config BSP_USING_ADC0_CH1 config BSP_USING_ADC0_CH1
bool "Enable ADC0 Channel1" bool "Enable ADC0 Channel1"
@ -137,12 +137,12 @@ menu "On-chip Peripheral Drivers"
select RT_USING_SDIO select RT_USING_SDIO
select RT_USING_DFS select RT_USING_DFS
select RT_USING_DFS_ELMFAT select RT_USING_DFS_ELMFAT
default y default n
config BSP_USING_RTC config BSP_USING_RTC
bool "Enable RTC" bool "Enable RTC"
select RT_USING_RTC select RT_USING_RTC
default y default n
config BSP_USING_WDT config BSP_USING_WDT
bool "Enable WatchDog" bool "Enable WatchDog"
@ -153,12 +153,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_HWTIMER config BSP_USING_HWTIMER
bool "Enable Timer" bool "Enable Timer"
select RT_USING_HWTIMER select RT_USING_HWTIMER
default y default n
if BSP_USING_HWTIMER if BSP_USING_HWTIMER
config BSP_USING_CTIMER0 config BSP_USING_CTIMER0
bool "Enable CIMER0" bool "Enable CIMER0"
default y default n
config BSP_USING_CTIMER1 config BSP_USING_CTIMER1
bool "Enable CIMER1" bool "Enable CIMER1"
@ -177,12 +177,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_PWM config BSP_USING_PWM
bool "Enable PWM" bool "Enable PWM"
select RT_USING_PWM select RT_USING_PWM
default y default n
if BSP_USING_PWM if BSP_USING_PWM
config BSP_USING_CTIMER2_MAT0 config BSP_USING_CTIMER2_MAT0
bool "Enable CIMER2 Match0 as PWM output" bool "Enable CIMER2 Match0 as PWM output"
default y default n
config BSP_USING_CTIMER2_MAT1 config BSP_USING_CTIMER2_MAT1
bool "Enable CIMER2 Match1 as PWM output" bool "Enable CIMER2 Match1 as PWM output"
@ -195,20 +195,10 @@ menu "On-chip Peripheral Drivers"
endmenu endmenu
menu "Onboard Peripheral Drivers" menu "Onboard Peripheral Drivers"
config BSP_USING_LED
bool "Enable RGB LED"
select RT_USING_LED
default y
config BSP_USING_KEY
bool "Enable Button "
select RT_USING_KEY
default y
config BSP_USING_MMA8562 config BSP_USING_MMA8562
bool "Enable MMA8562" bool "Enable MMA8562"
select BSP_USING_I2C4 select BSP_USING_I2C4
default y default n
if BSP_USING_MMA8562 if BSP_USING_MMA8562
config BSP_USING_MMA8562I2C config BSP_USING_MMA8562I2C
string "the device name for 3-Axis Sensor" string "the device name for 3-Axis Sensor"

View File

@ -80,7 +80,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_I2C config BSP_USING_I2C
bool "Enable I2C" bool "Enable I2C"
select RT_USING_I2C select RT_USING_I2C
default y default n
if BSP_USING_I2C if BSP_USING_I2C
config BSP_USING_I2C1 config BSP_USING_I2C1
@ -138,7 +138,7 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_SPI config BSP_USING_SPI
bool "Enable SPI" bool "Enable SPI"
select RT_USING_SPI select RT_USING_SPI
default y default n
if BSP_USING_SPI if BSP_USING_SPI
config BSP_USING_SPI3 config BSP_USING_SPI3
@ -170,12 +170,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_ADC config BSP_USING_ADC
bool "Enable ADC Channel" bool "Enable ADC Channel"
select RT_USING_ADC select RT_USING_ADC
default y default n
if BSP_USING_ADC if BSP_USING_ADC
config BSP_USING_ADC0_CH0 config BSP_USING_ADC0_CH0
bool "Enable ADC0 Channel0" bool "Enable ADC0 Channel0"
default y default n
config BSP_USING_ADC0_CH1 config BSP_USING_ADC0_CH1
bool "Enable ADC0 Channel1" bool "Enable ADC0 Channel1"
@ -202,12 +202,12 @@ menu "On-chip Peripheral Drivers"
select RT_USING_SDIO select RT_USING_SDIO
select RT_USING_DFS select RT_USING_DFS
select RT_USING_DFS_ELMFAT select RT_USING_DFS_ELMFAT
default y default n
config BSP_USING_RTC config BSP_USING_RTC
bool "Enable RTC" bool "Enable RTC"
select RT_USING_RTC select RT_USING_RTC
default y default n
config BSP_USING_WDT config BSP_USING_WDT
bool "Enable WatchDog" bool "Enable WatchDog"
@ -218,12 +218,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_HWTIMER config BSP_USING_HWTIMER
bool "Enable Timer" bool "Enable Timer"
select RT_USING_HWTIMER select RT_USING_HWTIMER
default y default n
if BSP_USING_HWTIMER if BSP_USING_HWTIMER
config BSP_USING_CTIMER0 config BSP_USING_CTIMER0
bool "Enable CIMER0" bool "Enable CIMER0"
default y default n
config BSP_USING_CTIMER3 config BSP_USING_CTIMER3
bool "Enable CIMER3" bool "Enable CIMER3"
@ -238,12 +238,12 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_PWM config BSP_USING_PWM
bool "Enable PWM" bool "Enable PWM"
select RT_USING_PWM select RT_USING_PWM
default y default n
if BSP_USING_PWM if BSP_USING_PWM
config BSP_USING_CTIMER1_MAT0 config BSP_USING_CTIMER1_MAT0
bool "Enable CIMER1 Match0 as PWM output" bool "Enable CIMER1 Match0 as PWM output"
default y default n
config BSP_USING_CTIMER2_MAT0 config BSP_USING_CTIMER2_MAT0
bool "Enable CIMER2 Match0 as PWM output" bool "Enable CIMER2 Match0 as PWM output"
@ -264,20 +264,10 @@ menu "On-chip Peripheral Drivers"
endmenu endmenu
menu "Onboard Peripheral Drivers" menu "Onboard Peripheral Drivers"
config BSP_USING_LED
bool "Enable RGB LED"
select RT_USING_LED
default y
config BSP_USING_KEY
bool "Enable Button "
select RT_USING_KEY
default y
config BSP_USING_MMA8562 config BSP_USING_MMA8562
bool "Enable MMA8562" bool "Enable MMA8562"
select BSP_USING_I2C4 select BSP_USING_I2C4
default y default n
if BSP_USING_MMA8562 if BSP_USING_MMA8562
config BSP_USING_MMA8562I2C config BSP_USING_MMA8562I2C
string "the device name for 3-Axis Sensor" string "the device name for 3-Axis Sensor"