BNO055 extension board example for SAME70.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
#include "asf.h"
#include "conf_board.h"
#include "conf_bno055.h"
#include "bno055.h"
#include "stdint.h"
Macros | |
#define | I2C_BUFFER_LEN 8 |
Functions | |
void | bno055_delay_msek (uint32_t 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 bno055_t | bno055 |
#define I2C_BUFFER_LEN 8 |
void bno055_delay_msek | ( | uint32_t | msek | ) |
References delay_ms.
Referenced by bno055_initialize().
void bno055_gpio_config | ( | void | ) |
References BNO055_PIN_BOOT, BNO055_PIN_RESET, BNO055_PIN_SLAVE_ADDR_SELECT, IOPORT_DIR_OUTPUT, ioport_set_pin_dir(), and RGB_LED_G.
Referenced by main().
void bno055_i2c_bus_init | ( | void | ) |
References BNO055_TWIHS_CLK, BOARD_BNO055_ID_TWIHS, BOARD_BNO055_TWIHS, twihs_options::master_clk, pmc_enable_periph_clk(), twihs_options::speed, sysclk_get_cpu_hz(), and twihs_master_init().
Referenced by main().
int8_t bno055_i2c_bus_read | ( | uint8_t | dev_addr, |
uint8_t | reg_addr, | ||
uint8_t * | reg_data, | ||
uint8_t | cnt | ||
) |
References twihs_packet::addr, twihs_packet::addr_length, BNO055_ZERO_U8X, BOARD_BNO055_TWIHS, twihs_packet::buffer, twihs_packet::chip, bno055_t::dev_addr, twihs_packet::length, and twihs_master_read().
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 twihs_packet::addr, twihs_packet::addr_length, BNO055_ZERO_U8X, BOARD_BNO055_TWIHS, twihs_packet::buffer, twihs_packet::chip, bno055_t::dev_addr, twihs_packet::length, and twihs_master_write().
Referenced by bno055_initialize().
void bno055_initialize | ( | void | ) |
void bno055_reset | ( | void | ) |
References BNO055_PIN_RESET, BNO055_RESET_ACTIVE, BNO055_RESET_DELAY_MS, delay_ms, and ioport_set_pin_level().
Referenced by bno055_initialize().
void extint_initialize | ( | void(*)(void) | handler_function | ) |
References PIN_BNO055_EXT_INIERRUPT_ATTR, PIN_BNO055_EXT_INIERRUPT_ID, PIN_BNO055_EXT_INIERRUPT_MASK, PIN_BNO055_EXT_INIERRUPT_PIO, PIN_BNO055_EXT_INIERRUPT_TYPE, pio_configure(), pio_enable_interrupt(), pio_handler_set(), pio_handler_set_priority(), and pmc_enable_periph_clk().
Referenced by main().
struct bno055_t bno055 |
Referenced by bno055_init(), and bno055_initialize().