Skip to content

GPIO, SPI and 64-bit support, platform channel refactor #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 26, 2020

Conversation

ardera
Copy link
Owner

@ardera ardera commented Feb 26, 2020

GPIO

  • plugin is called flutter_gpiod. I haven't yet published it to the dart/flutter package repo pub.dev yet. Need to fix up some documentation and do testing on some edge cases.
  • plugin source code is already uploaded here, so if you really need GPIO, you can clone it and start using it right away.
  • GPIO is implemented as an interface to libgpiod. This means you can use flutter_gpiod on any linux device, not just Raspberry Pi. (provided it has linux kernel drivers for the GPIO chips)
  • Downside to this is that pin numbering is a little bit harder now. The new linux GPIO chardev interface changed the old 1-level hierarchy (globally unique pin numbers) to a 2-level hierarchy (gpio chip -> gpio line offset in this chip)
  • Also, the features you can use depend on your linux kernel and libgpiod version. Pullup/Pulldown resistor support was only recently added, it hasn't yet arrived on Raspbian yet.
  • The dart interface is experimental right now. Breaking changes will probably happen until v1.0.
  • partially implements GPIO access #9

SPI

  • very basic SPI plugin, using the linux spidev interface.
  • supported: setting/getting SPI mode, speed, bits per word. full-duplex transfer.
  • haven't yet uploaded the source code.
  • experimental
  • the SPI driver for the Raspberry Pi seems to be kinda buggy. More precisely, chip-select wasn't activated by the driver when doing a transfer. A temporary workaround is to request the chip-select pin as output and put a high-voltage on it. (Don't pull the voltage low when doing a transfer, only request it)

Platform channel refactor

  • all methods of the platform channel interface now start with platch_.
  • added some QoL methods for responding to method calls and sending events on an event channel. Also made sending and responding to platform messages thread-safe.
  • renames: struct ChannelObject --> struct platch_obj
  • struct StdMsgCodecValue --> struct std_value
  • struct JsonMsgCodecValue --> struct json_value
  • and much more. The naming is now somewhat consistent.

64 bit support

@ardera ardera merged commit a274d27 into master Feb 26, 2020
@ardera ardera deleted the feature-gpio-spi-plugin branch August 4, 2020 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant