Comments (8)
SPI is definitely not fully done, you shouldnt adapt drivers to match Blinka as its missing a bunch of stuff and vargs. its just 'barely working' right now, i only tested it with one sensor so far :)
from adafruit_blinka.
Fair enough! I was not sure if spidev could handle the "end=".
It is fun to have it working as much as it is! Thanks for adding the note to the guide about not using ce0/ce1 on the RPi -- that caused some very odd results!
from adafruit_blinka.
ok cool! re-opening as a reminder to myself to fix the end= thing
from adafruit_blinka.
I have the same issue and if I would love to have details on how you dealt with this @jerryneedell. Indeed, I tried to remove the "end" argument from the function call and changed the range of buffer.
So instead of having buf=[a,b,c]
and end=2
, I now have buf=[a,b]
.
Thank you for your help!
from adafruit_blinka.
@Timonzimm As noted by @ladyada this is likely to be fixed properly in a future update to the Blinka module so the preferred solution is to wait for that!
What ti did was to create additional BUFFER's to hold 1 or 2 byte arguments and use them instead of the end= keyword. For your reference, here is the "dif" but be forewarned, I have done very little testing of this and it may not work reliably.
$ diff adafruit_rfm9x.py ../Adafruit_CircuitPython_RFM9x/adafruit_rfm9x.py > adafruit_rfm9x.diff
$ cat adafruit_rfm9x.diff
270,271d269
< _BUFFER1 = bytearray(1)
< _BUFFER2 = bytearray(2)
394c392
< self._BUFFER1[0] = address & 0x7F # Strip out top bit to set 0
---
> self._BUFFER[0] = address & 0x7F # Strip out top bit to set 0
396,397c394,395
< device.write(self._BUFFER1)
< device.readinto(buf)
---
> device.write(self._BUFFER, end=1)
> device.readinto(buf, end=length)
401,402c399,400
< self._read_into(address, self._BUFFER1)
< return self._BUFFER1[0]
---
> self._read_into(address, self._BUFFER, length=1)
> return self._BUFFER[0]
404c402
< def _write_from(self, address, msg, length=None):
---
> def _write_from(self, address, buf, length=None):
407a406,407
> if length is None:
> length = len(buf)
409,412c409,412
< self._BUFFER1[0] = (address | 0x80) & 0xFF # Set top bit to 1 to
< # indicate a write.
< device.write(self._BUFFER1)
< device.write(msg)
---
> self._BUFFER[0] = (address | 0x80) & 0xFF # Set top bit to 1 to
> # indicate a write.
> device.write(self._BUFFER, end=1)
> device.write(buf, end=length)
418c418
< self._BUFFER2[0] = (address | 0x80) & 0xFF # Set top bit to 1 to
---
> self._BUFFER[0] = (address | 0x80) & 0xFF # Set top bit to 1 to
420,421c420,421
< self._BUFFER2[1] = val & 0xFF
< device.write(self._BUFFER2)
---
> self._BUFFER[1] = val & 0xFF
> device.write(self._BUFFER, end=2)
558c558
< # Write payload
---
> # Write payload.
from adafruit_blinka.
yep ive just been super busy!
from adafruit_blinka.
can't imagine why ;-)
from adafruit_blinka.
#22 fixes this
from adafruit_blinka.
Related Issues (20)
- Requesting support for Geniatech xpi-3566-zero
- Is the Rock 4SE not supported? HOT 4
- UnexpectedMakers ProS3 HOT 3
- Issue with Adafruit-PlatformDetect on Windows
- SSD1306 is not working on a Raspberry Pi 5 HOT 7
- CE1 busy on Pi 5 HOT 1
- Banana Pi M2 Berry
- Adafruit-PlatformDetect version 3.60.0 was unable to identify the board HOT 13
- Please support RP2040-LCD-1.28 HOT 1
- adafruit HOT 2
- KB 2040 board HOT 2
- Open drain output on a Raspberry Pi requires value setting of an input pin HOT 2
- GPIO Access Support for linux (kernel > 4.7) HOT 7
- These are very inexpensive and I think would be good boards to support -- LuckyFox Pico Mini HOT 1
- Jetson Nano resulting in AttributeError: module 'adafruit_platformdetect.constants.chips' has no attribute 'JH71x0' HOT 30
- Use HW PWM for pins that support it
- Please support for orange pi win plus!!! HOT 1
- Support for Orange Pi Zero 2W HOT 1
- problem in running code in raspberry pi pico HOT 1
- Bug in pwmio.py introduced with commit e13c0662ce0da9e936c652953aa1d3f9d6b872d5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit_blinka.