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

Alarm not working #3

Open
vChavezB opened this issue Mar 25, 2023 · 2 comments
Open

Alarm not working #3

vChavezB opened this issue Mar 25, 2023 · 2 comments

Comments

@vChavezB
Copy link

vChavezB commented Mar 25, 2023

I am implementing a driver for zephyr with your code. Getting and setting the time work.

However, I am not able to make the interrupt pin go Low after using RV3028_EnableAlarm

Example Code:

rv3028_alarm_t alarm={
        .EnableInterrupts  = true,
        .EnableMinutesAlarm = true,
        .EnableHoursAlarm = false,
        .EnableDayAlarm = false,
        .PM = false,
        .UseDateAlarm = false,
        .Minutes = 1,
        .Hours = 0,
        .Day = 0
    };
    rc = RV3028_EnableAlarm(my_instance,&alarm);`

I set the unix time to 0, and expect that after 60 seconds the interrupt is triggered. If I find a solution I will update this issue. So far I am not sure that this is really setting the AE bit

https://github.com/Kampi/RV-3028-C7/blob/ca11937075232cdb53133656c5c592bd7a96cce0/external/RV3028/RV3028.c#L1095

It should be as follows (right?)

ErrorCode = RV3028_ModifyRegister(RV3028_REG_CONTROL2, 0x01 << RV3028_BIT_AIE, 0x01 << RV3028_BIT_AIE, p_Device);
@vChavezB
Copy link
Author

Ok I can confirm that there is a bug and the line I mentioned in the first post is the culprit of the problem.

@Kampi
Copy link
Owner

Kampi commented Mar 26, 2023

Thank you. I will change it.

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

No branches or pull requests

2 participants