BNO055 extension board example.
Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.
#include "bno055_port.h"
#include "i2c_master.h"
#include "ioport.h"
#include "conf_board.h"
#include "conf_bno055.h"
Functions | |
void | bno055_delay_msek (BNO055_MDELAY_DATA_TYPE msek) |
void | bno055_gpio_config (void) |
void | bno055_i2c_bus_init (void) |
int8_t | bno055_i2c_bus_read (uint8_t dev_addr, uint8_t reg_addr, uint8_t *reg_data, uint8_t cnt) |
int8_t | bno055_i2c_bus_write (uint8_t dev_addr, uint8_t reg_addr, uint8_t *reg_data, uint8_t cnt) |
void | bno055_initialize (void) |
void | bno055_reset (void) |
void | extint_initialize (void(*handler_function)(void)) |
Variables | |
struct i2c_master_packet | bno055_read_pkt |
struct bno055_t | bno055_sensor |
struct i2c_master_packet | bno055_write_pkt |
struct i2c_master_module | i2c_master_module |
void bno055_delay_msek | ( | BNO055_MDELAY_DATA_TYPE | msek | ) |
References delay_ms.
Referenced by bno055_i2c_bus_read(), bno055_init(), and bno055_initialize().
void bno055_gpio_config | ( | void | ) |
References IOPORT_DIR_INPUT, IOPORT_DIR_OUTPUT, and ioport_set_pin_dir().
Referenced by bno055_initialize().
void bno055_i2c_bus_init | ( | void | ) |
int8_t bno055_i2c_bus_read | ( | uint8_t | dev_addr, |
uint8_t | reg_addr, | ||
uint8_t * | reg_data, | ||
uint8_t | cnt | ||
) |
References bno055_delay_msek(), BNO055_E_NULL_PTR, bno055_i2c_bus_write(), bno055_read_pkt, cnt, i2c_master_packet::data, i2c_master_packet::data_length, i2c_master_read_packet_wait(), and NULL.
Referenced by bno055_initialize().
int8_t bno055_i2c_bus_write | ( | uint8_t | dev_addr, |
uint8_t | reg_addr, | ||
uint8_t * | reg_data, | ||
uint8_t | cnt | ||
) |
References BNO055_E_NULL_PTR, BNO055_REG_ADDR_START, BNO055_WRITE_DATA_START, bno055_write_pkt, cnt, i2c_master_packet::data, i2c_master_packet::data_length, and i2c_master_write_packet_wait().
Referenced by bno055_i2c_bus_read(), and bno055_initialize().
void bno055_initialize | ( | void | ) |
References BNO055_ACCEL_RANGE_2G, bno055_delay_msek(), bno055_gpio_config(), BNO055_GYRO_RANGE_500DPS, bno055_i2c_bus_init(), bno055_i2c_bus_read(), bno055_i2c_bus_write(), bno055_init(), BNO055_OPERATION_MODE_AMG, BNO055_POWER_MODE_NORMAL, bno055_read_accel_x(), bno055_read_accel_xyz(), bno055_read_accel_y(), bno055_read_accel_z(), bno055_reset(), bno055_sensor, bno055_set_accel_range(), bno055_set_gyro_range(), bno055_set_operation_mode(), bno055_set_power_mode(), bno055_t::delay_msec, bno055_t::dev_addr, and ioport_set_pin_level().
Referenced by main().
void bno055_reset | ( | void | ) |
References delay_ms, and ioport_set_pin_level().
Referenced by bno055_initialize().
void extint_initialize | ( | void(*)(void) | handler_function | ) |
struct i2c_master_packet bno055_read_pkt |
Referenced by bno055_i2c_bus_init(), and bno055_i2c_bus_read().
struct bno055_t bno055_sensor |
Referenced by bno055_initialize().
struct i2c_master_packet bno055_write_pkt |
Referenced by bno055_i2c_bus_init(), and bno055_i2c_bus_write().