[BSP][imxrt1052] add baudrate options, Delete simulate i2c .

This commit is contained in:
balanceTWK
2018-04-18 18:49:45 +08:00
parent 388e426758
commit 071c2d3f50
4 changed files with 206 additions and 346 deletions
+49 -41
View File
@@ -267,56 +267,64 @@ menu "Select spi bus and dev drivers"
depends on RT_USING_SPI_FLASH
endmenu
menu "Select i2c bus drivers"
menu "Select iic bus drivers"
config LPI2C_CLOCK_SOURCE_DIVIDER
int "lpi2c bus clock source divider"
range 1 64
default 4
config RT_USING_I2C1
bool "USING I2C1"
config RT_USING_HW_I2C1
bool "using hardware i2c1"
select RT_USING_I2C
default y
if RT_USING_I2C1
config RT_USING_I2C1_BITOPS
select RT_USING_I2C_BITOPS
default n
bool "using simulate I2C1"
endif
config RT_USING_I2C2
bool "USING I2C2"
choice
prompt "i2c1 bus badurate choice"
default HW_I2C1_BADURATE_100kHZ
depends on RT_USING_HW_I2C1
config HW_I2C1_BADURATE_100kHZ
bool "100kHZ"
config HW_I2C1_BADURATE_400kHZ
bool "400kHZ"
endchoice
config RT_USING_HW_I2C2
bool "using hardware i2c2"
select RT_USING_I2C
default n
if RT_USING_I2C2
config RT_USING_I2C2_BITOPS
select RT_USING_I2C_BITOPS
default n
bool "using simulate I2C2"
endif
config RT_USING_I2C3
bool "USING I2C3"
choice
prompt "i2c2 bus badurate choice"
default HW_I2C2_BADURATE_100kHZ
depends on RT_USING_HW_I2C2
config HW_I2C2_BADURATE_100kHZ
bool "100kHZ"
config HW_I2C2_BADURATE_400kHZ
bool "400kHZ"
endchoice
config RT_USING_HW_I2C3
bool "using hardware i2c3"
select RT_USING_I2C
default n
if RT_USING_I2C3
config RT_USING_I2C3_BITOPS
select RT_USING_I2C_BITOPS
default n
bool "using simulate I2C3"
endif
config RT_USING_I2C4
bool "USING I2C4"
choice
prompt "i2c3 bus badurate choice"
default HW_I2C3_BADURATE_100kHZ
depends on RT_USING_HW_I2C3
config HW_I2C3_BADURATE_100kHZ
bool "100kHZ"
config HW_I2C3_BADURATE_400kHZ
bool "400kHZ"
endchoice
config RT_USING_HW_I2C4
bool "using hardware i2c4"
select RT_USING_I2C
default n
if RT_USING_I2C4
config RT_USING_I2C4_BITOPS
select RT_USING_I2C_BITOPS
default n
bool "using simulate I2C4"
endif
choice
prompt "i2c4 bus badurate choice"
default HW_I2C4_BADURATE_100kHZ
depends on RT_USING_HW_I2C4
config HW_I2C4_BADURATE_100kHZ
bool "100kHZ"
config HW_I2C4_BADURATE_400kHZ
bool "400kHZ"
endchoice
endmenu
menu "Select lcd driver"
File diff suppressed because it is too large Load Diff
+3 -4
View File
@@ -392,7 +392,6 @@ void GPIO5_Combined_0_15_IRQHandler(void)
#if defined __CORTEX_M && (__CORTEX_M == 4U)
__DSB();
#endif
rt_interrupt_leave();
}
@@ -473,13 +472,13 @@ static void rt1052_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)
{
CLOCK_EnableClock(kCLOCK_Iomuxc);
IOMUXC_SetPinMux(0x401F8010U + pin*4, 0x5U, 0, 0, 0, 0);
IOMUXC_SetPinMux(0x401F8010U + pin*4, 0x5U, 0, 0, 0, 1);
}
else
{
CLOCK_EnableClock(kCLOCK_IomuxcSnvs);
IOMUXC_SetPinMux(0x401F8000U + (pin-125)*4, 0x5U, 0, 0, 0, 0);
IOMUXC_SetPinMux(0x401F8000U + (pin-125)*4, 0x5U, 0, 0, 0, 1);
}
gpio.outputLogic = 0;
@@ -530,7 +529,7 @@ static void rt1052_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)
static int rt1052_pin_read(rt_device_t dev, rt_base_t pin)
{
return GPIO_PinRead(rt1052_pin_map[pin].gpio, rt1052_pin_map[pin].gpio_pin);
return GPIO_PinReadPadStatus(rt1052_pin_map[pin].gpio, rt1052_pin_map[pin].gpio_pin);
}
static void rt1052_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value)
+3 -3
View File
@@ -210,10 +210,10 @@
#define LPSPI4_SDO_GPIO_1
#define LPSPI4_SDI_GPIO_1
/* Select i2c bus drivers */
/* Select iic bus drivers */
#define LPI2C_CLOCK_SOURCE_DIVIDER 4
#define RT_USING_I2C1
#define RT_USING_HW_I2C1
#define HW_I2C1_BADURATE_100kHZ
/* Select lcd driver */