Compare commits
5 Commits
bcm2835-1.
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
87dc810e14
|
|||
|
22fe7980d5
|
|||
|
07ea18bf14
|
|||
|
20153a0a4c
|
|||
|
7a33a8f6ca
|
29
aclocal.m4
vendored
29
aclocal.m4
vendored
@@ -769,35 +769,6 @@ else
|
||||
fi
|
||||
])
|
||||
|
||||
# -*- Autoconf -*-
|
||||
# Obsolete and "removed" macros, that must however still report explicit
|
||||
# error messages when used, to smooth transition.
|
||||
#
|
||||
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([AM_CONFIG_HEADER],
|
||||
[AC_DIAGNOSE([obsolete],
|
||||
['$0': this macro is obsolete.
|
||||
You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
|
||||
AC_CONFIG_HEADERS($@)])
|
||||
|
||||
AC_DEFUN([AM_PROG_CC_STDC],
|
||||
[AC_PROG_CC
|
||||
am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
|
||||
AC_DIAGNOSE([obsolete],
|
||||
['$0': this macro is obsolete.
|
||||
You should simply use the 'AC][_PROG_CC' macro instead.
|
||||
Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
|
||||
but upon 'ac_cv_prog_cc_stdc'.])])
|
||||
|
||||
AC_DEFUN([AM_C_PROTOTYPES],
|
||||
[AC_FATAL([automatic de-ANSI-fication support has been removed])])
|
||||
AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
|
||||
|
||||
25
configure
vendored
25
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.71 for bcm2835 1.73.
|
||||
# Generated by GNU Autoconf 2.71 for bcm2835 1.75.
|
||||
#
|
||||
# Report bugs to <mikem@airspayce.com>.
|
||||
#
|
||||
@@ -610,8 +610,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='bcm2835'
|
||||
PACKAGE_TARNAME='bcm2835'
|
||||
PACKAGE_VERSION='1.73'
|
||||
PACKAGE_STRING='bcm2835 1.73'
|
||||
PACKAGE_VERSION='1.75'
|
||||
PACKAGE_STRING='bcm2835 1.75'
|
||||
PACKAGE_BUGREPORT='mikem@airspayce.com'
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1274,7 +1274,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures bcm2835 1.73 to adapt to many kinds of systems.
|
||||
\`configure' configures bcm2835 1.75 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1341,7 +1341,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of bcm2835 1.73:";;
|
||||
short | recursive ) echo "Configuration of bcm2835 1.75:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1437,7 +1437,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
bcm2835 configure 1.73
|
||||
bcm2835 configure 1.75
|
||||
generated by GNU Autoconf 2.71
|
||||
|
||||
Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
@@ -1560,7 +1560,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by bcm2835 $as_me 1.73, which was
|
||||
It was created by bcm2835 $as_me 1.75, which was
|
||||
generated by GNU Autoconf 2.71. Invocation command line was
|
||||
|
||||
$ $0$ac_configure_args_raw
|
||||
@@ -2307,7 +2307,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
|
||||
ac_config_headers="$ac_config_headers config.h"
|
||||
ac_config_headers="$ac_config_headers config.h:config.h.in"
|
||||
|
||||
am__api_version='1.16'
|
||||
|
||||
@@ -2823,7 +2823,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='bcm2835'
|
||||
VERSION='1.73'
|
||||
VERSION='1.75'
|
||||
|
||||
|
||||
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
|
||||
@@ -5425,6 +5425,7 @@ DEFS=-DHAVE_CONFIG_H
|
||||
|
||||
ac_libobjs=
|
||||
ac_ltlibobjs=
|
||||
U=
|
||||
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
|
||||
# 1. Remove the extension, and $U if already installed.
|
||||
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
|
||||
@@ -5865,7 +5866,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by bcm2835 $as_me 1.73, which was
|
||||
This file was extended by bcm2835 $as_me 1.75, which was
|
||||
generated by GNU Autoconf 2.71. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -5933,7 +5934,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config='$ac_cs_config_escaped'
|
||||
ac_cs_version="\\
|
||||
bcm2835 config.status 1.73
|
||||
bcm2835 config.status 1.75
|
||||
configured by $0, generated by GNU Autoconf 2.71,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
@@ -6062,7 +6063,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
for ac_config_target in $ac_config_targets
|
||||
do
|
||||
case $ac_config_target in
|
||||
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
|
||||
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.h.in" ;;
|
||||
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
|
||||
"doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;;
|
||||
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
||||
|
||||
@@ -6,9 +6,9 @@ dnl (C) 2012 Mike McCauley (mikem@airspayce.com)
|
||||
|
||||
dnl Dont forget to update BCM2835_VERSION and .tar.gz in bcm2835.h
|
||||
dnl and the zip file.
|
||||
AC_INIT([bcm2835], [1.73], [mikem@airspayce.com])
|
||||
AC_INIT([bcm2835], [1.75], [mikem@airspayce.com])
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_HEADERS(config.h:config.h.in)
|
||||
AM_INIT_AUTOMAKE()
|
||||
AC_CHECK_LIB([rt], [clock_gettime])
|
||||
AC_MSG_CHECKING([for docs])
|
||||
@@ -29,4 +29,5 @@ AC_PROG_CC
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
|
||||
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
|
||||
AC_OUTPUT(Makefile src/Makefile doc/Makefile)
|
||||
AC_CONFIG_FILES(Makefile src/Makefile doc/Makefile)
|
||||
AC_OUTPUT
|
||||
|
||||
BIN
pdf/BCM2835-ARM-Peripherals.pdf
Normal file
BIN
pdf/BCM2835-ARM-Peripherals.pdf
Normal file
Binary file not shown.
BIN
perl/Device-BCM2835-1.9.tar.gz
Normal file
BIN
perl/Device-BCM2835-1.9.tar.gz
Normal file
Binary file not shown.
BIN
perl/Device-BCM2835-1.94.tar.gz
Normal file
BIN
perl/Device-BCM2835-1.94.tar.gz
Normal file
Binary file not shown.
@@ -1109,7 +1109,8 @@ void bcm2835_aux_spi_transfernb(const char *tbuf, char *rbuf, uint32_t len) {
|
||||
|
||||
while ((tx_len > 0) || (rx_len > 0)) {
|
||||
|
||||
while (!(bcm2835_peri_read(stat) & BCM2835_AUX_SPI_STAT_TX_FULL) && (tx_len > 0)) {
|
||||
while (!(bcm2835_peri_read(stat) & BCM2835_AUX_SPI_STAT_TX_FULL) && (tx_len > 0) && (tx_len + BCM2835_AUX_SPI_FIFO_SIZE * 3 > rx_len))
|
||||
{
|
||||
count = MIN(tx_len, 3);
|
||||
data = 0;
|
||||
|
||||
@@ -1129,7 +1130,8 @@ void bcm2835_aux_spi_transfernb(const char *tbuf, char *rbuf, uint32_t len) {
|
||||
|
||||
}
|
||||
|
||||
while (!(bcm2835_peri_read(stat) & BCM2835_AUX_SPI_STAT_RX_EMPTY) && (rx_len > 0)) {
|
||||
while (!(bcm2835_peri_read(stat) & BCM2835_AUX_SPI_STAT_RX_EMPTY) && (rx_len > 0))
|
||||
{
|
||||
count = MIN(rx_len, 3);
|
||||
data = bcm2835_peri_read(io);
|
||||
|
||||
@@ -1151,7 +1153,8 @@ void bcm2835_aux_spi_transfernb(const char *tbuf, char *rbuf, uint32_t len) {
|
||||
rx_len -= count;
|
||||
}
|
||||
|
||||
while (!(bcm2835_peri_read(stat) & BCM2835_AUX_SPI_STAT_BUSY) && (rx_len > 0)) {
|
||||
while (!(bcm2835_peri_read(stat) & BCM2835_AUX_SPI_STAT_BUSY) && (rx_len > 0) && (tx_len == 0))
|
||||
{
|
||||
count = MIN(rx_len, 3);
|
||||
data = bcm2835_peri_read(io);
|
||||
|
||||
@@ -1315,7 +1318,7 @@ uint8_t bcm2835_i2c_write(const char * buf, uint32_t len)
|
||||
uint32_t remaining = len;
|
||||
uint32_t i = 0;
|
||||
uint8_t reason = BCM2835_I2C_REASON_OK;
|
||||
unsigned long Failsafe = len * 1000;
|
||||
unsigned long Failsafe = len * 10000;
|
||||
int Timeout = 0;
|
||||
|
||||
/* Clear FIFO */
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
BCM 2835).
|
||||
|
||||
The version of the package that this documentation refers to can be downloaded
|
||||
from http://www.airspayce.com/mikem/bcm2835/bcm2835-1.73.tar.gz
|
||||
from http://www.airspayce.com/mikem/bcm2835/bcm2835-1.75.tar.gz
|
||||
You can find the latest version at http://www.airspayce.com/mikem/bcm2835
|
||||
|
||||
Several example programs are provided.
|
||||
@@ -218,6 +218,15 @@
|
||||
- P1-40 (CLK)
|
||||
- P1-36 (CE2)
|
||||
|
||||
Caution: The bcm2835 library works directly on the SPI/I2C devices. It is not using
|
||||
any Linux device drivers. When relevant Linux drivers are loaded or
|
||||
activated then it can create unexpected behavior from other software like
|
||||
'i2cdetect'.
|
||||
|
||||
Here is a simple utility which detects I2C bus devices with the bcm2835
|
||||
library.
|
||||
https://github.com/gavinlyonsrepo/RPI_Tools/tree/main/src/i2cdetect
|
||||
|
||||
\par I2C Pins
|
||||
|
||||
The bcm2835_i2c_* functions allow you to control the BCM 2835 BSC interface,
|
||||
@@ -628,6 +637,14 @@
|
||||
Added Timeout checks to bcm2835_i2c_write() in case of IO problems. New reason cade BCM2835_I2C_REASON_ERROR_TIMEOUT
|
||||
added. Patch courtesy Simon Peacock.
|
||||
|
||||
\version 1.74
|
||||
Timeout in bcm2835_i2c_write() increased by a factor of 10 because some users have reported spurious timeouts at slow speeds.
|
||||
|
||||
\version 1.75
|
||||
Patches to bcm2835_aux_spi_transfernb() from Sean Goff to deal with the case where
|
||||
the process is interrupted between filling the TX FIFO and reading the RX FIFO.
|
||||
|
||||
|
||||
\author Mike McCauley DO NOT CONTACT THE AUTHOR DIRECTLY: USE THE LISTS
|
||||
*/
|
||||
|
||||
@@ -643,7 +660,7 @@
|
||||
/* Needed to compile with gcc -std=c99, as reported by John Blaiklock.*/
|
||||
#include <fcntl.h>
|
||||
|
||||
#define BCM2835_VERSION 10073 /* Version 1.73 */
|
||||
#define BCM2835_VERSION 10075 /* Version 1.75 */
|
||||
|
||||
// Define this if you want to use libcap2 to determine if you have the cap_sys_rawio capability
|
||||
// and therefore the capability of opening /dev/mem, even if you are not root.
|
||||
@@ -1214,6 +1231,7 @@ typedef enum
|
||||
#define BCM2835_BSC_S_TA 0x00000001 /*!< Transfer Active */
|
||||
|
||||
#define BCM2835_BSC_FIFO_SIZE 16 /*!< BSC FIFO size */
|
||||
#define BCM2835_AUX_SPI_FIFO_SIZE 4
|
||||
|
||||
/*! \brief bcm2835I2CClockDivider
|
||||
Specifies the divider used to generate the I2C clock from the system clock.
|
||||
|
||||
Reference in New Issue
Block a user