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

LED class and GPIO LED driver #147

Open
smaeul opened this issue Apr 11, 2018 · 0 comments
Open

LED class and GPIO LED driver #147

smaeul opened this issue Apr 11, 2018 · 0 comments

Comments

@smaeul
Copy link
Member

smaeul commented Apr 11, 2018

Type of issue

Feature

Description

Boards such as the Zero+ and PC2 have LEDs attached to GPIO pins. We should create an LED class and a GPIO LED driver.

LED class

The LED class simply needs a int led_set_state(struct device *dev, uint8_t mode); method, that forwards to an int (*set_state)(struct device *dev, uint8_t mode); driver operation. The available modes are

enum {
    LED_OFF = 0,
    LED_ON = 1,
};

GPIO LED driver

This will need to take a single GPIO pin. It should support both active-high and active-low LEDs. The active level can be set in a member of the struct wrapping struct device, and can be set via a Kconfig option (e.g. { ..., .active_low = CONFIG_GPIO_LED_ACTIVE_LOW }).

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

1 participant