Install BCM2835 Library in Raspberry Pi

BCM2835 by AirSpayce is one of the widely used Raspberry Pi IO access library.

Steps to install as below;

1. Insert each line of following code into terminal or download script from link at bottom of page.

cd ~                  
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.58.tar.gz
tar xvfz bcm2835-1.58.tar.gz;
cd bcm2835-1.58;
./configure;
make;
sudo make install

*The version of library can be changed according to release.

BCM2835 Pin Map:
RPI_GPIO_P1_03 = 0, RPI_GPIO_P1_05 = 1,
RPI_GPIO_P1_07 = 4, RPI_GPIO_P1_08 = 14,
RPI_GPIO_P1_10 = 15, RPI_GPIO_P1_11 = 17,
RPI_GPIO_P1_12 = 18, RPI_GPIO_P1_13 = 21,
RPI_GPIO_P1_15 = 22, RPI_GPIO_P1_16 = 23,
RPI_GPIO_P1_18 = 24, RPI_GPIO_P1_19 = 10,
RPI_GPIO_P1_21 = 9, RPI_GPIO_P1_22 = 25,
RPI_GPIO_P1_23 = 11, RPI_GPIO_P1_24 = 8,
RPI_GPIO_P1_26 = 7,
/* RPi Version 2 /
RPI_V2_GPIO_P1_03 = 2, RPI_V2_GPIO_P1_05 = 3,
RPI_V2_GPIO_P1_07 = 4, RPI_V2_GPIO_P1_08 = 14,
RPI_V2_GPIO_P1_10 = 15, RPI_V2_GPIO_P1_11 = 17,
RPI_V2_GPIO_P1_12 = 18, RPI_V2_GPIO_P1_13 = 27,
RPI_V2_GPIO_P1_15 = 22, RPI_V2_GPIO_P1_16 = 23,
RPI_V2_GPIO_P1_18 = 24, RPI_V2_GPIO_P1_19 = 10,
RPI_V2_GPIO_P1_21 = 9, RPI_V2_GPIO_P1_22 = 25,
RPI_V2_GPIO_P1_23 = 11, RPI_V2_GPIO_P1_24 = 8,
RPI_V2_GPIO_P1_26 = 7, RPI_V2_GPIO_P1_29 = 5,
RPI_V2_GPIO_P1_31 = 6, RPI_V2_GPIO_P1_32 = 12,
RPI_V2_GPIO_P1_33 = 13, RPI_V2_GPIO_P1_35 = 19,
RPI_V2_GPIO_P1_36 = 16, RPI_V2_GPIO_P1_37 = 26,
RPI_V2_GPIO_P1_38 = 20, RPI_V2_GPIO_P1_40 = 21,
/ RPi Version 2, new plug P5 /
RPI_V2_GPIO_P5_03 = 28, RPI_V2_GPIO_P5_04 = 29,
RPI_V2_GPIO_P5_05 = 30, RPI_V2_GPIO_P5_06 = 31,
/ RPi B+ J8 header, also RPi 2 40 pin GPIO header */
RPI_BPLUS_GPIO_J8_03 = 2, RPI_BPLUS_GPIO_J8_05 = 3,
RPI_BPLUS_GPIO_J8_07 = 4, RPI_BPLUS_GPIO_J8_08 = 14,
RPI_BPLUS_GPIO_J8_10 = 15, RPI_BPLUS_GPIO_J8_11 = 17,
RPI_BPLUS_GPIO_J8_12 = 18, RPI_BPLUS_GPIO_J8_13 = 27,
RPI_BPLUS_GPIO_J8_15 = 22, RPI_BPLUS_GPIO_J8_16 = 23,
RPI_BPLUS_GPIO_J8_18 = 24, RPI_BPLUS_GPIO_J8_19 = 10,
RPI_BPLUS_GPIO_J8_21 = 9, RPI_BPLUS_GPIO_J8_22 = 25,
RPI_BPLUS_GPIO_J8_23 = 11, RPI_BPLUS_GPIO_J8_24 = 8,
RPI_BPLUS_GPIO_J8_26 = 7, RPI_BPLUS_GPIO_J8_29 = 5,
RPI_BPLUS_GPIO_J8_31 = 6, RPI_BPLUS_GPIO_J8_32 = 12,
RPI_BPLUS_GPIO_J8_33 = 13, RPI_BPLUS_GPIO_J8_35 = 19,
RPI_BPLUS_GPIO_J8_36 = 16, RPI_BPLUS_GPIO_J8_37 = 26,
RPI_BPLUS_GPIO_J8_38 = 20, RPI_BPLUS_GPIO_J8_40 = 21

Reference:

Author Website
https://www.airspayce.com/mikem/bcm2835/
Raspberry Pi Script
https://gist.github.com/techworked/f2f4ec804eb3ae5acfa2bf68769bd715

Leave a Reply

%d bloggers like this: