mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
[bsp][cvitek]: add c906_little i2c driver (#8535)
This commit is contained in:
1 parent
41e08084f8
commit
abba40183e
5 files changed
+785
No files matched your search
@@ -19,4 +19,24 @@ menu "General Drivers Configuration"
|
||||
default 30
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C
|
||||
bool "Using HW I2C"
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
default n
|
||||
|
||||
if BSP_USING_I2C
|
||||
config BSP_USING_I2C0
|
||||
bool "Enable I2C0"
|
||||
default n
|
||||
|
||||
config BSP_USING_I2C1
|
||||
bool "Enable I2C1"
|
||||
default n
|
||||
|
||||
config I2C_IRQ_BASE
|
||||
int
|
||||
default 32
|
||||
endif
|
||||
endmenu
|
||||
Executable → Regular
+18
@@ -61,3 +61,21 @@ int rt_hw_tick_init(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will delay for some us.
|
||||
*
|
||||
* @param us the delay time of us
|
||||
*/
|
||||
void rt_hw_us_delay(rt_uint32_t us)
|
||||
{
|
||||
unsigned long start_time;
|
||||
unsigned long end_time;
|
||||
unsigned long run_time;
|
||||
|
||||
start_time = get_ticks();
|
||||
end_time = start_time + us * (TIMER_CLK_FREQ / 1000000);
|
||||
do{
|
||||
run_time = get_ticks();
|
||||
} while(run_time < end_time);
|
||||
}
|
||||
@@ -12,6 +12,9 @@ if GetDepend('BSP_USING_CV1800B') or GetDepend('BSP_USING_C906_LITTLE'):
|
||||
if GetDepend('BSP_USING_CV1800B'):
|
||||
src += ['drv_gpio.c']
|
||||
|
||||
if GetDepend('BSP_USING_I2C'):
|
||||
src += ['drv_hw_i2c.c']
|
||||
|
||||
CPPDEFINES += ['-DCONFIG_64BIT']
|
||||
|
||||
group = DefineGroup('drivers', src, depend = [''], CPPDEFINES = CPPDEFINES, CPPPATH = CPPPATH)
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user