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)
- Add board: BOARD=orangepi3-lts HOT 1
- ADD BANANAPI CM4 BOARD
- ADD BANANAPI CM4 BOARD SUPPORT
- DietPi - Error installing Adafruit-Blinka HOT 1
- any check scripts that should be performed before issuing a PR for adding a new board
- Adafruit-PlatformDetect version 3.66.0 was unable to identify the board HOT 3
- Cant find the board HOT 6
- Some microcontroller definitions may be incorrect.
- libgpiod_pin_1_x.py does not detect internal pulldowns HOT 1
- GT911 touch sensor support for Adafruit Blinka HOT 7
- adafruit-circuitpython-motor fails with "RuntimeError: Cannot determine SOC peripheral base address" on Raspberry Pi 5 HOT 12
- Adafruit-Adafruit-PlatformDetect version 3.69.0 was unable to identify the board HOT 13
- Adafruit-PlatformDetect version 3.69.0 was unable to identify the board HOT 2
- support for NXP i.MX 8M PLUS HOT 3
- pip try to install sysv-ipc on Windows HOT 26
- It is no longer possible to install from 8.44.0. HOT 4
- Getting error in WCMCU-200 I2c to USB Adapter
- Add New Board adafruit FT232H Breakout for adafruit-blinka HOT 3
- Add Orange Pi AIPro
- Remove dependency to numpy HOT 2
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.