喜
配置LIS3DSH的状态机后,我无法获得中断。你能给我一些例子吗?我的代码如下:
LIS3DSH_Write_Byte(CTRL_REG1,(u8)0x01); //使能SM1,SM1中断路由到INT1
LIS3DSH_Write_Byte(CTRL_REG3,(u8)0x48); //中断信号有效高电平,中断锁定,INT1信号使能
LIS3DSH_Write_Byte(CTRL_REG4,(u8)0x57); //启用X,Y,Z,ODR = 50 Hz。
LIS3DSH_Write_Byte(CTRL_REG5,(u8)0x00); //滤波器带宽800 Hz,+ / - 2g,禁用自检
LIS3DSH_Write_Byte(
tiM3_1,(u8)20); // Timer3 1000ms
LIS3DSH_Write_Byte(ST1_0,TI3); // SM1状态1
LIS3DSH_Write_Byte(ST1_1,CONT); // SM1状态2
#tech
以上来自于谷歌翻译
以下为原文
hi,
I can't get the interrupt after configuring the state machine of LIS3DSH. Could you give me some examples. My code as following:
LIS3DSH_Write_Byte(CTRL_REG1, (u8)0x01);//enable SM1, SM1 interrupt routed to INT1
LIS3DSH_Write_Byte(CTRL_REG3, (u8)0x48);//Interrupt signal active HIGH, Interrupt locked, INT1 signal enabled
LIS3DSH_Write_Byte(CTRL_REG4, (u8)0x57);//X, Y, Z enabled, ODR = 50 Hz.
LIS3DSH_Write_Byte(CTRL_REG5, (u8)0x00);//filter bandwidth 800 Hz, +/-2g, Self-test Disabled
LIS3DSH_Write_Byte(TIM3_1, (u8)20);//Timer3 1000ms
LIS3DSH_Write_Byte(ST1_0, TI3);//SM1 state 1
LIS3DSH_Write_Byte(ST1_1, CONT);//SM1 state 2
#tech