| | |
| | | * B <-----> #Pin37(BCM GPIO26) |
| | | * GND <-----> GND |
| | | * |
| | | * RGB Led Module Raspberry Pi Board |
| | | * R <-----> #Pin36(BCM GPIO16) |
| | | * G <-----> #Pin38(BCM GPIO20) |
| | | * B <-----> #Pin40(BCM GPIO21) |
| | | * GND <-----> GND |
| | | * |
| | | * System install: |
| | | * sudo apt install -y libgpiod-dev gpiod |
| | | * |
| | |
| | | struct gpiod_line *line; /* libgpiod line */ |
| | | } led_info_t; |
| | | |
| | | #define CONFIG_PIN_333537 |
| | | //#define CONFIG_PIN_363840 |
| | | |
| | | static led_info_t leds_info[LEDCNT] = |
| | | { |
| | | #ifdef CONFIG_PIN_333537 |
| | | {"red", 13, 1, NULL }, |
| | | {"green", 19, 1, NULL }, |
| | | {"blue", 26, 1, NULL }, |
| | | #elif (defined CONFIG_PIN_363840) |
| | | {"red", 16, 1, NULL }, |
| | | {"green", 20, 1, NULL }, |
| | | {"blue", 21, 1, NULL }, |
| | | #endif |
| | | }; |
| | | |
| | | /* Three LEDs API context */ |
| | |
| | | printf("initial leds gpio failure, rv=%d\n", rv); |
| | | return 1; |
| | | } |
| | | printf("initial RGB Led gpios okay\n", rv); |
| | | printf("initial RGB Led gpios okay\n"); |
| | | |
| | | signal(SIGINT, sig_handler); |
| | | signal(SIGTERM, sig_handler); |