Skip to content
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

Papirus hat MCP7940N examples #55

Merged
merged 1 commit into from
Mar 9, 2017
Merged

Papirus hat MCP7940N examples #55

merged 1 commit into from
Mar 9, 2017

Conversation

tvoverbeek
Copy link
Contributor

Examples and a lot of details about how to use the wake-on-alarm function and the interrupt function on GPIO 27. @shawaj. See video https://youtu.be/H8aviSTrx4Q. Also removed check for root on other demos (not needed any more on recent Raspbian)

@francesco-vannini
Copy link
Contributor

The amount of changes on this PR is considerable, could we maybe review and break down a bit. It looks like a great piece of work, just need to make it simpler for me to integrate. Is it something you would consider? Sorry this has been pending for such a long time

@tvoverbeek
Copy link
Contributor Author

Resynced with PiSupply/master. Will try to split it up in smaller pieces and squashing commits so it is easier to merge.

@shawaj
Copy link
Member

shawaj commented Jan 22, 2017 via email

@shawaj
Copy link
Member

shawaj commented Jan 22, 2017 via email

@tvoverbeek
Copy link
Contributor Author

Regarding the root check, you can check for the existence of /dev/gpiomem. If it does not exist use the existing 'you have to be root' code else continue without root.
Shall I provide a separate pull request for the root check in the examples only?

@shawaj
Copy link
Member

shawaj commented Jan 24, 2017 via email

@tvoverbeek
Copy link
Contributor Author

I2C and SPI do not require root privileges. When you enable I2C and/or SPI access in raspi-config you get added to the relevant groups (i2c and spi) so you can access /dev/i2c-1 and /dev/spidev0.*
This has been the case for a long time. The rootless access to the gpio is more recent

@shawaj
Copy link
Member

shawaj commented Jan 24, 2017 via email

Examples and explanation how to use the MCP7940N hardware clock on the
Papirus HAT
@francesco-vannini
Copy link
Contributor

As agreed all good with last commit which brings in only the RTC examples, documentation and support files.

@francesco-vannini francesco-vannini merged commit e42d958 into PiSupply:master Mar 9, 2017
@tvoverbeek tvoverbeek deleted the PaPiRus-HAT-RTC-examples branch March 9, 2017 18:51
@shawaj
Copy link
Member

shawaj commented Mar 9, 2017 via email

@shawaj
Copy link
Member

shawaj commented Mar 9, 2017

@tvoverbeek - is the python smbus module not already included in Raspbian by default? Just needs to be imported? Do we definitely need to have the source code here?

@tvoverbeek
Copy link
Contributor Author

The smbus module is already in Raspbian, but does not allow you to access an i2c device if it is already claimed by the kernel.
Hence a slightly modified version of smbus; smbusf (smbus forced access).
See the section "Accessing the MCP7940N from Python with the kernel driver (rtc_ds1307) loaded" in the RTC-Examples README.

@francesco-vannini
Copy link
Contributor

francesco-vannini commented Mar 9, 2017 via email

@shawaj
Copy link
Member

shawaj commented Mar 9, 2017 via email

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.

3 participants