-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from qmsk/leds-i2s-out-gpio-setup
leds: Add support for setup/active mode GPIO outputs
- Loading branch information
Showing
26 changed files
with
263 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "gpio.h" | ||
|
||
#if CONFIG_LEDS_GPIO_ENABLED | ||
void leds_gpio_setup (const struct leds_interface_options_gpio *options) | ||
{ | ||
if (!options->gpio_options) { | ||
return; | ||
} | ||
|
||
switch (options->mode) { | ||
case LEDS_GPIO_MODE_NONE: | ||
break; | ||
|
||
case LEDS_GPIO_MODE_SETUP: | ||
case LEDS_GPIO_MODE_ACTIVE: | ||
gpio_out_set(options->gpio_options, options->pins); | ||
break; | ||
} | ||
} | ||
|
||
void leds_gpio_close (const struct leds_interface_options_gpio *options) | ||
{ | ||
if (!options->gpio_options) { | ||
return; | ||
} | ||
|
||
switch (options->mode) { | ||
case LEDS_GPIO_MODE_NONE: | ||
break; | ||
|
||
case LEDS_GPIO_MODE_SETUP: | ||
break; | ||
|
||
case LEDS_GPIO_MODE_ACTIVE: | ||
gpio_out_clear(options->gpio_options); | ||
break; | ||
} | ||
|
||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
#include <leds.h> | ||
|
||
#if CONFIG_LEDS_GPIO_ENABLED | ||
void leds_gpio_setup (const struct leds_interface_options_gpio *options); | ||
void leds_gpio_close (const struct leds_interface_options_gpio *options); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.