LingYun Studio embeded system framwork software, such as thirdparty build shell and lingyun library
guowenxue
2024-08-21 1e32814e0bc7ee1eb5b7f64b703f8bd03cba7805
update led/relay pin
4 files modified
39 ■■■■ changed files
hal/api/led.c 19 ●●●● patch | view | raw | blame | history
hal/api/led.h 12 ●●●● patch | view | raw | blame | history
hal/api/relay.c 4 ●●●● patch | view | raw | blame | history
hal/api/relay.h 4 ●●●● patch | view | raw | blame | history
hal/api/led.c
@@ -5,12 +5,11 @@
 *       Filename:  led.c
 *    Description:  This file is used to control RGB 3-colors LED
 *
 *
 * Pin connection:
 *               RGB Led Module           IGKBoard
 *                   R        <----->      #Pin33
 *                   G        <----->      #Pin35
 *                   B        <----->      #Pin37
 *               RGB Led Module           IGKBoard-IMX6ULL
 *                   R        <----->      #Pin36 (GPIO1_IO11)
 *                   G        <----->      #Pin38 (GPIO1_IO10)
 *                   B        <----->      #Pin40 (GPIO5_IO09)
 *                  GND       <----->      GND
 *
 ********************************************************************************/
@@ -72,18 +71,18 @@
 *| Leds API based on libgpiod v2.0 |
 *+---------------------------------+*/
static led_t leds_info[LEDCNT] =
static led_t leds_info[LED_CNT] =
{
    {"red",   0, 23, ACTIVE_HIGH, 0, NULL}, /* #31, GPIO1_IO23 on chip0 line 23, active high */
    {"green", 4, 1,  ACTIVE_HIGH, 0, NULL}, /* #33, GPIO5_IO01 on chip4 line 1, active high */
    {"blue",  4, 8,  ACTIVE_HIGH, 0, NULL}, /* #35, GPIO5_IO08 on chip4 line 8, active high */
    {"red",   0, 11, ACTIVE_HIGH, 0, NULL}, /* #Pin36, GPIO1_IO11 on chip0 line 11, active high */
    {"green", 0, 10, ACTIVE_HIGH, 0, NULL}, /* #Pin38, GPIO1_IO10 on chip0 line 10, active high */
    {"blue",  4, 9,  ACTIVE_HIGH, 0, NULL}, /* #Pin40, GPIO5_IO09 on chip4 line 09, active high */
};
/* Leds context */
static leds_t leds =
{
    .leds  = leds_info,
    .count = LEDCNT,
    .count = LED_CNT,
};
int init_led(void)
hal/api/led.h
@@ -7,10 +7,10 @@
 *
 *
 * Pin connection:
 *               RGB Led Module           IGKBoard
 *                   R        <----->      #Pin33
 *                   G        <----->      #Pin35
 *                   B        <----->      #Pin37
 *               RGB Led Module           IGKBoard-IMX6ULL
 *                   R        <----->      #Pin36 (GPIO1_IO11)
 *                   G        <----->      #Pin38 (GPIO1_IO10)
 *                   B        <----->      #Pin40 (GPIO5_IO09)
 *                  GND       <----->      GND
 *
 ********************************************************************************/
@@ -31,7 +31,7 @@
    LED_R = 0,
    LED_G,
    LED_B,
    LEDCNT,
    LED_CNT,
};
enum
@@ -74,4 +74,4 @@
/* blink $which led status with $interval ms */
void blink_led(int which, int interval);
#endif   /* ----- #ifndef _LEDS_H_  ----- */
#endif
hal/api/relay.c
@@ -9,7 +9,7 @@
 * Pin connection:
 *                 Relay Module           IGKBoard-IMX6ULL
 *                  VCC       <----->      5V
 *                   I        <----->      #Pin31
 *                   I        <----->      #Pin22 (GPIO3_IO23)
 *                  GND       <----->      GND
 *
 ********************************************************************************/
@@ -102,7 +102,7 @@
static relay_t relays_info[RELAY_CNT] =
{
    {"relay1",   0, 22, ACTIVE_HIGH, 0, NULL}, /* #31, GPIO1_IO22 on chip0 line 22, active high */
    {"relay1",  2, 23,  ACTIVE_HIGH, 0, NULL}, /* #Pin22, GPIO3_IO23 on chip2 line 23, active high */
};
/* relays context */
hal/api/relay.h
@@ -9,7 +9,7 @@
 * Pin connection:
 *                 Relay Module           IGKBoard-IMX6ULL
 *                  VCC       <----->      5V
 *                   I        <----->      #Pin31
 *                   I        <----->      #Pin22 (GPIO3_IO23)
 *                  GND       <----->      GND
 *
 ********************************************************************************/
@@ -67,4 +67,4 @@
/* toggle $which relay status */
int toggle_relay(int which);
#endif   /* ----- #ifndef _relayS_H_  ----- */
#endif