MySensors Library & Examples  2.3.2
bcm2835.h
1 /* bcm2835.h
2 
3  C and C++ support for Broadcom BCM 2835 as used in Raspberry Pi
4 
5  Author: Mike McCauley
6  Copyright (C) 2011-2013 Mike McCauley
7  $Id: bcm2835.h,v 1.25 2019/07/22 23:04:13 mikem Exp $
8 */
9 
549 /* Defines for BCM2835 */
550 #ifndef BCM2835_H
551 #define BCM2835_H
552 
553 #include <stdint.h>
554 
555 #define BCM2835_VERSION 10060 /* Version 1.60 */
556 
557 /* RPi 2 is ARM v7, and has DMB instruction for memory barriers.
558  Older RPis are ARM v6 and don't, so a coprocessor instruction must be used instead.
559  However, not all versions of gcc in all distros support the dmb assembler instruction even on conmpatible processors.
560  This test is so any ARMv7 or higher processors with suitable GCC will use DMB.
561 */
562 #if __ARM_ARCH >= 7
563 #define BCM2835_HAVE_DMB
564 #endif
565 
572 #define HIGH 0x1
573 
574 #define LOW 0x0
575 
577 #ifndef MIN
578 #define MIN(a, b) (a < b ? a : b)
579 #endif
580 
582 #define BCM2835_CORE_CLK_HZ 250000000
585 #define BMC2835_RPI2_DT_FILENAME "/proc/device-tree/soc/ranges"
586 
594 #define BCM2835_PERI_BASE 0x20000000
595 
596 #define BCM2835_PERI_SIZE 0x01000000
597 
598 #define BCM2835_RPI2_PERI_BASE 0x3F000000
599 
600 #define BCM2835_RPI4_PERI_BASE 0xFE000000
601 
602 #define BCM2835_RPI4_PERI_SIZE 0x01800000
603 
607 #define BCM2835_ST_BASE 0x3000
608 
609 #define BCM2835_GPIO_PADS 0x100000
610 
611 #define BCM2835_CLOCK_BASE 0x101000
612 
613 #define BCM2835_GPIO_BASE 0x200000
614 
615 #define BCM2835_SPI0_BASE 0x204000
616 
617 #define BCM2835_BSC0_BASE 0x205000
618 
619 #define BCM2835_GPIO_PWM 0x20C000
620 
621 #define BCM2835_AUX_BASE 0x215000
622 
623 #define BCM2835_SPI1_BASE 0x215080
624 
625 #define BCM2835_SPI2_BASE 0x2150C0
626 
627 #define BCM2835_BSC1_BASE 0x804000
628 
629 
633 extern uint32_t *bcm2835_peripherals_base;
635 extern uint32_t bcm2835_peripherals_size;
636 
638 extern uint32_t *bcm2835_peripherals;
639 
643 extern volatile uint32_t *bcm2835_st;
644 
648 extern volatile uint32_t *bcm2835_gpio;
649 
653 extern volatile uint32_t *bcm2835_pwm;
654 
658 extern volatile uint32_t *bcm2835_clk;
659 
663 extern volatile uint32_t *bcm2835_pads;
664 
668 extern volatile uint32_t *bcm2835_spi0;
669 
673 extern volatile uint32_t *bcm2835_bsc0;
674 
678 extern volatile uint32_t *bcm2835_bsc1;
679 
683 extern volatile uint32_t *bcm2835_aux;
684 
688 extern volatile uint32_t *bcm2835_spi1;
689 
690 
694 typedef enum {
706 
708 #define BCM2835_PAGE_SIZE (4*1024)
709 
710 #define BCM2835_BLOCK_SIZE (4*1024)
711 
712 
713 /* Defines for GPIO
714  The BCM2835 has 54 GPIO pins.
715  BCM2835 data sheet, Page 90 onwards.
716 */
720 #define BCM2835_GPFSEL0 0x0000
721 #define BCM2835_GPFSEL1 0x0004
722 #define BCM2835_GPFSEL2 0x0008
723 #define BCM2835_GPFSEL3 0x000c
724 #define BCM2835_GPFSEL4 0x0010
725 #define BCM2835_GPFSEL5 0x0014
726 #define BCM2835_GPSET0 0x001c
727 #define BCM2835_GPSET1 0x0020
728 #define BCM2835_GPCLR0 0x0028
729 #define BCM2835_GPCLR1 0x002c
730 #define BCM2835_GPLEV0 0x0034
731 #define BCM2835_GPLEV1 0x0038
732 #define BCM2835_GPEDS0 0x0040
733 #define BCM2835_GPEDS1 0x0044
734 #define BCM2835_GPREN0 0x004c
735 #define BCM2835_GPREN1 0x0050
736 #define BCM2835_GPFEN0 0x0058
737 #define BCM2835_GPFEN1 0x005c
738 #define BCM2835_GPHEN0 0x0064
739 #define BCM2835_GPHEN1 0x0068
740 #define BCM2835_GPLEN0 0x0070
741 #define BCM2835_GPLEN1 0x0074
742 #define BCM2835_GPAREN0 0x007c
743 #define BCM2835_GPAREN1 0x0080
744 #define BCM2835_GPAFEN0 0x0088
745 #define BCM2835_GPAFEN1 0x008c
746 #define BCM2835_GPPUD 0x0094
747 #define BCM2835_GPPUDCLK0 0x0098
748 #define BCM2835_GPPUDCLK1 0x009c
750 /* 2711 has a different method for pin pull-up/down/enable */
751 #define BCM2835_GPPUPPDN0 0x00e4 /* Pin pull-up/down for pins 15:0 */
752 #define BCM2835_GPPUPPDN1 0x00e8 /* Pin pull-up/down for pins 31:16 */
753 #define BCM2835_GPPUPPDN2 0x00ec /* Pin pull-up/down for pins 47:32 */
754 #define BCM2835_GPPUPPDN3 0x00f0 /* Pin pull-up/down for pins 57:48 */
755 
759 typedef enum {
770 
774 typedef enum {
779 
780 /* need a value for pud functions that can't work unless RPI 4 */
781 #define BCM2835_GPIO_PUD_ERROR 0x08
782 
784 #define BCM2835_PADS_GPIO_0_27 0x002c
785 #define BCM2835_PADS_GPIO_28_45 0x0030
786 #define BCM2835_PADS_GPIO_46_53 0x0034
789 #define BCM2835_PAD_PASSWRD (0x5A << 24)
790 #define BCM2835_PAD_SLEW_RATE_UNLIMITED 0x10
791 #define BCM2835_PAD_HYSTERESIS_ENABLED 0x08
792 #define BCM2835_PAD_DRIVE_2mA 0x00
793 #define BCM2835_PAD_DRIVE_4mA 0x01
794 #define BCM2835_PAD_DRIVE_6mA 0x02
795 #define BCM2835_PAD_DRIVE_8mA 0x03
796 #define BCM2835_PAD_DRIVE_10mA 0x04
797 #define BCM2835_PAD_DRIVE_12mA 0x05
798 #define BCM2835_PAD_DRIVE_14mA 0x06
799 #define BCM2835_PAD_DRIVE_16mA 0x07
804 typedef enum {
809 
824 typedef enum {
843  /* RPi Version 2 */
871  /* RPi Version 2, new plug P5 */
877  /* RPi B+ J8 header, also RPi 2 40 pin GPIO header */
904 } RPiGPIOPin;
905 
906 /* Defines for AUX
907  GPIO register offsets from BCM2835_AUX_BASE.
908 */
909 #define BCM2835_AUX_IRQ 0x0000
910 #define BCM2835_AUX_ENABLE 0x0004
912 #define BCM2835_AUX_ENABLE_UART1 0x01
913 #define BCM2835_AUX_ENABLE_SPI0 0x02
914 #define BCM2835_AUX_ENABLE_SPI1 0x04
917 #define BCM2835_AUX_SPI_CNTL0 0x0000
918 #define BCM2835_AUX_SPI_CNTL1 0x0004
919 #define BCM2835_AUX_SPI_STAT 0x0008
920 #define BCM2835_AUX_SPI_PEEK 0x000C
921 #define BCM2835_AUX_SPI_IO 0x0020
922 #define BCM2835_AUX_SPI_TXHOLD 0x0030
924 #define BCM2835_AUX_SPI_CLOCK_MIN 30500
925 #define BCM2835_AUX_SPI_CLOCK_MAX 125000000
927 #define BCM2835_AUX_SPI_CNTL0_SPEED 0xFFF00000
928 #define BCM2835_AUX_SPI_CNTL0_SPEED_MAX 0xFFF
929 #define BCM2835_AUX_SPI_CNTL0_SPEED_SHIFT 20
931 #define BCM2835_AUX_SPI_CNTL0_CS0_N 0x000C0000
932 #define BCM2835_AUX_SPI_CNTL0_CS1_N 0x000A0000
933 #define BCM2835_AUX_SPI_CNTL0_CS2_N 0x00060000
935 #define BCM2835_AUX_SPI_CNTL0_POSTINPUT 0x00010000
936 #define BCM2835_AUX_SPI_CNTL0_VAR_CS 0x00008000
937 #define BCM2835_AUX_SPI_CNTL0_VAR_WIDTH 0x00004000
938 #define BCM2835_AUX_SPI_CNTL0_DOUTHOLD 0x00003000
939 #define BCM2835_AUX_SPI_CNTL0_ENABLE 0x00000800
940 #define BCM2835_AUX_SPI_CNTL0_CPHA_IN 0x00000400
941 #define BCM2835_AUX_SPI_CNTL0_CLEARFIFO 0x00000200
942 #define BCM2835_AUX_SPI_CNTL0_CPHA_OUT 0x00000100
943 #define BCM2835_AUX_SPI_CNTL0_CPOL 0x00000080
944 #define BCM2835_AUX_SPI_CNTL0_MSBF_OUT 0x00000040
945 #define BCM2835_AUX_SPI_CNTL0_SHIFTLEN 0x0000003F
947 #define BCM2835_AUX_SPI_CNTL1_CSHIGH 0x00000700
948 #define BCM2835_AUX_SPI_CNTL1_IDLE 0x00000080
949 #define BCM2835_AUX_SPI_CNTL1_TXEMPTY 0x00000040
950 #define BCM2835_AUX_SPI_CNTL1_MSBF_IN 0x00000002
951 #define BCM2835_AUX_SPI_CNTL1_KEEP_IN 0x00000001
953 #define BCM2835_AUX_SPI_STAT_TX_LVL 0xFF000000
954 #define BCM2835_AUX_SPI_STAT_RX_LVL 0x00FF0000
955 #define BCM2835_AUX_SPI_STAT_TX_FULL 0x00000400
956 #define BCM2835_AUX_SPI_STAT_TX_EMPTY 0x00000200
957 #define BCM2835_AUX_SPI_STAT_RX_FULL 0x00000100
958 #define BCM2835_AUX_SPI_STAT_RX_EMPTY 0x00000080
959 #define BCM2835_AUX_SPI_STAT_BUSY 0x00000040
960 #define BCM2835_AUX_SPI_STAT_BITCOUNT 0x0000003F
962 /* Defines for SPI
963  GPIO register offsets from BCM2835_SPI0_BASE.
964  Offsets into the SPI Peripheral block in bytes per 10.5 SPI Register Map
965 */
966 #define BCM2835_SPI0_CS 0x0000
967 #define BCM2835_SPI0_FIFO 0x0004
968 #define BCM2835_SPI0_CLK 0x0008
969 #define BCM2835_SPI0_DLEN 0x000c
970 #define BCM2835_SPI0_LTOH 0x0010
971 #define BCM2835_SPI0_DC 0x0014
973 /* Register masks for SPI0_CS */
974 #define BCM2835_SPI0_CS_LEN_LONG 0x02000000
975 #define BCM2835_SPI0_CS_DMA_LEN 0x01000000
976 #define BCM2835_SPI0_CS_CSPOL2 0x00800000
977 #define BCM2835_SPI0_CS_CSPOL1 0x00400000
978 #define BCM2835_SPI0_CS_CSPOL0 0x00200000
979 #define BCM2835_SPI0_CS_RXF 0x00100000
980 #define BCM2835_SPI0_CS_RXR 0x00080000
981 #define BCM2835_SPI0_CS_TXD 0x00040000
982 #define BCM2835_SPI0_CS_RXD 0x00020000
983 #define BCM2835_SPI0_CS_DONE 0x00010000
984 #define BCM2835_SPI0_CS_TE_EN 0x00008000
985 #define BCM2835_SPI0_CS_LMONO 0x00004000
986 #define BCM2835_SPI0_CS_LEN 0x00002000
987 #define BCM2835_SPI0_CS_REN 0x00001000
988 #define BCM2835_SPI0_CS_ADCS 0x00000800
989 #define BCM2835_SPI0_CS_INTR 0x00000400
990 #define BCM2835_SPI0_CS_INTD 0x00000200
991 #define BCM2835_SPI0_CS_DMAEN 0x00000100
992 #define BCM2835_SPI0_CS_TA 0x00000080
993 #define BCM2835_SPI0_CS_CSPOL 0x00000040
994 #define BCM2835_SPI0_CS_CLEAR 0x00000030
995 #define BCM2835_SPI0_CS_CLEAR_RX 0x00000020
996 #define BCM2835_SPI0_CS_CLEAR_TX 0x00000010
997 #define BCM2835_SPI0_CS_CPOL 0x00000008
998 #define BCM2835_SPI0_CS_CPHA 0x00000004
999 #define BCM2835_SPI0_CS_CS 0x00000003
1004 typedef enum {
1008 
1012 typedef enum {
1017 } bcm2835SPIMode;
1018 
1022 typedef enum {
1028 
1043 typedef enum {
1062 
1063 /* Defines for I2C
1064  GPIO register offsets from BCM2835_BSC*_BASE.
1065  Offsets into the BSC Peripheral block in bytes per 3.1 BSC Register Map
1066 */
1067 #define BCM2835_BSC_C 0x0000
1068 #define BCM2835_BSC_S 0x0004
1069 #define BCM2835_BSC_DLEN 0x0008
1070 #define BCM2835_BSC_A 0x000c
1071 #define BCM2835_BSC_FIFO 0x0010
1072 #define BCM2835_BSC_DIV 0x0014
1073 #define BCM2835_BSC_DEL 0x0018
1074 #define BCM2835_BSC_CLKT 0x001c
1076 /* Register masks for BSC_C */
1077 #define BCM2835_BSC_C_I2CEN 0x00008000
1078 #define BCM2835_BSC_C_INTR 0x00000400
1079 #define BCM2835_BSC_C_INTT 0x00000200
1080 #define BCM2835_BSC_C_INTD 0x00000100
1081 #define BCM2835_BSC_C_ST 0x00000080
1082 #define BCM2835_BSC_C_CLEAR_1 0x00000020
1083 #define BCM2835_BSC_C_CLEAR_2 0x00000010
1084 #define BCM2835_BSC_C_READ 0x00000001
1086 /* Register masks for BSC_S */
1087 #define BCM2835_BSC_S_CLKT 0x00000200
1088 #define BCM2835_BSC_S_ERR 0x00000100
1089 #define BCM2835_BSC_S_RXF 0x00000080
1090 #define BCM2835_BSC_S_TXE 0x00000040
1091 #define BCM2835_BSC_S_RXD 0x00000020
1092 #define BCM2835_BSC_S_TXD 0x00000010
1093 #define BCM2835_BSC_S_RXR 0x00000008
1094 #define BCM2835_BSC_S_TXW 0x00000004
1095 #define BCM2835_BSC_S_DONE 0x00000002
1096 #define BCM2835_BSC_S_TA 0x00000001
1098 #define BCM2835_BSC_FIFO_SIZE 16
1104 typedef enum {
1110 
1114 typedef enum {
1120 
1121 /* Defines for ST
1122  GPIO register offsets from BCM2835_ST_BASE.
1123  Offsets into the ST Peripheral block in bytes per 12.1 System Timer Registers
1124  The System Timer peripheral provides four 32-bit timer channels and a single 64-bit free running counter.
1125  BCM2835_ST_CLO is the System Timer Counter Lower bits register.
1126  The system timer free-running counter lower register is a read-only register that returns the current value
1127  of the lower 32-bits of the free running counter.
1128  BCM2835_ST_CHI is the System Timer Counter Upper bits register.
1129  The system timer free-running counter upper register is a read-only register that returns the current value
1130  of the upper 32-bits of the free running counter.
1131 */
1132 #define BCM2835_ST_CS 0x0000
1133 #define BCM2835_ST_CLO 0x0004
1134 #define BCM2835_ST_CHI 0x0008
1139 /* Defines for PWM, word offsets (ie 4 byte multiples) */
1140 #define BCM2835_PWM_CONTROL 0
1141 #define BCM2835_PWM_STATUS 1
1142 #define BCM2835_PWM_DMAC 2
1143 #define BCM2835_PWM0_RANGE 4
1144 #define BCM2835_PWM0_DATA 5
1145 #define BCM2835_PWM_FIF1 6
1146 #define BCM2835_PWM1_RANGE 8
1147 #define BCM2835_PWM1_DATA 9
1148 
1149 /* Defines for PWM Clock, word offsets (ie 4 byte multiples) */
1150 #define BCM2835_PWMCLK_CNTL 40
1151 #define BCM2835_PWMCLK_DIV 41
1152 #define BCM2835_PWM_PASSWRD (0x5A << 24)
1154 #define BCM2835_PWM1_MS_MODE 0x8000
1155 #define BCM2835_PWM1_USEFIFO 0x2000
1156 #define BCM2835_PWM1_REVPOLAR 0x1000
1157 #define BCM2835_PWM1_OFFSTATE 0x0800
1158 #define BCM2835_PWM1_REPEATFF 0x0400
1159 #define BCM2835_PWM1_SERIAL 0x0200
1160 #define BCM2835_PWM1_ENABLE 0x0100
1162 #define BCM2835_PWM0_MS_MODE 0x0080
1163 #define BCM2835_PWM_CLEAR_FIFO 0x0040
1164 #define BCM2835_PWM0_USEFIFO 0x0020
1165 #define BCM2835_PWM0_REVPOLAR 0x0010
1166 #define BCM2835_PWM0_OFFSTATE 0x0008
1167 #define BCM2835_PWM0_REPEATFF 0x0004
1168 #define BCM2835_PWM0_SERIAL 0x0002
1169 #define BCM2835_PWM0_ENABLE 0x0001
1177 typedef enum {
1178  BCM2835_PWM_CLOCK_DIVIDER_2048 = 2048,
1179  BCM2835_PWM_CLOCK_DIVIDER_1024 = 1024,
1180  BCM2835_PWM_CLOCK_DIVIDER_512 = 512,
1181  BCM2835_PWM_CLOCK_DIVIDER_256 = 256,
1182  BCM2835_PWM_CLOCK_DIVIDER_128 = 128,
1183  BCM2835_PWM_CLOCK_DIVIDER_64 = 64,
1184  BCM2835_PWM_CLOCK_DIVIDER_32 = 32,
1185  BCM2835_PWM_CLOCK_DIVIDER_16 = 16,
1186  BCM2835_PWM_CLOCK_DIVIDER_8 = 8,
1187  BCM2835_PWM_CLOCK_DIVIDER_4 = 4,
1188  BCM2835_PWM_CLOCK_DIVIDER_2 = 2,
1189  BCM2835_PWM_CLOCK_DIVIDER_1 = 1
1190 } bcm2835PWMClockDivider;
1191 
1192 /* Historical name compatibility */
1193 #ifndef BCM2835_NO_DELAY_COMPATIBILITY
1194 #define delay(x) bcm2835_delay(x)
1195 #define delayMicroseconds(x) bcm2835_delayMicroseconds(x)
1196 #endif
1197 
1198 #ifdef __cplusplus
1199 extern "C" {
1200 #endif
1201 
1220 extern int bcm2835_init(void);
1221 
1225 extern int bcm2835_close(void);
1226 
1234 extern void bcm2835_set_debug(uint8_t debug);
1235 
1239 extern unsigned int bcm2835_version(void);
1240 
1256 extern uint32_t* bcm2835_regbase(uint8_t regbase);
1257 
1266 extern uint32_t bcm2835_peri_read(volatile uint32_t* paddr);
1267 
1278 extern uint32_t bcm2835_peri_read_nb(volatile uint32_t* paddr);
1279 
1280 
1292 extern void bcm2835_peri_write(volatile uint32_t* paddr, uint32_t value);
1293 
1306 extern void bcm2835_peri_write_nb(volatile uint32_t* paddr, uint32_t value);
1307 
1320 extern void bcm2835_peri_set_bits(volatile uint32_t* paddr, uint32_t value, uint32_t mask);
1334 extern void bcm2835_gpio_fsel(uint8_t pin, uint8_t mode);
1335 
1341 extern void bcm2835_gpio_set(uint8_t pin);
1342 
1348 extern void bcm2835_gpio_clr(uint8_t pin);
1349 
1355 extern void bcm2835_gpio_set_multi(uint32_t mask);
1356 
1362 extern void bcm2835_gpio_clr_multi(uint32_t mask);
1363 
1370 extern uint8_t bcm2835_gpio_lev(uint8_t pin);
1371 
1380 extern uint8_t bcm2835_gpio_eds(uint8_t pin);
1381 
1387 extern uint32_t bcm2835_gpio_eds_multi(uint32_t mask);
1388 
1394 extern void bcm2835_gpio_set_eds(uint8_t pin);
1395 
1400 extern void bcm2835_gpio_set_eds_multi(uint32_t mask);
1401 
1410 extern void bcm2835_gpio_ren(uint8_t pin);
1411 
1415 extern void bcm2835_gpio_clr_ren(uint8_t pin);
1416 
1425 extern void bcm2835_gpio_fen(uint8_t pin);
1426 
1430 extern void bcm2835_gpio_clr_fen(uint8_t pin);
1431 
1436 extern void bcm2835_gpio_hen(uint8_t pin);
1437 
1441 extern void bcm2835_gpio_clr_hen(uint8_t pin);
1442 
1447 extern void bcm2835_gpio_len(uint8_t pin);
1448 
1452 extern void bcm2835_gpio_clr_len(uint8_t pin);
1453 
1460 extern void bcm2835_gpio_aren(uint8_t pin);
1461 
1465 extern void bcm2835_gpio_clr_aren(uint8_t pin);
1466 
1473 extern void bcm2835_gpio_afen(uint8_t pin);
1474 
1478 extern void bcm2835_gpio_clr_afen(uint8_t pin);
1479 
1488 extern void bcm2835_gpio_pud(uint8_t pud);
1489 
1500 extern void bcm2835_gpio_pudclk(uint8_t pin, uint8_t on);
1501 
1507 extern uint32_t bcm2835_gpio_pad(uint8_t group);
1508 
1516 extern void bcm2835_gpio_set_pad(uint8_t group, uint32_t control);
1517 
1528 extern void bcm2835_delay (unsigned int millis);
1529 
1543 extern void bcm2835_delayMicroseconds (uint64_t micros);
1544 
1549 extern void bcm2835_gpio_write(uint8_t pin, uint8_t on);
1550 
1555 extern void bcm2835_gpio_write_multi(uint32_t mask, uint8_t on);
1556 
1561 extern void bcm2835_gpio_write_mask(uint32_t value, uint32_t mask);
1562 
1568 extern void bcm2835_gpio_set_pud(uint8_t pin, uint8_t pud);
1569 
1576 extern uint8_t bcm2835_gpio_get_pud(uint8_t pin);
1577 
1594 extern int bcm2835_spi_begin(void);
1595 
1600 extern void bcm2835_spi_end(void);
1601 
1609 extern void bcm2835_spi_setBitOrder(uint8_t order);
1610 
1616 extern void bcm2835_spi_setClockDivider(uint16_t divider);
1617 
1622 extern void bcm2835_spi_set_speed_hz(uint32_t speed_hz);
1623 
1629 extern void bcm2835_spi_setDataMode(uint8_t mode);
1630 
1637 extern void bcm2835_spi_chipSelect(uint8_t cs);
1638 
1647 extern void bcm2835_spi_setChipSelectPolarity(uint8_t cs, uint8_t active);
1648 
1659 extern uint8_t bcm2835_spi_transfer(uint8_t value);
1660 
1672 extern void bcm2835_spi_transfernb(char* tbuf, char* rbuf, uint32_t len);
1673 
1681 extern void bcm2835_spi_transfern(char* buf, uint32_t len);
1682 
1689 extern void bcm2835_spi_writenb(const char* buf, uint32_t len);
1690 
1700 extern void bcm2835_spi_write(uint16_t data);
1701 
1707 extern int bcm2835_aux_spi_begin(void);
1708 
1713 extern void bcm2835_aux_spi_end(void);
1714 
1718 extern void bcm2835_aux_spi_setClockDivider(uint16_t divider);
1719 
1725 extern uint16_t bcm2835_aux_spi_CalcClockDivider(uint32_t speed_hz);
1726 
1733 extern void bcm2835_aux_spi_write(uint16_t data);
1734 
1740 extern void bcm2835_aux_spi_writenb(const char *buf, uint32_t len);
1741 
1749 extern void bcm2835_aux_spi_transfern(char *buf, uint32_t len);
1750 
1759 extern void bcm2835_aux_spi_transfernb(const char *tbuf, char *rbuf, uint32_t len);
1760 
1777 extern int bcm2835_i2c_begin(void);
1778 
1783 extern void bcm2835_i2c_end(void);
1784 
1788 extern void bcm2835_i2c_setSlaveAddress(uint8_t addr);
1789 
1794 extern void bcm2835_i2c_setClockDivider(uint16_t divider);
1795 
1802 extern void bcm2835_i2c_set_baudrate(uint32_t baudrate);
1803 
1810 extern uint8_t bcm2835_i2c_write(const char * buf, uint32_t len);
1811 
1818 extern uint8_t bcm2835_i2c_read(char* buf, uint32_t len);
1819 
1834 extern uint8_t bcm2835_i2c_read_register_rs(char* regaddr, char* buf, uint32_t len);
1835 
1846 extern uint8_t bcm2835_i2c_write_read_rs(char* cmds, uint32_t cmds_len, char* buf,
1847  uint32_t buf_len);
1848 
1859 extern uint64_t bcm2835_st_read(void);
1860 
1865 extern void bcm2835_st_delay(uint64_t offset_micros, uint64_t micros);
1866 
1882 extern void bcm2835_pwm_set_clock(uint32_t divisor);
1883 
1890 extern void bcm2835_pwm_set_mode(uint8_t channel, uint8_t markspace, uint8_t enabled);
1891 
1897 extern void bcm2835_pwm_set_range(uint8_t channel, uint32_t range);
1898 
1905 extern void bcm2835_pwm_set_data(uint8_t channel, uint32_t data);
1906 
1908 #ifdef __cplusplus
1909 }
1910 #endif
1911 
1912 #endif /* BCM2835_H */
1913 
bcm2835SPIClockDivider
bcm2835SPIClockDivider
bcm2835SPIClockDivider Specifies the divider used to generate the SPI clock from the system clock....
Definition: bcm2835.h:1043
BCM2835_I2C_REASON_OK
@ BCM2835_I2C_REASON_OK
Definition: bcm2835.h:1115
RPI_GPIO_P1_05
@ RPI_GPIO_P1_05
Definition: bcm2835.h:826
BCM2835_SPI_CLOCK_DIVIDER_16384
@ BCM2835_SPI_CLOCK_DIVIDER_16384
Definition: bcm2835.h:1046
bcm2835_gpio_clr_aren
void bcm2835_gpio_clr_aren(uint8_t pin)
bcm2835_clk
volatile uint32_t * bcm2835_clk
bcm2835_gpio_write
void bcm2835_gpio_write(uint8_t pin, uint8_t on)
BCM2835_REGBASE_CLK
@ BCM2835_REGBASE_CLK
Definition: bcm2835.h:698
bcm2835_spi_transfernb
void bcm2835_spi_transfernb(char *tbuf, char *rbuf, uint32_t len)
data
char data[MAX_PAYLOAD_SIZE+1]
Buffer for raw payload data.
Definition: MyMessage.h:653
bcm2835_aux_spi_transfern
void bcm2835_aux_spi_transfern(char *buf, uint32_t len)
RPI_V2_GPIO_P5_06
@ RPI_V2_GPIO_P5_06
Definition: bcm2835.h:875
BCM2835_PAD_GROUP_GPIO_0_27
@ BCM2835_PAD_GROUP_GPIO_0_27
Definition: bcm2835.h:805
RPI_GPIO_P1_19
@ RPI_GPIO_P1_19
Definition: bcm2835.h:836
bcm2835_pwm
volatile uint32_t * bcm2835_pwm
RPI_BPLUS_GPIO_J8_19
@ RPI_BPLUS_GPIO_J8_19
Definition: bcm2835.h:889
bcm2835_gpio_fen
void bcm2835_gpio_fen(uint8_t pin)
BCM2835_SPI_CS0
@ BCM2835_SPI_CS0
Definition: bcm2835.h:1023
BCM2835_SPI_MODE1
@ BCM2835_SPI_MODE1
Definition: bcm2835.h:1014
BCM2835_SPI_CLOCK_DIVIDER_32768
@ BCM2835_SPI_CLOCK_DIVIDER_32768
Definition: bcm2835.h:1045
bcm2835_pwm_set_range
void bcm2835_pwm_set_range(uint8_t channel, uint32_t range)
RPI_V2_GPIO_P1_18
@ RPI_V2_GPIO_P1_18
Definition: bcm2835.h:854
bcm2835_gpio_afen
void bcm2835_gpio_afen(uint8_t pin)
bcm2835_spi1
volatile uint32_t * bcm2835_spi1
RPI_GPIO_P1_12
@ RPI_GPIO_P1_12
Definition: bcm2835.h:831
RPI_V2_GPIO_P5_05
@ RPI_V2_GPIO_P5_05
Definition: bcm2835.h:874
bcm2835_close
int bcm2835_close(void)
bcm2835_gpio_eds_multi
uint32_t bcm2835_gpio_eds_multi(uint32_t mask)
BCM2835_GPIO_FSEL_ALT5
@ BCM2835_GPIO_FSEL_ALT5
Definition: bcm2835.h:767
bcm2835_gpio_clr_multi
void bcm2835_gpio_clr_multi(uint32_t mask)
BCM2835_GPIO_FSEL_MASK
@ BCM2835_GPIO_FSEL_MASK
Definition: bcm2835.h:768
BCM2835_PAD_GROUP_GPIO_28_45
@ BCM2835_PAD_GROUP_GPIO_28_45
Definition: bcm2835.h:806
RPI_GPIO_P1_18
@ RPI_GPIO_P1_18
Definition: bcm2835.h:835
bcm2835SPIChipSelect
bcm2835SPIChipSelect
bcm2835SPIChipSelect Specify the SPI chip select pin(s)
Definition: bcm2835.h:1022
bcm2835_aux_spi_writenb
void bcm2835_aux_spi_writenb(const char *buf, uint32_t len)
RPI_V2_GPIO_P1_05
@ RPI_V2_GPIO_P1_05
Definition: bcm2835.h:845
BCM2835_SPI_MODE2
@ BCM2835_SPI_MODE2
Definition: bcm2835.h:1015
bcm2835_i2c_setClockDivider
void bcm2835_i2c_setClockDivider(uint16_t divider)
bcm2835_st_read
uint64_t bcm2835_st_read(void)
RPI_BPLUS_GPIO_J8_13
@ RPI_BPLUS_GPIO_J8_13
Definition: bcm2835.h:885
RPI_BPLUS_GPIO_J8_22
@ RPI_BPLUS_GPIO_J8_22
Definition: bcm2835.h:891
bcm2835_gpio_set_multi
void bcm2835_gpio_set_multi(uint32_t mask)
bcm2835_pwm_set_data
void bcm2835_pwm_set_data(uint8_t channel, uint32_t data)
BCM2835_SPI_CLOCK_DIVIDER_65536
@ BCM2835_SPI_CLOCK_DIVIDER_65536
Definition: bcm2835.h:1044
bcm2835_st
volatile uint32_t * bcm2835_st
bcm2835_i2c_write_read_rs
uint8_t bcm2835_i2c_write_read_rs(char *cmds, uint32_t cmds_len, char *buf, uint32_t buf_len)
BCM2835_SPI_CLOCK_DIVIDER_2
@ BCM2835_SPI_CLOCK_DIVIDER_2
Definition: bcm2835.h:1059
RPI_GPIO_P1_08
@ RPI_GPIO_P1_08
Definition: bcm2835.h:828
bcm2835_gpio_eds
uint8_t bcm2835_gpio_eds(uint8_t pin)
bcm2835_pwm_set_clock
void bcm2835_pwm_set_clock(uint32_t divisor)
bcm2835_peri_read_nb
uint32_t bcm2835_peri_read_nb(volatile uint32_t *paddr)
RPI_BPLUS_GPIO_J8_40
@ RPI_BPLUS_GPIO_J8_40
Definition: bcm2835.h:903
BCM2835_REGBASE_SPI1
@ BCM2835_REGBASE_SPI1
Definition: bcm2835.h:704
BCM2835_SPI_CLOCK_DIVIDER_1024
@ BCM2835_SPI_CLOCK_DIVIDER_1024
Definition: bcm2835.h:1050
bcm2835_gpio_set_eds
void bcm2835_gpio_set_eds(uint8_t pin)
bcm2835_delayMicroseconds
void bcm2835_delayMicroseconds(uint64_t micros)
bcm2835I2CClockDivider
bcm2835I2CClockDivider
bcm2835I2CClockDivider Specifies the divider used to generate the I2C clock from the system clock....
Definition: bcm2835.h:1104
bcm2835_spi_end
void bcm2835_spi_end(void)
bcm2835_gpio_clr
void bcm2835_gpio_clr(uint8_t pin)
BCM2835_REGBASE_SPI0
@ BCM2835_REGBASE_SPI0
Definition: bcm2835.h:700
bcm2835_init
int bcm2835_init(void)
bcm2835_spi_transfer
uint8_t bcm2835_spi_transfer(uint8_t value)
bcm2835_peri_read
uint32_t bcm2835_peri_read(volatile uint32_t *paddr)
RPI_GPIO_P1_24
@ RPI_GPIO_P1_24
Definition: bcm2835.h:840
RPiGPIOPin
RPiGPIOPin
GPIO Pin Numbers.
Definition: bcm2835.h:824
RPI_GPIO_P1_11
@ RPI_GPIO_P1_11
Definition: bcm2835.h:830
BCM2835_REGBASE_BSC0
@ BCM2835_REGBASE_BSC0
Definition: bcm2835.h:701
RPI_V2_GPIO_P1_03
@ RPI_V2_GPIO_P1_03
Definition: bcm2835.h:844
RPI_V2_GPIO_P1_08
@ RPI_V2_GPIO_P1_08
Definition: bcm2835.h:847
BCM2835_GPIO_FSEL_INPT
@ BCM2835_GPIO_FSEL_INPT
Definition: bcm2835.h:760
bcm2835_gpio_lev
uint8_t bcm2835_gpio_lev(uint8_t pin)
BCM2835_SPI_CS_NONE
@ BCM2835_SPI_CS_NONE
Definition: bcm2835.h:1026
bcm2835_i2c_write
uint8_t bcm2835_i2c_write(const char *buf, uint32_t len)
BCM2835_SPI_BIT_ORDER_MSBFIRST
@ BCM2835_SPI_BIT_ORDER_MSBFIRST
Definition: bcm2835.h:1006
BCM2835_SPI_CLOCK_DIVIDER_32
@ BCM2835_SPI_CLOCK_DIVIDER_32
Definition: bcm2835.h:1055
bcm2835_pwm_set_mode
void bcm2835_pwm_set_mode(uint8_t channel, uint8_t markspace, uint8_t enabled)
bcm2835_gpio_clr_hen
void bcm2835_gpio_clr_hen(uint8_t pin)
RPI_V2_GPIO_P1_36
@ RPI_V2_GPIO_P1_36
Definition: bcm2835.h:866
RPI_BPLUS_GPIO_J8_29
@ RPI_BPLUS_GPIO_J8_29
Definition: bcm2835.h:895
BCM2835_I2C_CLOCK_DIVIDER_148
@ BCM2835_I2C_CLOCK_DIVIDER_148
Definition: bcm2835.h:1108
bcm2835_aux
volatile uint32_t * bcm2835_aux
RPI_V2_GPIO_P1_23
@ RPI_V2_GPIO_P1_23
Definition: bcm2835.h:858
RPI_V2_GPIO_P5_03
@ RPI_V2_GPIO_P5_03
Definition: bcm2835.h:872
BCM2835_SPI_CS1
@ BCM2835_SPI_CS1
Definition: bcm2835.h:1024
RPI_V2_GPIO_P1_31
@ RPI_V2_GPIO_P1_31
Definition: bcm2835.h:862
BCM2835_PAD_GROUP_GPIO_46_53
@ BCM2835_PAD_GROUP_GPIO_46_53
Definition: bcm2835.h:807
RPI_BPLUS_GPIO_J8_03
@ RPI_BPLUS_GPIO_J8_03
Definition: bcm2835.h:878
bcm2835_i2c_end
void bcm2835_i2c_end(void)
bcm2835_aux_spi_begin
int bcm2835_aux_spi_begin(void)
RPI_V2_GPIO_P1_37
@ RPI_V2_GPIO_P1_37
Definition: bcm2835.h:867
bcm2835_gpio_get_pud
uint8_t bcm2835_gpio_get_pud(uint8_t pin)
bcm2835_spi_setDataMode
void bcm2835_spi_setDataMode(uint8_t mode)
bcm2835_i2c_read_register_rs
uint8_t bcm2835_i2c_read_register_rs(char *regaddr, char *buf, uint32_t len)
RPI_V2_GPIO_P1_11
@ RPI_V2_GPIO_P1_11
Definition: bcm2835.h:849
bcm2835_peri_write_nb
void bcm2835_peri_write_nb(volatile uint32_t *paddr, uint32_t value)
bcm2835_gpio_clr_fen
void bcm2835_gpio_clr_fen(uint8_t pin)
BCM2835_SPI_CLOCK_DIVIDER_64
@ BCM2835_SPI_CLOCK_DIVIDER_64
Definition: bcm2835.h:1054
bcm2835_aux_spi_CalcClockDivider
uint16_t bcm2835_aux_spi_CalcClockDivider(uint32_t speed_hz)
bcm2835_spi0
volatile uint32_t * bcm2835_spi0
RPI_GPIO_P1_13
@ RPI_GPIO_P1_13
Definition: bcm2835.h:832
bcm2835_i2c_begin
int bcm2835_i2c_begin(void)
bcm2835_i2c_read
uint8_t bcm2835_i2c_read(char *buf, uint32_t len)
RPI_V2_GPIO_P1_38
@ RPI_V2_GPIO_P1_38
Definition: bcm2835.h:868
RPI_GPIO_P1_10
@ RPI_GPIO_P1_10
Definition: bcm2835.h:829
BCM2835_REGBASE_GPIO
@ BCM2835_REGBASE_GPIO
Definition: bcm2835.h:696
bcm2835_aux_spi_transfernb
void bcm2835_aux_spi_transfernb(const char *tbuf, char *rbuf, uint32_t len)
bcm2835_regbase
uint32_t * bcm2835_regbase(uint8_t regbase)
BCM2835_I2C_CLOCK_DIVIDER_150
@ BCM2835_I2C_CLOCK_DIVIDER_150
Definition: bcm2835.h:1107
bcm2835PUDControl
bcm2835PUDControl
bcm2835PUDControl Pullup/Pulldown defines for bcm2835_gpio_pud()
Definition: bcm2835.h:774
RPI_GPIO_P1_22
@ RPI_GPIO_P1_22
Definition: bcm2835.h:838
BCM2835_GPIO_FSEL_ALT4
@ BCM2835_GPIO_FSEL_ALT4
Definition: bcm2835.h:766
RPI_BPLUS_GPIO_J8_35
@ RPI_BPLUS_GPIO_J8_35
Definition: bcm2835.h:899
RPI_V2_GPIO_P1_19
@ RPI_V2_GPIO_P1_19
Definition: bcm2835.h:855
RPI_V2_GPIO_P1_10
@ RPI_V2_GPIO_P1_10
Definition: bcm2835.h:848
BCM2835_I2C_REASON_ERROR_NACK
@ BCM2835_I2C_REASON_ERROR_NACK
Definition: bcm2835.h:1116
BCM2835_SPI_CLOCK_DIVIDER_1
@ BCM2835_SPI_CLOCK_DIVIDER_1
Definition: bcm2835.h:1060
RPI_GPIO_P1_16
@ RPI_GPIO_P1_16
Definition: bcm2835.h:834
bcm2835_spi_begin
int bcm2835_spi_begin(void)
bcm2835_gpio_ren
void bcm2835_gpio_ren(uint8_t pin)
bcm2835_peripherals_base
uint32_t * bcm2835_peripherals_base
RPI_V2_GPIO_P1_33
@ RPI_V2_GPIO_P1_33
Definition: bcm2835.h:864
BCM2835_REGBASE_PWM
@ BCM2835_REGBASE_PWM
Definition: bcm2835.h:697
bcm2835_gpio_clr_ren
void bcm2835_gpio_clr_ren(uint8_t pin)
bcm2835_delay
void bcm2835_delay(unsigned int millis)
bcm2835_gpio
volatile uint32_t * bcm2835_gpio
BCM2835_SPI_CLOCK_DIVIDER_4096
@ BCM2835_SPI_CLOCK_DIVIDER_4096
Definition: bcm2835.h:1048
BCM2835_SPI_CLOCK_DIVIDER_512
@ BCM2835_SPI_CLOCK_DIVIDER_512
Definition: bcm2835.h:1051
BCM2835_SPI_CLOCK_DIVIDER_128
@ BCM2835_SPI_CLOCK_DIVIDER_128
Definition: bcm2835.h:1053
RPI_GPIO_P1_15
@ RPI_GPIO_P1_15
Definition: bcm2835.h:833
RPI_BPLUS_GPIO_J8_31
@ RPI_BPLUS_GPIO_J8_31
Definition: bcm2835.h:896
bcm2835_spi_set_speed_hz
void bcm2835_spi_set_speed_hz(uint32_t speed_hz)
bcm2835_gpio_pudclk
void bcm2835_gpio_pudclk(uint8_t pin, uint8_t on)
RPI_BPLUS_GPIO_J8_21
@ RPI_BPLUS_GPIO_J8_21
Definition: bcm2835.h:890
bcm2835I2CReasonCodes
bcm2835I2CReasonCodes
bcm2835I2CReasonCodes Specifies the reason codes for the bcm2835_i2c_write and bcm2835_i2c_read funct...
Definition: bcm2835.h:1114
RPI_BPLUS_GPIO_J8_10
@ RPI_BPLUS_GPIO_J8_10
Definition: bcm2835.h:882
BCM2835_SPI_MODE0
@ BCM2835_SPI_MODE0
Definition: bcm2835.h:1013
RPI_BPLUS_GPIO_J8_26
@ RPI_BPLUS_GPIO_J8_26
Definition: bcm2835.h:894
BCM2835_SPI_BIT_ORDER_LSBFIRST
@ BCM2835_SPI_BIT_ORDER_LSBFIRST
Definition: bcm2835.h:1005
bcm2835SPIBitOrder
bcm2835SPIBitOrder
bcm2835SPIBitOrder SPI Bit order Specifies the SPI data bit ordering for bcm2835_spi_setBitOrder()
Definition: bcm2835.h:1004
bcm2835_peripherals
uint32_t * bcm2835_peripherals
bcm2835_peri_set_bits
void bcm2835_peri_set_bits(volatile uint32_t *paddr, uint32_t value, uint32_t mask)
BCM2835_SPI_CLOCK_DIVIDER_4
@ BCM2835_SPI_CLOCK_DIVIDER_4
Definition: bcm2835.h:1058
bcm2835FunctionSelect
bcm2835FunctionSelect
bcm2835PortFunction Port function select modes for bcm2835_gpio_fsel()
Definition: bcm2835.h:759
RPI_GPIO_P1_03
@ RPI_GPIO_P1_03
Definition: bcm2835.h:825
bcm2835_st_delay
void bcm2835_st_delay(uint64_t offset_micros, uint64_t micros)
RPI_V2_GPIO_P1_15
@ RPI_V2_GPIO_P1_15
Definition: bcm2835.h:852
BCM2835_SPI_MODE3
@ BCM2835_SPI_MODE3
Definition: bcm2835.h:1016
RPI_BPLUS_GPIO_J8_32
@ RPI_BPLUS_GPIO_J8_32
Definition: bcm2835.h:897
RPI_V2_GPIO_P1_22
@ RPI_V2_GPIO_P1_22
Definition: bcm2835.h:857
BCM2835_GPIO_FSEL_ALT1
@ BCM2835_GPIO_FSEL_ALT1
Definition: bcm2835.h:763
RPI_BPLUS_GPIO_J8_23
@ RPI_BPLUS_GPIO_J8_23
Definition: bcm2835.h:892
RPI_V2_GPIO_P1_16
@ RPI_V2_GPIO_P1_16
Definition: bcm2835.h:853
bcm2835_spi_write
void bcm2835_spi_write(uint16_t data)
bcm2835_aux_spi_write
void bcm2835_aux_spi_write(uint16_t data)
RPI_V2_GPIO_P5_04
@ RPI_V2_GPIO_P5_04
Definition: bcm2835.h:873
bcm2835_spi_transfern
void bcm2835_spi_transfern(char *buf, uint32_t len)
bcm2835_gpio_set
void bcm2835_gpio_set(uint8_t pin)
bcm2835_spi_writenb
void bcm2835_spi_writenb(const char *buf, uint32_t len)
BCM2835_I2C_REASON_ERROR_CLKT
@ BCM2835_I2C_REASON_ERROR_CLKT
Definition: bcm2835.h:1117
RPI_V2_GPIO_P1_07
@ RPI_V2_GPIO_P1_07
Definition: bcm2835.h:846
bcm2835SPIMode
bcm2835SPIMode
SPI Data mode Specify the SPI data mode to be passed to bcm2835_spi_setDataMode()
Definition: bcm2835.h:1012
BCM2835_GPIO_FSEL_OUTP
@ BCM2835_GPIO_FSEL_OUTP
Definition: bcm2835.h:761
bcm2835_gpio_pad
uint32_t bcm2835_gpio_pad(uint8_t group)
BCM2835_SPI_CS2
@ BCM2835_SPI_CS2
Definition: bcm2835.h:1025
RPI_BPLUS_GPIO_J8_33
@ RPI_BPLUS_GPIO_J8_33
Definition: bcm2835.h:898
bcm2835RegisterBase
bcm2835RegisterBase
bcm2835RegisterBase Register bases for bcm2835_regbase()
Definition: bcm2835.h:694
BCM2835_SPI_CLOCK_DIVIDER_8192
@ BCM2835_SPI_CLOCK_DIVIDER_8192
Definition: bcm2835.h:1047
bcm2835_gpio_pud
void bcm2835_gpio_pud(uint8_t pud)
RPI_GPIO_P1_26
@ RPI_GPIO_P1_26
Definition: bcm2835.h:841
bcm2835_aux_spi_end
void bcm2835_aux_spi_end(void)
bcm2835_aux_spi_setClockDivider
void bcm2835_aux_spi_setClockDivider(uint16_t divider)
BCM2835_GPIO_PUD_UP
@ BCM2835_GPIO_PUD_UP
Definition: bcm2835.h:777
RPI_GPIO_P1_07
@ RPI_GPIO_P1_07
Definition: bcm2835.h:827
bcm2835_pads
volatile uint32_t * bcm2835_pads
RPI_GPIO_P1_23
@ RPI_GPIO_P1_23
Definition: bcm2835.h:839
RPI_V2_GPIO_P1_13
@ RPI_V2_GPIO_P1_13
Definition: bcm2835.h:851
bcm2835_spi_chipSelect
void bcm2835_spi_chipSelect(uint8_t cs)
RPI_BPLUS_GPIO_J8_11
@ RPI_BPLUS_GPIO_J8_11
Definition: bcm2835.h:883
RPI_V2_GPIO_P1_26
@ RPI_V2_GPIO_P1_26
Definition: bcm2835.h:860
RPI_BPLUS_GPIO_J8_38
@ RPI_BPLUS_GPIO_J8_38
Definition: bcm2835.h:902
RPI_BPLUS_GPIO_J8_12
@ RPI_BPLUS_GPIO_J8_12
Definition: bcm2835.h:884
bcm2835_bsc1
volatile uint32_t * bcm2835_bsc1
BCM2835_REGBASE_PADS
@ BCM2835_REGBASE_PADS
Definition: bcm2835.h:699
bcm2835_gpio_set_eds_multi
void bcm2835_gpio_set_eds_multi(uint32_t mask)
bcm2835_peripherals_size
uint32_t bcm2835_peripherals_size
bcm2835_gpio_len
void bcm2835_gpio_len(uint8_t pin)
BCM2835_GPIO_FSEL_ALT0
@ BCM2835_GPIO_FSEL_ALT0
Definition: bcm2835.h:762
RPI_BPLUS_GPIO_J8_36
@ RPI_BPLUS_GPIO_J8_36
Definition: bcm2835.h:900
bcm2835_gpio_write_mask
void bcm2835_gpio_write_mask(uint32_t value, uint32_t mask)
RPI_GPIO_P1_21
@ RPI_GPIO_P1_21
Definition: bcm2835.h:837
RPI_V2_GPIO_P1_32
@ RPI_V2_GPIO_P1_32
Definition: bcm2835.h:863
RPI_V2_GPIO_P1_35
@ RPI_V2_GPIO_P1_35
Definition: bcm2835.h:865
BCM2835_I2C_CLOCK_DIVIDER_626
@ BCM2835_I2C_CLOCK_DIVIDER_626
Definition: bcm2835.h:1106
bcm2835_spi_setChipSelectPolarity
void bcm2835_spi_setChipSelectPolarity(uint8_t cs, uint8_t active)
bcm2835_i2c_setSlaveAddress
void bcm2835_i2c_setSlaveAddress(uint8_t addr)
BCM2835_GPIO_FSEL_ALT3
@ BCM2835_GPIO_FSEL_ALT3
Definition: bcm2835.h:765
bcm2835_i2c_set_baudrate
void bcm2835_i2c_set_baudrate(uint32_t baudrate)
RPI_V2_GPIO_P1_12
@ RPI_V2_GPIO_P1_12
Definition: bcm2835.h:850
RPI_BPLUS_GPIO_J8_05
@ RPI_BPLUS_GPIO_J8_05
Definition: bcm2835.h:879
bcm2835_gpio_set_pad
void bcm2835_gpio_set_pad(uint8_t group, uint32_t control)
bcm2835_peri_write
void bcm2835_peri_write(volatile uint32_t *paddr, uint32_t value)
bcm2835_gpio_aren
void bcm2835_gpio_aren(uint8_t pin)
RPI_BPLUS_GPIO_J8_16
@ RPI_BPLUS_GPIO_J8_16
Definition: bcm2835.h:887
RPI_BPLUS_GPIO_J8_07
@ RPI_BPLUS_GPIO_J8_07
Definition: bcm2835.h:880
BCM2835_SPI_CLOCK_DIVIDER_16
@ BCM2835_SPI_CLOCK_DIVIDER_16
Definition: bcm2835.h:1056
BCM2835_I2C_CLOCK_DIVIDER_2500
@ BCM2835_I2C_CLOCK_DIVIDER_2500
Definition: bcm2835.h:1105
BCM2835_REGBASE_AUX
@ BCM2835_REGBASE_AUX
Definition: bcm2835.h:703
bcm2835_spi_setBitOrder
void bcm2835_spi_setBitOrder(uint8_t order)
bcm2835_gpio_clr_len
void bcm2835_gpio_clr_len(uint8_t pin)
bcm2835_gpio_fsel
void bcm2835_gpio_fsel(uint8_t pin, uint8_t mode)
bcm2835_spi_setClockDivider
void bcm2835_spi_setClockDivider(uint16_t divider)
BCM2835_GPIO_PUD_OFF
@ BCM2835_GPIO_PUD_OFF
Definition: bcm2835.h:775
bcm2835_version
unsigned int bcm2835_version(void)
BCM2835_GPIO_PUD_DOWN
@ BCM2835_GPIO_PUD_DOWN
Definition: bcm2835.h:776
RPI_BPLUS_GPIO_J8_08
@ RPI_BPLUS_GPIO_J8_08
Definition: bcm2835.h:881
BCM2835_SPI_CLOCK_DIVIDER_256
@ BCM2835_SPI_CLOCK_DIVIDER_256
Definition: bcm2835.h:1052
bcm2835_set_debug
void bcm2835_set_debug(uint8_t debug)
BCM2835_GPIO_FSEL_ALT2
@ BCM2835_GPIO_FSEL_ALT2
Definition: bcm2835.h:764
RPI_V2_GPIO_P1_24
@ RPI_V2_GPIO_P1_24
Definition: bcm2835.h:859
BCM2835_I2C_REASON_ERROR_DATA
@ BCM2835_I2C_REASON_ERROR_DATA
Definition: bcm2835.h:1118
BCM2835_SPI_CLOCK_DIVIDER_8
@ BCM2835_SPI_CLOCK_DIVIDER_8
Definition: bcm2835.h:1057
RPI_BPLUS_GPIO_J8_18
@ RPI_BPLUS_GPIO_J8_18
Definition: bcm2835.h:888
RPI_BPLUS_GPIO_J8_37
@ RPI_BPLUS_GPIO_J8_37
Definition: bcm2835.h:901
bcm2835_gpio_write_multi
void bcm2835_gpio_write_multi(uint32_t mask, uint8_t on)
RPI_BPLUS_GPIO_J8_15
@ RPI_BPLUS_GPIO_J8_15
Definition: bcm2835.h:886
bcm2835_gpio_set_pud
void bcm2835_gpio_set_pud(uint8_t pin, uint8_t pud)
bcm2835PadGroup
bcm2835PadGroup
bcm2835PadGroup Pad group specification for bcm2835_gpio_pad()
Definition: bcm2835.h:804
bcm2835_bsc0
volatile uint32_t * bcm2835_bsc0
BCM2835_REGBASE_ST
@ BCM2835_REGBASE_ST
Definition: bcm2835.h:695
RPI_BPLUS_GPIO_J8_24
@ RPI_BPLUS_GPIO_J8_24
Definition: bcm2835.h:893
RPI_V2_GPIO_P1_40
@ RPI_V2_GPIO_P1_40
Definition: bcm2835.h:869
RPI_V2_GPIO_P1_21
@ RPI_V2_GPIO_P1_21
Definition: bcm2835.h:856
bcm2835_gpio_clr_afen
void bcm2835_gpio_clr_afen(uint8_t pin)
BCM2835_SPI_CLOCK_DIVIDER_2048
@ BCM2835_SPI_CLOCK_DIVIDER_2048
Definition: bcm2835.h:1049
bcm2835_gpio_hen
void bcm2835_gpio_hen(uint8_t pin)
BCM2835_REGBASE_BSC1
@ BCM2835_REGBASE_BSC1
Definition: bcm2835.h:702
RPI_V2_GPIO_P1_29
@ RPI_V2_GPIO_P1_29
Definition: bcm2835.h:861