2023-12-15 21:42:43 +08:00
|
|
|
#include "by_pt_button.h"
|
2023-12-13 21:54:20 +08:00
|
|
|
#include "zf_common_headfile.h"
|
2023-12-22 15:24:39 +08:00
|
|
|
#include "by_imu.h"
|
2023-12-13 21:54:20 +08:00
|
|
|
uint8_t potate_button;
|
2023-12-22 15:24:39 +08:00
|
|
|
|
2023-12-13 21:54:20 +08:00
|
|
|
void by_gpio_init(void)
|
|
|
|
|
{
|
|
|
|
|
gpio_init(E10, GPI, GPIO_HIGH, GPI_PULL_UP);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void by_exit_init(void)
|
|
|
|
|
{
|
|
|
|
|
exti_init(E9, EXTI_TRIGGER_FALLING);
|
|
|
|
|
exti_init(E11, EXTI_TRIGGER_FALLING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint8_t by_get_pb_statu(void)
|
|
|
|
|
{
|
|
|
|
|
uint8_t temp_s = potate_button;
|
|
|
|
|
potate_button = 0;
|
|
|
|
|
return temp_s;
|
2023-12-15 21:42:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void by_ips_show(void)
|
|
|
|
|
{
|
2023-12-22 15:24:39 +08:00
|
|
|
ips200_show_string(0, 0, "button statu:");
|
|
|
|
|
// ips200_show_uint(104, 0, by_get_pb_statu(), 1);
|
|
|
|
|
switch (by_get_pb_statu()) {
|
|
|
|
|
case 1:
|
|
|
|
|
ips200_show_string(104, 0, "press");
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
ips200_show_string(104, 0, "up ");
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
ips200_show_string(104, 0, "down ");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
ips200_show_string(104, 0, " ");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// 按钮
|
|
|
|
|
ips200_show_string(0, 16, "imu:");
|
|
|
|
|
ips200_show_float(46, 16, imu_acc_x, 2, 2);
|
|
|
|
|
ips200_show_float(106, 16, imu_acc_y, 2, 2);
|
|
|
|
|
ips200_show_float(166, 16, imu_acc_z, 2, 2);
|
|
|
|
|
ips200_show_float(46, 32, imu_gyro_x, 2, 2);
|
|
|
|
|
ips200_show_float(106, 32, imu_gyro_y, 2, 2);
|
|
|
|
|
ips200_show_float(166, 32, imu_gyro_z, 2, 2);
|
|
|
|
|
ips200_show_float(46, 48, imu660ra_temperature, 2, 2);
|
|
|
|
|
printf("%d,%d,%d\n",(int16_t)(imu_gyro_x*10),(int16_t)(imu_gyro_y*10),(int16_t)(imu_gyro_z*10));
|
|
|
|
|
|
|
|
|
|
}
|