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

capsules: add virtual_pwm #1103

Merged
merged 1 commit into from Dec 12, 2018

Conversation

Projects
None yet
4 participants
@bradjc
Copy link
Contributor

bradjc commented Jul 9, 2018

This provides shared access to PWM hardware, and provides the pin locked in interface for users of a single PWM channel.

Blocked on #1003

Testing Strategy

Tested with ACD52832 board.

TODO or Help Wanted

n/a

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make formatall.

@bradjc bradjc added the blocked label Jul 9, 2018

@bradjc bradjc referenced this pull request Jul 9, 2018

Closed

capsules: add buzzer driver #1104

2 of 2 tasks complete

@bradjc bradjc force-pushed the virtual-pwm branch from e36508a to baca07e Jul 11, 2018

bradjc added a commit that referenced this pull request Jul 11, 2018

@bradjc bradjc force-pushed the virtual-pwm branch from baca07e to 0790cf1 Jul 11, 2018

bradjc added a commit that referenced this pull request Jul 11, 2018

@bradjc bradjc force-pushed the virtual-pwm branch from 0790cf1 to 5b4d838 Jul 12, 2018

bradjc added a commit that referenced this pull request Jul 12, 2018

@bradjc bradjc force-pushed the virtual-pwm branch from 5b4d838 to ae32008 Dec 6, 2018

@bradjc bradjc removed the blocked label Dec 6, 2018

capsules: add virtual_pwm
This provides shared access to PWM hardware, and provides the pin locked
in interface for users of a single PWM channel.

@bradjc bradjc force-pushed the virtual-pwm branch from ae32008 to f0b3dc8 Dec 10, 2018

@bradjc

This comment has been minimized.

Copy link
Contributor

bradjc commented Dec 10, 2018

This is now passing travis. Thoughts?

@ppannuto
Copy link
Member

ppannuto left a comment

This looks good to me.

It'd be nice to resurrect something like #614 someday, as the simpler virtualization capsules are looking pretty similar. Maybe now that there's a few more around to play with it'll be clearer whether the generic virtualizer suits all needs.

@phil-levis

This comment has been minimized.

Copy link
Collaborator

phil-levis commented Dec 11, 2018

I think this is fine to have, but it's unclear to me what the use cases are. I.e., if it works can it could be useful, then sure, let's include it. Whether it's included in a particular kernel is up to that kernel. But for my own edification, what's an example of using this?

@bradjc

This comment has been minimized.

Copy link
Contributor

bradjc commented Dec 11, 2018

#1104

impl<A: hil::time::Alarm> Buzzer<'a, A> {
pub fn new(
pwm_pin: &'a hil::pwm::PwmPin,
alarm: &'a A,
max_duration_ms: usize,
grant: Grant<App>,
) -> Buzzer<'a, A> {
Buzzer {
pwm_pin: pwm_pin,
alarm: alarm,
apps: grant,
active_app: OptionalCell::empty(),
max_duration_ms: max_duration_ms,
}
}

If a capsule only needs a single PWM pin this provides a mechanism to grant access to just that one pin.

@alevy

This comment has been minimized.

Copy link
Member

alevy commented Dec 12, 2018

bors r+

bors bot added a commit that referenced this pull request Dec 12, 2018

Merge #1103
1103: capsules: add virtual_pwm r=alevy a=bradjc

This provides shared access to PWM hardware, and provides the pin locked in interface for users of a single PWM channel.



~Blocked on #1003~




### Testing Strategy

Tested with ACD52832 board.


### TODO or Help Wanted

n/a


### Documentation Updated

- [x] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [x] Ran `make formatall`.


Co-authored-by: Brad Campbell <bradjc5@gmail.com>
@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Dec 12, 2018

@bors bors bot merged commit f0b3dc8 into master Dec 12, 2018

4 checks passed

bors Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@bors bors bot deleted the virtual-pwm branch Dec 12, 2018

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