42 static void _putc(
void *p,
char c)
76 imu.
read(acc, gyro, &temp, &time_us);
77 if (acc[0] == 0xFFFF || acc[0] == 0x0000)
85 printf(
"%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
86 (int32_t)(acc[0]*1000.0),
87 (int32_t)(acc[1]*1000.0),
88 (int32_t)(acc[2]*1000.0),
89 (int32_t)(gyro[0]*1000.0),
90 (int32_t)(gyro[1]*1000.0),
91 (int32_t)(gyro[2]*1000.0),
92 (int32_t)(temp*1000.0),
static volatile int16_t gyro[3]
void init(GPIO_TypeDef *gpio_port, uint16_t pin)
static volatile int16_t temp
static void _putc(void *p, char c)
void put_byte(uint8_t ch) override
void init_printf(void *putp, void(*putf)(void *, char))
void init(const spi_hardware_struct_t *conf)
const spi_hardware_struct_t spi_config[NUM_SPI]
void read(float *accel_data, float *gyro_data, float *temp_data, uint64_t *time_us)