mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
完善i2c,uart,LCD的kconfig,修复了I2C的imxrt_i2c_mst_xfer函数读取数据前会多进行一次写地址的操作
This commit is contained in:
1 parent
59bec27364
commit
fefaac854c
3 files changed
+489
-7
No files matched your search
@@ -32,6 +32,81 @@ menu "On-chip Peripheral Drivers"
|
||||
config BSP_USING_LPUART1
|
||||
bool "Enable LPUART1"
|
||||
default y
|
||||
config BSP_USING_LPUART2
|
||||
bool "Enable LPUART2"
|
||||
default n
|
||||
config BSP_USING_LPUART3
|
||||
bool "Enable LPUART3"
|
||||
default n
|
||||
config BSP_USING_LPUART4
|
||||
bool "Enable LPUART4"
|
||||
default n
|
||||
config BSP_USING_LPUART5
|
||||
bool "Enable LPUART5"
|
||||
default n
|
||||
config BSP_USING_LPUART6
|
||||
bool "Enable LPUART6"
|
||||
default n
|
||||
config BSP_USING_LPUART7
|
||||
bool "Enable LPUART7"
|
||||
default n
|
||||
config BSP_USING_LPUART8
|
||||
bool "Enable LPUART8"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C
|
||||
bool "Enable I2C"
|
||||
select RT_USING_I2C
|
||||
default n
|
||||
if BSP_USING_I2C
|
||||
config BSP_USING_I2C1
|
||||
bool "Enable LPI2C1"
|
||||
default n
|
||||
config BSP_USING_I2C3
|
||||
bool "Enable LPI2C3"
|
||||
default n
|
||||
config BSP_USING_I2C4
|
||||
bool "Enable LPI2C4"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_LCD
|
||||
bool "Enable LCD"
|
||||
default n
|
||||
if BSP_USING_LCD
|
||||
config LCD_WIDTH
|
||||
int "width"
|
||||
default 480
|
||||
|
||||
config LCD_HEIGHT
|
||||
int "height"
|
||||
default 272
|
||||
|
||||
config LCD_HFP
|
||||
int "HFP"
|
||||
default 4
|
||||
config LCD_VFP
|
||||
int "VFP"
|
||||
default 4
|
||||
config LCD_HBP
|
||||
int "HBP"
|
||||
default 8
|
||||
config LCD_VBP
|
||||
int "VBP"
|
||||
default 2
|
||||
config LCD_HSW
|
||||
int "HSW"
|
||||
default 40
|
||||
config LCD_VSW
|
||||
int "VSW"
|
||||
default 10
|
||||
config LCD_BL_PIN
|
||||
int "Backlight ctrl pin"
|
||||
default 63
|
||||
config LCD_RST_PIN
|
||||
int "Reset pin"
|
||||
default 2
|
||||
endif
|
||||
|
||||
endmenu
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -221,7 +221,7 @@ static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus,
|
||||
{
|
||||
if (imxrt_i2c->msg[i].flags & RT_I2C_RD)
|
||||
{
|
||||
if (LPI2C_MasterStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Write) != kStatus_Success)
|
||||
if (LPI2C_MasterStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Read) != kStatus_Success)
|
||||
{
|
||||
i = 0;
|
||||
break;
|
||||
@@ -231,12 +231,6 @@ static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus,
|
||||
{
|
||||
}
|
||||
|
||||
if (LPI2C_MasterRepeatedStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Read) != kStatus_Success)
|
||||
{
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (LPI2C_MasterReceive(imxrt_i2c->I2C, imxrt_i2c->msg[i].buf, imxrt_i2c->msg[i].len) != kStatus_Success)
|
||||
{
|
||||
i = 0;
|
||||
|
||||
Reference in new issue
Block a user