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

Feature request : SPI frequency change #55

Closed
ghost opened this issue Jan 20, 2020 · 4 comments
Closed

Feature request : SPI frequency change #55

ghost opened this issue Jan 20, 2020 · 4 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Jan 20, 2020

Hello,

Some devices need to initialized at low frequency and then be set to higher one for exploitation. This is not possible with Meadow.

Could it be possible to have either a setter or a method for the SPI frequency setting ?

Best regards,

@ctacke ctacke self-assigned this Feb 1, 2020
@bryancostanich bryancostanich added this to the Beta3.7 milestone Feb 5, 2020
@ctacke
Copy link
Contributor

ctacke commented Feb 7, 2020

Beta 3.7 allows you to change configuration after construction, so changing frequency or polarity is allowed.

@ghost
Copy link
Author

ghost commented Feb 19, 2020

This one should not be closed as it is not fixed in Beta 3.7.

Members of the SpiConfiguration class are still read-only.

@ctacke
Copy link
Contributor

ctacke commented Feb 22, 2020

Tested this code against upcoming beta 3.8, and the scope is definitely reflecting clock frequency changes.

while (true)
{
    // this is purely a test for supporting changing bus speed in SPI - remove when the radio is implemented
    foreach (var spd in bus.SupportedSpeeds)
    {
        Console.WriteLine($"{spd}");

        try
        {
            bus.Configuration.SpeedKHz = spd;

            Console.WriteLine($" @{bus.Configuration.SpeedKHz} Silicon Revision: 0x{radio.GetVersion():x2}");
        }
        catch(Exception ex)
        {
            Console.WriteLine($" {ex.Message}");
        }

        Thread.Sleep(2000);
    }
}

@bryancostanich
Copy link
Contributor

b3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants