Commit Graph

6 Commits (45c4891182e39b5cbf62edc76c385d8f69e23c37)

Author SHA1 Message Date
Florian Klink 05bab7ef1f
nrzled.NewSPI: also add padding in the front (#48)
Some SPI devices take a while to set up for transfer, and while doing
so, show the first bit they're about to send.

This causes the first LED to always interpret the first symbol as a
logical 1. Zapping out the whole strip will leave the first LED green,
and the first pixel will always be slightly green-ish.

Prevent this, by applying the same 3 bit padding we have at the end to
the front.

Signed-off-by: Florian Klink <flokli@flokli.de>
4 years ago
Florian Klink fe248193e0
nrzled: Don't set NoCS (#4)
Whether or not CS (chip select) is used really depends on the way how
you wire things together, not on the device you're talking to.

Not using CS (and explicitly telling the SPI controller about that)
might keep some pins free on pin-constrained boards, but also, some
controllers (or Linux drivers) don't support disabling CS, and fail when
that flag is given.

On the other hand, even though nrzleds don't make use of CS by
themselves, you could very well have some circuit in front to do the
chip select, and then actually write to different nrzled devices
sequentially.

Long-term, the fact on whether to do chip select should be specified
while passing in the SPI port to be used, as it really depends on the
way it's wired together on the specific board, not on the type of
device.
5 years ago
Marc-Antoine Ruel 402bbcc930 Migrate to devices/v3
Ran:
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/conn#periph.io/x/conn/v3#g'
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/host#periph.io/x/host/v3#g'
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/devices#periph.io/x/devices/v3#g'
  go test ./...
  go mod tidy
5 years ago
Florian Klink 51e659fc71 nrzled/rasterSPI: fix ordering
This is supposed to be sent out in GRB order (and the comment below also
below claims it), but the code (and corresponding unit tests) did output
RGB order.
5 years ago
Marc-Antoine Ruel 655d1cef69 Update import path to what devices will be
Also update imports to conn and host.

Ran (roughly):
  # Update the references.
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/conn#x/conn#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/experimental/conn#x/conn#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/host#x/host#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/experimental/host#x/host#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/devices#x/devices#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/experimental/devices#x/devices#g'

  # Initialize the go module:
  go mod init periph.io/x/devices

  # Edited it to require go 1.13:
  vi go.mod

  # Reorder imports.
  goimports -w .
5 years ago
Marc-Antoine Ruel 1de83694a1 Migrate layout to the destination layout
First I imported the commits from v3.6.6 with:

  PKG=devices
  git init $PKG
  cd $PKG
  git remote add origin https://github.com/google/periph
  git fetch origin
  git filter-repo \
    --path AUTHORS \
    --path CONTRIBUTING.md \
    --path CONTRIBUTORS \
    --path LICENSE \
    --path README.md \
    --path $PKG --path experimental/$PKG $@
  git remote add origin git@github.com:periph/$PKG
  git fetch origin
  # Use the occasion to rename from master to main since we are starting from
  # scratch.
  git branch -m main
  git push origin main

Then I fixed the layout to get rid of experimental with:

  git rm experimental/devices/README.md
  git mv experimental/devices/* .
  git mv devices/* .

The import paths will be fixed in a follow up.
5 years ago