Comments (8)
基于AC6311芯片, 通过定时器实现GPIO引脚(PB9)的脉冲宽度检测功能 ,可以设置检测精度 。 需要提供Demo程序 。
from fw-ac63_bt_sdk.
#define GPCNT_EN(x) SFR(JL_GPCNT->CON, 0, 1, x)
#define GPCNT_CSS(x) SFR(JL_GPCNT->CON, 1, 3, x)
enum {
GPCNT_CSS_LSB = 0,
GPCNT_CSS_OSC,
GPCNT_CSS_CAP_MUX,
GPCNT_CSS_CLK_MUX,
GPCNT_CSS_GPCFD,
GPCNT_CSS_RING,
GPCNT_CSS_PLL480M,
GPCNT_CSS_IRFLT,
};
#define GPCNT_CLR_PEND(x) SFR(JL_GPCNT->CON, 6, 1, x)
#define GPCNT_GTS(x) SFR(JL_GPCNT->CON, 8, 4, x)
#define GPCNT_GSS(x) SFR(JL_GPCNT->CON, 12, 3, x)
enum {
GPCNT_GSS_LSB = 0,
GPCNT_GSS_OSC,
GPCNT_GSS_CAP_MUX,
GPCNT_GSS_CLK_MUX,
GPCNT_GSS_GPCFD,
GPCNT_GSS_RING,
GPCNT_GSS_PLL480M,
GPCNT_GSS_IRFLT,
};
#define MHz_UNIT 1000000L
#define KHz_UNIT 1000L
#define CY 0x2
SET_INTERRUPT
void gpcnt_isr()
{
JL_GPCNT->CON |= BIT(6);
volatile int xosc = 192 * MHz_UNIT / JL_GPCNT->NUM * (32 * (2 << (CY - 1)));
GPCNT_EN(0);
GPCNT_EN(1);
}
void gpcnt_init()
{
JL_PORTB->DIR |= BIT(9);
JL_PORTB->DIE |= BIT(9);
JL_PORTB->PU &= ~BIT(9);
JL_PORTB->PD &= ~BIT(9);
JL_IOMAP->CON2 &= ~(0x3f << 16);
JL_IOMAP->CON2 |= (IO_PORTB_09 << 16); //PB9--->input ch2
GPCNT_CLR_PEND(1);
GPCNT_GSS(0b010);
GPCNT_CSS(0b110);
GPCNT_GTS(CY);
GPCNT_CLR_PEND(1);
GPCNT_EN(1);
HWI_Install(GPCNT_INIT, (int)gpcnt_isr, 1);
}
from fw-ac63_bt_sdk.
from fw-ac63_bt_sdk.
from fw-ac63_bt_sdk.
请问主时钟与次时钟是如何同步的 ? 我的理解是芯片捕捉到次时钟上升沿后开始计时, 是这样吗 ?
from fw-ac63_bt_sdk.
请提供SFR(), HWI_Install() 头文件 。
from fw-ac63_bt_sdk.
1、#define SFR(sfr, start, len, dat)
(sfr = (sfr & (((0xffffffff << (len))) << (start))) |
(((dat) & (~(0xffffffff << (len)))) << (start)))
2、HWI_Install 和 request_irq 功能相同,注册中断函数。
from fw-ac63_bt_sdk.
请问主时钟与次时钟是如何同步的 ? 我的理解是芯片捕捉到次时钟上升沿后开始计时, 是这样吗 ?
是的。计时结束,产生中断
from fw-ac63_bt_sdk.
Related Issues (20)
- 如何判断对端是否已经配对(Gitee提问无回复) HOT 1
- AC632N使用2.1版本SDK无法使用测试盒升级
- 关于使用第三方OTA升级后,MAC的一致性
- 最新 SDK 无法编译 HOT 3
- PLNK (PDM Link) doesn't seem to function at all on BR34 series (AC638)
- [REQUEST] Mr. Wanbaolu HOT 4
- 请问:进入休眠方式除了软关机还有另一种方式,但更改了is_app_atchar_active值没有用 进不了休眠 HOT 1
- 关于添加用户代码 HOT 1
- AC6329C4测试盒升级变砖 HOT 1
- 中断函数 中断优先级 HOT 1
- ADC问题: ADC 时钟频率 HOT 3
- Bluetooth 5 Extended Advertisements 支持 HOT 1
- 扫描、查找、连接并发送数据到 AC6328A 上的 SPP 设备 : SPP_BUFF NULL!!!
- quick start on Linux
- 低压 1.8V应用, 烧录LVD档位
- AC632X 内部RTC闹钟 休眠+唤醒问题
- AC632N与Android13的配对莫名其妙消失
- AC6321 硬件SPI不能正常工作,驱动0.96英寸OLED液晶屏异常
- [AC69xx] SDK repository location HOT 3
- Wake up from soft off low power mode on timer interval HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fw-ac63_bt_sdk.