[bsp][stm32f429-disco] Add LCD/touch/i2c to Kconfig
This commit is contained in:
parent
61bca24ce6
commit
f9a809fd39
|
@ -117,18 +117,24 @@ CONFIG_RT_USING_SERIAL=y
|
|||
# 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 is not set
|
||||
CONFIG_RT_USING_I2C=y
|
||||
CONFIG_RT_USING_I2C_BITOPS=y
|
||||
CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_PWM is not set
|
||||
# CONFIG_RT_USING_MTD_NOR is not set
|
||||
# CONFIG_RT_USING_MTD_NAND is not set
|
||||
# CONFIG_RT_USING_MTD is not set
|
||||
# CONFIG_RT_USING_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_WIFI is not set
|
||||
# CONFIG_RT_USING_AUDIO is not set
|
||||
|
||||
#
|
||||
# Using WiFi
|
||||
#
|
||||
# CONFIG_RT_USING_WIFI is not set
|
||||
|
||||
#
|
||||
# Using USB
|
||||
#
|
||||
|
@ -138,8 +144,13 @@ CONFIG_RT_USING_PIN=y
|
|||
#
|
||||
# POSIX layer and C standard library
|
||||
#
|
||||
# CONFIG_RT_USING_LIBC is not set
|
||||
CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_RT_USING_PTHREADS is not set
|
||||
CONFIG_RT_USING_POSIX=y
|
||||
# CONFIG_RT_USING_POSIX_MMAP is not set
|
||||
# CONFIG_RT_USING_POSIX_TERMIOS is not set
|
||||
# CONFIG_RT_USING_POSIX_AIO is not set
|
||||
# CONFIG_RT_USING_MODULE is not set
|
||||
|
||||
#
|
||||
# Network
|
||||
|
@ -210,6 +221,7 @@ CONFIG_RT_USING_PIN=y
|
|||
# CONFIG_PKG_USING_NOPOLL is not set
|
||||
# CONFIG_PKG_USING_NETUTILS is not set
|
||||
# CONFIG_PKG_USING_AT_DEVICE is not set
|
||||
# CONFIG_PKG_USING_WIZNET is not set
|
||||
|
||||
#
|
||||
# IoT Cloud
|
||||
|
@ -246,13 +258,12 @@ CONFIG_RT_USING_PIN=y
|
|||
# CONFIG_PKG_USING_EASYFLASH is not set
|
||||
# CONFIG_PKG_USING_EASYLOGGER is not set
|
||||
# CONFIG_PKG_USING_SYSTEMVIEW is not set
|
||||
# CONFIG_PKG_USING_RDB is not set
|
||||
|
||||
#
|
||||
# system packages
|
||||
#
|
||||
# CONFIG_PKG_USING_GUIENGINE is not set
|
||||
# CONFIG_PKG_USING_GUIENGINE_V200 is not set
|
||||
# CONFIG_PKG_USING_GUIENGINE_LATEST_VERSION is not set
|
||||
# CONFIG_PKG_USING_CAIRO is not set
|
||||
# CONFIG_PKG_USING_PIXMAN is not set
|
||||
# CONFIG_PKG_USING_LWEXT4 is not set
|
||||
|
@ -261,18 +272,27 @@ CONFIG_RT_USING_PIN=y
|
|||
# CONFIG_PKG_USING_SQLITE is not set
|
||||
# CONFIG_PKG_USING_RTI is not set
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT_V001 is not set
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT_LATEST_VERSION is not set
|
||||
# CONFIG_LV_MEM_STATIC is not set
|
||||
# CONFIG_LV_MEM_DYNAMIC is not set
|
||||
# CONFIG_LV_COLOR_DEPTH_1 is not set
|
||||
# CONFIG_LV_COLOR_DEPTH_8 is not set
|
||||
# CONFIG_LV_COLOR_DEPTH_16 is not set
|
||||
# CONFIG_LV_COLOR_DEPTH_24 is not set
|
||||
# CONFIG_PKG_USING_CMSIS is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
#
|
||||
# CONFIG_PKG_USING_STM32F4_HAL is not set
|
||||
# CONFIG_PKG_USING_STM32F4_DRIVERS is not set
|
||||
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
|
||||
# CONFIG_PKG_USING_SHT2X is not set
|
||||
# CONFIG_PKG_USING_AHT10 is not set
|
||||
# CONFIG_PKG_USING_AP3216C is not set
|
||||
# CONFIG_PKG_USING_STM32_SDIO is not set
|
||||
# CONFIG_PKG_USING_ICM20608 is not set
|
||||
# CONFIG_PKG_USING_U8G2 is not set
|
||||
|
||||
#
|
||||
# miscellaneous packages
|
||||
|
@ -303,8 +323,11 @@ CONFIG_RT_USING_PIN=y
|
|||
# example package: hello
|
||||
#
|
||||
# CONFIG_PKG_USING_HELLO is not set
|
||||
CONFIG_RT_USING_ILI9341_LCD=y
|
||||
CONFIG_RT_USING_STMPE811_TOUCH=y
|
||||
CONFIG_RT_USING_EXT_SDRAM=y
|
||||
CONFIG_RT_USING_UART1=y
|
||||
# CONFIG_RT_USING_UART2 is not set
|
||||
# CONFIG_RT_USING_UART3 is not set
|
||||
# CONFIG_RT_USING_SPI5 is not set
|
||||
CONFIG_RT_USING_I2C3=y
|
||||
|
|
|
@ -40,8 +40,10 @@
|
|||
|
||||
static void rt_touch_thread_entry(void *parameter)
|
||||
{
|
||||
#ifdef PKG_USING_LITTLEVGL2RTT
|
||||
int16_t x;
|
||||
int16_t y;
|
||||
#endif
|
||||
struct touch_state ts;
|
||||
while(1)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
config RT_USING_ILI9341_LCD
|
||||
bool "Enable LCD on the board"
|
||||
default y
|
||||
select RT_USING_EXT_SDRAM
|
||||
|
||||
config RT_USING_STMPE811_TOUCH
|
||||
bool "Enable Touchscreen on the board"
|
||||
default y
|
||||
select RT_USING_I2C3
|
||||
|
||||
config RT_USING_EXT_SDRAM
|
||||
bool "Enable SDRAM on the board"
|
||||
default y
|
||||
|
@ -17,3 +27,9 @@ config RT_USING_UART3
|
|||
config RT_USING_SPI5
|
||||
bool "Enable SPI5"
|
||||
default n
|
||||
|
||||
config RT_USING_I2C3
|
||||
bool "Enable I2C3"
|
||||
default y
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
|
|
|
@ -9,10 +9,20 @@ src = Split("""
|
|||
board.c
|
||||
stm32f4xx_it.c
|
||||
usart.c
|
||||
drv_sdram.c
|
||||
drv_lcd.c
|
||||
""")
|
||||
|
||||
if GetDepend(['RT_USING_EXT_SDRAM']):
|
||||
src += ['drv_sdram.c']
|
||||
|
||||
if GetDepend(['RT_USING_I2C']):
|
||||
src += ['drv_i2c.c']
|
||||
|
||||
if GetDepend(['RT_USING_ILI9341_LCD']):
|
||||
src += ['drv_lcd.c']
|
||||
|
||||
if GetDepend(['RT_USING_STMPE811_TOUCH']):
|
||||
src += ['drv_touch.c']
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
|
|
@ -99,7 +99,7 @@ static int32_t touch_write (uint8_t reg, uint8_t val)
|
|||
*/
|
||||
static rt_err_t stmpe811_touch_init(rt_device_t dev)
|
||||
{
|
||||
stmpe811_i2c_bus = rt_i2c_bus_device_find(STMPE811_I2CBUS_NAME);
|
||||
stmpe811_i2c_bus = rt_i2c_bus_device_find("touch");
|
||||
|
||||
// ptrI2C->Initialize (NULL);
|
||||
// ptrI2C->PowerControl(ARM_POWER_FULL);
|
||||
|
@ -148,7 +148,7 @@ int32_t touch_uninitialize (void) {
|
|||
- \b 0: function succeeded
|
||||
- \b -1: function failed
|
||||
*/
|
||||
int32_t touch_get_state(struct touch_state *pState)
|
||||
int32_t touch_get_state(struct touch_state *state)
|
||||
{
|
||||
uint8_t val;
|
||||
uint8_t num;
|
||||
|
@ -159,9 +159,9 @@ int32_t touch_get_state(struct touch_state *pState)
|
|||
/* Read touch status */
|
||||
res = touch_read(STMPE811_TSC_CTRL, &val);
|
||||
if (res < 0) return -1;
|
||||
pState->pressed = (val & (1 << 7)) ? 1 : 0;
|
||||
state->pressed = (val & (1 << 7)) ? 1 : 0;
|
||||
|
||||
if (pState->pressed)
|
||||
if (state->pressed)
|
||||
{
|
||||
val = STMPE811_TSC_DATA;
|
||||
|
||||
|
@ -187,8 +187,8 @@ int32_t touch_get_state(struct touch_state *pState)
|
|||
//ptrI2C->MasterReceive (TSC_I2C_ADDR, xyz, 4, false);
|
||||
//while (ptrI2C->GetStatus().busy);
|
||||
}
|
||||
pState->x = (int16_t)((xyz[0] << 4) | ((xyz[1] & 0xF0) >> 4));
|
||||
pState->y = (int16_t) (xyz[2] | ((xyz[1] & 0x0F) << 8));
|
||||
state->x = (int16_t)((xyz[0] << 4) | ((xyz[1] & 0xF0) >> 4));
|
||||
state->y = (int16_t) (xyz[2] | ((xyz[1] & 0x0F) << 8));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -78,4 +78,6 @@ struct touch_state {
|
|||
uint8_t padding;
|
||||
};
|
||||
|
||||
int32_t touch_get_state(struct touch_state *state);
|
||||
|
||||
#endif /* __DRV_TOUCH_H__ */
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,6 +20,8 @@ STM32F429I-DISCOVERY 开发板使用高性能 MCU STM32F429,可以用于实现
|
|||
|LED| 6 个 |
|
||||
|按键| 2 个 |
|
||||
|
||||
本 BSP 已测试支持 RT-Thread GUIEngine 和 Littlevgl,可以使用 env 工具安装相应的 Package。
|
||||
|
||||
## 2. 编译说明
|
||||
|
||||
STM32F429-DISCO 板级包支持 MDK4﹑MDK5﹑IAR 开发环境和 GCC 编译器,以下是具体版本信息:
|
||||
|
@ -61,13 +63,16 @@ finsh />
|
|||
| 驱动 | 支持情况 | 备注 |
|
||||
| ------ | ---- | :------: |
|
||||
| USART | 支持 | USART1/2/3 |
|
||||
| SPI | 支持 | |
|
||||
| LCD | 支持 | 支持 FrameBuffer 模式 LCD 显示 |
|
||||
| SPI | 支持 | SPI5 |
|
||||
| IIC | 支持 | IIC3 |
|
||||
| SDRAM | 支持 | |
|
||||
| LCD | 支持 | 支持 FrameBuffer 模式 LCD 显示 |
|
||||
| 触摸屏 | 支持 | IIC 接口 STMPE811 |
|
||||
| USB OTG Host| 即将支持 | 预计 2018/11 |
|
||||
| USB OTG Device| 未支持 | |
|
||||
| GPIO | 未支持 | |
|
||||
| IIC | 未支持 | |
|
||||
| L3GD20 | 未支持 | |
|
||||
| USB OTG | 未支持 | |
|
||||
|
||||
|
||||
|
||||
## 5. 联系人信息
|
||||
|
|
|
@ -75,13 +75,20 @@
|
|||
#define RT_USING_DEVICE_IPC
|
||||
#define RT_PIPE_BUFSZ 512
|
||||
#define RT_USING_SERIAL
|
||||
#define RT_USING_I2C
|
||||
#define RT_USING_I2C_BITOPS
|
||||
#define RT_USING_PIN
|
||||
|
||||
/* Using WiFi */
|
||||
|
||||
|
||||
/* Using USB */
|
||||
|
||||
|
||||
/* POSIX layer and C standard library */
|
||||
|
||||
#define RT_USING_LIBC
|
||||
#define RT_USING_POSIX
|
||||
|
||||
/* Network */
|
||||
|
||||
|
@ -147,7 +154,10 @@
|
|||
|
||||
/* example package: hello */
|
||||
|
||||
#define RT_USING_ILI9341_LCD
|
||||
#define RT_USING_STMPE811_TOUCH
|
||||
#define RT_USING_EXT_SDRAM
|
||||
#define RT_USING_UART1
|
||||
#define RT_USING_I2C3
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue