mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 19:47:44 +08:00
添加了ist8310磁力计的支持,同时修复了gpio初始化先于exti的bug
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
|
||||
使用示例
|
||||
|
||||
```c
|
||||
IST8310_Init_Config_s ist8310_conf = {
|
||||
.gpio_conf_exti = {
|
||||
.exti_mode = GPIO_EXTI_MODE_RISING,
|
||||
.GPIO_Pin = GPIO_PIN_3,
|
||||
.GPIOx = GPIOG,
|
||||
.gpio_model_callback = NULL,
|
||||
},
|
||||
.gpio_conf_rst = {
|
||||
.exti_mode = GPIO_EXTI_MODE_NONE,
|
||||
.GPIO_Pin = GPIO_PIN_6,
|
||||
.GPIOx = GPIOG,
|
||||
.gpio_model_callback = NULL,
|
||||
},
|
||||
.iic_config = {
|
||||
.handle = &hi2c3,
|
||||
.dev_address = IST8310_IIC_ADDRESS,
|
||||
.work_mode = IIC_BLOCK_MODE,
|
||||
},
|
||||
};
|
||||
IST8310Instance *asdf = IST8310Init(&ist8310_conf);
|
||||
|
||||
// 随后数据会被放到asdf.mag[i]中
|
||||
```
|
||||
Reference in New Issue
Block a user