linux: userspace GPIO control

Allow use host GPIO pins for non-realtime purposes.

Signed-off-by: Andrey Kunitsyn <blackicebox@gmail.com>
This commit is contained in:
andryblack
2020-04-24 00:16:31 +03:00
committed by KevinOConnor
parent f0c394de81
commit 8fd330c54e
10 changed files with 187 additions and 22 deletions

View File

@@ -37,7 +37,7 @@ DECL_ENUMERATION_RANGE("pin", "pwmchip7/pwm0", HARD_PWM(7, 0), 16);
#define PWM_PATH "/sys/class/pwm/pwmchip%u/pwm%u/%s"
#define PWM_PATH_BB "/sys/class/pwm/pwm-%u:%u/%s"
struct gpio_pwm gpio_pwm_setup(uint8_t pin, uint32_t cycle_time, uint16_t val)
struct gpio_pwm gpio_pwm_setup(uint32_t pin, uint32_t cycle_time, uint16_t val)
{
char filename[256];
char scratch[16];