On Thu, 20 May 2021 19:19:08 -0700, in gmane.comp.hardware.beagleboard.user
"John Dammeyer" <[email protected]> wrote:


>The sad thing is that Derek Molloy's book, only in passing refers to enabling 
>the SPI port, and the book, in trying to also deal with the pocket beagle pins 
>leaves out things where repetition is actually beneficial.  Maybe somewhere it 
>says that you have to use config-pin to set up SPI.  I missed it.  I think in 
>Chapter 8 page 363 needs a bit of work.

        One: you have to look at the default pin-mux tables -- the default for
many is as GPIO.

        Two: config-pin is discussed in chapter 6 (which also has a
hard-to-read version of the tables). It doesn't mention SPI explicitly, but
does mention that the tool is used in later chapters.

debian@beaglebone:~$
/opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -i
p9_18
Pin name: P9_18
Function if no cape loaded: gpio
Function if cape loaded: default gpio gpio_pu gpio_pd gpio_input spi i2c
pwm pru_uart
Function information: gpio0_4 default gpio0_4 gpio0_4 gpio0_4 gpio0_4
spi0_d1 i2c1_sda ehrpwm0_tripzone_input pru_uart
Kernel GPIO id: 4
PRU GPIO id: 36
debian@beaglebone:~$



>Oh and none of this explains why the ioctl regardless of C or Pascal can't 
>handle more than 4096 data bytes while the Python code can when sending a 
>large bitmap to the SPI port.  Nor why, according to this web site

debian@beaglebone:~$ cat /sys/module/spidev/parameters/bufsiz
4096
debian@beaglebone:~$

https://pypi.org/project/spidev/
"""
writebytes2(list of values)

Similar to writebytes but accepts arbitrary large lists. If list size
exceeds buffer size (which is read from
/sys/module/spidev/parameters/bufsiz), data will be split into smaller
chunks and sent in multiple operations.
"""

>https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/spi
>nothing is said about config-pin operations so the python library must do this 
>automatically?

        A lot of that is a bit out-of-date -- references to kernel 3.8! Though
I do have to admit I can't find where in Adafruit_BBIO it might do that
set-up -- it doesn't seem to be done in the above spidev Python interface,
which is used by (now deprecated in favor of blinka/circuitpython)
Adafruit_BBIO... And I can't find a config change in blinka or
Adafruit_PureIO. {PureIO may not invoke the above spidev module, so how
/it/ handles large blocks is unknown}




-- 
Dennis L Bieber

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/peifag10s2ohjmb53f5naa8hcgmtmhc9go%404ax.com.

Reply via email to