2025-05-21 11:31:07 +08:00
|
|
|
/*
|
|
|
|
* fml_gpio.h
|
|
|
|
*
|
|
|
|
* Created on: 2025年4月9日
|
|
|
|
* Author: 22332
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FML_GPIO_H_
|
|
|
|
#define FML_GPIO_H_
|
|
|
|
|
2025-05-30 14:10:31 +08:00
|
|
|
#include <stdbool.h>
|
2025-05-21 11:31:07 +08:00
|
|
|
|
2025-05-30 14:10:31 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
IN_LVDS_UNLOCK = 0x00U,
|
2025-05-21 11:31:07 +08:00
|
|
|
IN_WAKEUP,
|
|
|
|
IN_TFT_ERR,
|
|
|
|
IN_LDO_1V2_PG,
|
|
|
|
IN_SW_3V3_PG,
|
|
|
|
IN_PMIC_FLTB,
|
|
|
|
IN_BL_ERR,
|
|
|
|
} gpio_input;
|
|
|
|
|
2025-05-30 14:10:31 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
OUT_BL_PWM = 0x00U,
|
|
|
|
OUT_BL_EN,
|
|
|
|
OUT_LVDS_PDB,
|
|
|
|
OUT_PON_HOLD,
|
|
|
|
OUT_TFT_BIST,
|
|
|
|
OUT_TFT_SYBYB,
|
|
|
|
OUT_TFT_DISP,
|
|
|
|
OUT_TFT_SHLR,
|
|
|
|
OUT_TFT_RST,
|
|
|
|
OUT_TP_RST,
|
|
|
|
OUT_3V3_TFT_EN,
|
|
|
|
OUT_PMIC_EN,
|
|
|
|
OUT_MCU_INT,
|
|
|
|
OUT_LDO_1V2_EN,
|
2025-05-21 11:31:07 +08:00
|
|
|
} gpio_output;
|
2025-05-30 14:10:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
GPIO_EVENT_RISING,
|
|
|
|
GPIO_EVENT_FALLING,
|
|
|
|
GPIO_EVENT_STABLE
|
|
|
|
} gpio_event_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
gpio_input pin;
|
|
|
|
uint8_t debounce_ms;
|
|
|
|
uint8_t last_state;
|
|
|
|
uint32_t timestamp;
|
|
|
|
} gpio_obj_t;
|
|
|
|
|
|
|
|
|
|
|
|
extern bool fml_gpio_read(uint8_t pos);
|
2025-05-21 11:31:07 +08:00
|
|
|
extern void fml_gpio_write(uint8_t pos,bool status);
|
|
|
|
extern void fml_gpio_init(void);
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* FML_GPIO_H_ */
|