Skip to content

Add LPCOMP module#195

Merged
jonas-schievink merged 10 commits intonrf-rs:masterfrom
kalkyl:lpcomp
Aug 25, 2020
Merged

Add LPCOMP module#195
jonas-schievink merged 10 commits intonrf-rs:masterfrom
kalkyl:lpcomp

Conversation

@kalkyl
Copy link
Copy Markdown
Contributor

@kalkyl kalkyl commented Aug 2, 2020

Added a HAL module for the LPCOMP low power comparator peripheral.

In System ON, the LPCOMP can generate separate events on rising and falling edges of a signal, or sample the current state of the pin as being above or below the selected reference. The block can be configured to use any of the analog inputs on the device.

Additionally, the low power comparator can be used as an analog wakeup source from System OFF or System ON. The comparator threshold can be programmed to a range of fractions of the supply voltage or to use an external analog reference input pin.

Tested on nRF52840-DK

Demo showing "analog power up" usage and interrupt triggering/reading comparator state:
https://github.com/kalkyl/nrf-hal/blob/lpcomp/examples/lpcomp-demo/src/main.rs

Comment thread nrf-hal-common/src/lpcomp.rs Outdated
Comment thread nrf-hal-common/src/lpcomp.rs Outdated
kalkyl and others added 3 commits August 12, 2020 22:41
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Comment thread nrf-hal-common/src/lpcomp.rs
@jonas-schievink jonas-schievink merged commit bb94d90 into nrf-rs:master Aug 25, 2020
@kalkyl kalkyl deleted the lpcomp branch September 4, 2020 13:38
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.

2 participants