Skip to content
Snippets Groups Projects
Commit 62224911 authored by schneider's avatar schneider
Browse files

feat(helloworld): Turn BHI on

parent d724a7d6
No related branches found
No related tags found
No related merge requests found
...@@ -68,6 +68,7 @@ CMSIS_ROOT=$(LIBS_DIR)/CMSIS ...@@ -68,6 +68,7 @@ CMSIS_ROOT=$(LIBS_DIR)/CMSIS
SRCS = main.c SRCS = main.c
SRCS += ../lib/card10/oled96.c SRCS += ../lib/card10/oled96.c
SRCS += ../lib/card10/fonts.c SRCS += ../lib/card10/fonts.c
SRCS += bhy_support.c bhy_uc_driver.c bhy.c
# Where to find source files for this test # Where to find source files for this test
VPATH = . VPATH = .
...@@ -78,6 +79,10 @@ IPATH = . ...@@ -78,6 +79,10 @@ IPATH = .
IPATH += ../lib/card10 IPATH += ../lib/card10
VPATH += ../lib/card10 VPATH += ../lib/card10
IPATH += ../lib/bosch/BHy1_driver_and_MCU_solution/driver/inc
IPATH += ../lib/bosch/BHy1_driver_and_MCU_solution/examples/firmware/
VPATH += ../lib/bosch/BHy1_driver_and_MCU_solution/driver/src
# Enable assertion checking for development # Enable assertion checking for development
PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE
......
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
#include "rtc.h" #include "rtc.h"
#include "spi.h" #include "spi.h"
#include "oled96.h" #include "oled96.h"
#include "bhy.h"
#include "Bosch_PCB_7183_di03_BMI160_BMM150-7183_di03.2.1.11696_170103.h"
#include "bhy_uc_driver.h"
/***** Definitions *****/ /***** Definitions *****/
...@@ -102,6 +105,10 @@ int main(void) ...@@ -102,6 +105,10 @@ int main(void)
//Setup the I2CM //Setup the I2CM
I2C_Shutdown(I2C_DEVICE); I2C_Shutdown(I2C_DEVICE);
I2C_Init(I2C_DEVICE, I2C_FAST_MODE, NULL); I2C_Init(I2C_DEVICE, I2C_FAST_MODE, NULL);
I2C_Shutdown(MXC_I2C1_BUS0);
I2C_Init(MXC_I2C1_BUS0, I2C_FAST_MODE, NULL);
#if 0 #if 0
NVIC_EnableIRQ(I2C0_IRQn); // Not sure if we actually need this when not doing async requests NVIC_EnableIRQ(I2C0_IRQn); // Not sure if we actually need this when not doing async requests
#endif #endif
...@@ -120,6 +127,11 @@ int main(void) ...@@ -120,6 +127,11 @@ int main(void)
oledFill(0x00); oledFill(0x00);
oledWriteString(0, 0, " card10", 1); oledWriteString(0, 0, " card10", 1);
if(bhy_driver_init(bhy1_fw)) {
printf("Failed to init bhy\n");
}
// Enable 32 kHz output // Enable 32 kHz output
RTC_SquareWave(MXC_RTC, SQUARE_WAVE_ENABLED, F_32KHZ, NOISE_IMMUNE_MODE, NULL); RTC_SquareWave(MXC_RTC, SQUARE_WAVE_ENABLED, F_32KHZ, NOISE_IMMUNE_MODE, NULL);
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
static struct bhy_t bhy; static struct bhy_t bhy;
static char *version = BHY_MCU_REFERENCE_VERSION; static char *version = BHY_MCU_REFERENCE_VERSION;
#define I2C_DEVICE MXC_I2C0_BUS0 #define I2C_DEVICE MXC_I2C1_BUS0
/********************************************************************************/ /********************************************************************************/
/* EXTERN FUNCTION DECLARATIONS */ /* EXTERN FUNCTION DECLARATIONS */
/********************************************************************************/ /********************************************************************************/
......
const unsigned char bhy1_fw[] = { #include <stdint.h>
const uint8_t bhy1_fw[] = {
0x2a, 0x65, 0x00, 0x1a, 0x9a, 0x31, 0x1b, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x65, 0x00, 0x1a, 0x9a, 0x31, 0x1b, 0xe7, 0x00, 0x00, 0x00, 0x00,
0x74, 0x28, 0x00, 0x00, 0xe8, 0x99, 0x7f, 0x00, 0x44, 0x19, 0x00, 0x00, 0x74, 0x28, 0x00, 0x00, 0xe8, 0x99, 0x7f, 0x00, 0x44, 0x19, 0x00, 0x00,
0x68, 0x8d, 0x7f, 0x00, 0x4a, 0x26, 0x00, 0x70, 0x4a, 0x26, 0x00, 0x70, 0x68, 0x8d, 0x7f, 0x00, 0x4a, 0x26, 0x00, 0x70, 0x4a, 0x26, 0x00, 0x70,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment