Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding RPi2 support #6

Merged
merged 2 commits into from May 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Examples/MPU6050/Source/MPU6050.h
Expand Up @@ -3,7 +3,8 @@

#include "PJ_RPI.h"

#define MPU6050_ADDR 0b01101001 // 7 bit adres
#define MPU6050_ADDR 0x68 // 7 bit adres
//#define MPU6050_ADDR 0x69 //One of these address should work. Depends on module HW address
#define CONFIG 0x1A
#define ACCEL_CONFIG 0x1C
#define GYRO_CONFIG 0x1B
Expand Down
14 changes: 13 additions & 1 deletion PJ_RPI.h
Expand Up @@ -17,9 +17,21 @@

#include <unistd.h>

// Define which Raspberry Pi board are you using. Take care to have defined only one at time.
#define RPI
//#define RPI2

#ifdef RPI
#define BCM2708_PERI_BASE 0x20000000
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) // GPIO controller
#define BSC0_BASE (BCM2708_PERI_BASE + 0x205000) // I2C controller
#define BSC0_BASE (BCM2708_PERI_BASE + 0x205000) // I2C controller
#endif

#ifdef RPI2
#define BCM2708_PERI_BASE 0x3F000000
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) // GPIO controller. Maybe wrong. Need to be tested.
#define BSC0_BASE (BCM2708_PERI_BASE + 0x804000) // I2C controller
#endif

#define PAGE_SIZE (4*1024)
#define BLOCK_SIZE (4*1024)
Expand Down