2023-02-03 15:25:58 +08:00
|
|
|
|
2023-02-16 15:46:04 +08:00
|
|
|
# ist8310
|
|
|
|
|
2023-02-15 18:28:25 +08:00
|
|
|
## 使用示例
|
2023-02-03 15:25:58 +08:00
|
|
|
|
|
|
|
```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,
|
|
|
|
},
|
|
|
|
};
|
2023-02-14 11:13:32 +08:00
|
|
|
|
2023-02-03 15:25:58 +08:00
|
|
|
IST8310Instance *asdf = IST8310Init(&ist8310_conf);
|
|
|
|
|
2023-02-20 18:34:23 +08:00
|
|
|
// 随后数据会被放到asdf.mag[i]中,每次数据准备好了就会触发int_ist引脚中断,继而启动iic通信读取数据并解析
|
2023-02-16 15:46:04 +08:00
|
|
|
```
|