Files
xiuos/Ubiquitous/RT_Thread/bsp/k210/base-drivers/drv_mpymachine.c
chunyexixiaoyu a184611226 Ubiquitous/RT_Thread/:update K210 bsp base on https://github.com/kendryte/K210-Micropython-OpenMV
Fixed an issue where LCD and RW007 could not be used at the same time
2021-10-14 11:19:40 +08:00

28 lines
479 B
C

#include <sysctl.h>
int mp_port_get_freq(int clkid, int *freq)
{
int ret = 0;
uint32_t value;
switch (clkid)
{
case 0:
value = sysctl_clock_get_freq(SYSCTL_CLOCK_CPU);
break;
case 1:
value = sysctl_clock_get_freq(SYSCTL_CLOCK_PLL1);
break;
case 2:
value = sysctl_clock_get_freq(SYSCTL_CLOCK_PLL2);
break;
default:
ret = -1;
break;
}
*freq = (int)value;
return ret;
}