1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include "usr.h"
- #include "system.h"
- #include "nrf_delay.h"
- #include "hal_ble_client.h"
- #include "hal_ble_host.h"
- #include "ble_comm.h"
- #include "hal_ws2812.h"
- #include "drv_lsm6ds3tr.h"
- __weak void usr1_Init(void)
- {
- // USR_SetName();
- slave_init(BLE_Client_Push);
- host_init(BLE_Host_Push);
- }
- void PRE_Init(void)
- {
- usr1_Init();
- Time_Init();
- }
- void IMU_Data_cb1(void* handle)
- {
- lsm6ds3tr_c_handle_t* target = (lsm6ds3tr_c_handle_t*)handle;
- nrf_gpio_pin_write(19,1);
-
- SEGGER_RTT_printf(0,"gry[0]=%d,gry[1]=%d,gry[2]=%d\r\n",target->gry[0],target->gry[1],target->gry[2]);
- SEGGER_RTT_printf(0,"acc[0]=%d,acc[1]=%d,acc[2]=%d\r\n",target->acc[0],target->acc[1],target->acc[2]);
- SEGGER_RTT_printf(0,"mag[0]=%d,mag[1]=%d,mag[2]=%d\r\n",target->mag[0],target->mag[1],target->mag[2]);
-
- nrf_gpio_pin_write(19,0);
- }
- void IMU_Data_cb2(void* handle)
- {
-
-
- }
- void IMU_Data_cb3(void* handle)
- {
-
-
- }
- void USR_Init(void)
- {
- nrf_gpio_cfg_output(19); nrf_gpio_pin_write(19,0); //µçÔ´¿ª¹Ø
- //Add your code here...
- WS2812_Initialize();
-
- LSM6DS3TR_C_Initialize();
- LSM6DS3TR_C_Regist(IMU_Data_cb1);
- LSM6DS3TR_C_Regist(IMU_Data_cb2);
- LSM6DS3TR_C_Regist(IMU_Data_cb3);
- }
|