|
Definition av GPIO i bcm2835.h.
// RPi Version 1
RPI_GPIO_P1_03 = 0, ///< Version 1, Pin P1-03
RPI_GPIO_P1_05 = 1, ///< Version 1, Pin P1-05
RPI_GPIO_P1_07 = 4, ///< Version 1, Pin P1-07
RPI_GPIO_P1_08 = 14, ///< Version 1, Pin P1-08, defaults to alt function 0 UART0_TXD
RPI_GPIO_P1_10 = 15, ///< Version 1, Pin P1-10, defaults to alt function 0 UART0_RXD
RPI_GPIO_P1_11 = 17, ///< Version 1, Pin P1-11
RPI_GPIO_P1_12 = 18, ///< Version 1, Pin P1-12, can be PWM channel 0 in ALT FUN 5
RPI_GPIO_P1_13 = 21, ///< Version 1, Pin P1-13
RPI_GPIO_P1_15 = 22, ///< Version 1, Pin P1-15
RPI_GPIO_P1_16 = 23, ///< Version 1, Pin P1-16
RPI_GPIO_P1_18 = 24, ///< Version 1, Pin P1-18
RPI_GPIO_P1_19 = 10, ///< Version 1, Pin P1-19, MOSI when SPI0 in use
RPI_GPIO_P1_21 = 9, ///< Version 1, Pin P1-21, MISO when SPI0 in use
RPI_GPIO_P1_22 = 25, ///< Version 1, Pin P1-22
RPI_GPIO_P1_23 = 11, ///< Version 1, Pin P1-23, CLK when SPI0 in use
RPI_GPIO_P1_24 = 8, ///< Version 1, Pin P1-24, CE0 when SPI0 in use
RPI_GPIO_P1_26 = 7, ///< Version 1, Pin P1-26, CE1 when SPI0 in use
// RPi Version 2
RPI_V2_GPIO_P1_03 = 2, ///< Version 2, Pin P1-03
RPI_V2_GPIO_P1_05 = 3, ///< Version 2, Pin P1-05
RPI_V2_GPIO_P1_07 = 4, ///< Version 2, Pin P1-07
RPI_V2_GPIO_P1_08 = 14, ///< Version 2, Pin P1-08, defaults to alt function 0 UART0_TXD
RPI_V2_GPIO_P1_10 = 15, ///< Version 2, Pin P1-10, defaults to alt function 0 UART0_RXD
RPI_V2_GPIO_P1_11 = 17, ///< Version 2, Pin P1-11
RPI_V2_GPIO_P1_12 = 18, ///< Version 2, Pin P1-12, can be PWM channel 0 in ALT FUN 5
RPI_V2_GPIO_P1_13 = 27, ///< Version 2, Pin P1-13
RPI_V2_GPIO_P1_15 = 22, ///< Version 2, Pin P1-15
RPI_V2_GPIO_P1_16 = 23, ///< Version 2, Pin P1-16
RPI_V2_GPIO_P1_18 = 24, ///< Version 2, Pin P1-18
RPI_V2_GPIO_P1_19 = 10, ///< Version 2, Pin P1-19, MOSI when SPI0 in use
RPI_V2_GPIO_P1_21 = 9, ///< Version 2, Pin P1-21, MISO when SPI0 in use
RPI_V2_GPIO_P1_22 = 25, ///< Version 2, Pin P1-22
RPI_V2_GPIO_P1_23 = 11, ///< Version 2, Pin P1-23, CLK when SPI0 in use
RPI_V2_GPIO_P1_24 = 8, ///< Version 2, Pin P1-24, CE0 when SPI0 in use
RPI_V2_GPIO_P1_26 = 7, ///< Version 2, Pin P1-26, CE1 when SPI0 in use
Observera skillnaden mellan Version 1 PIN 13 (=21) och Version 2 PIN 13 (=27). Detta är väsentligt när man skriver ett program, att
man har koll på vilken version av Raspberry Pi man jobbar med.
|
|