CM_DOG/User/bsp/gpio.h
2025-06-24 10:28:20 +08:00

37 lines
954 B
C

#pragma once
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ----------------------------------------------------------------- */
#include <stdint.h>
#include "bsp/bsp.h"
/* Exported constants ------------------------------------------------------- */
/* Exported macro ----------------------------------------------------------- */
/* Exported types ----------------------------------------------------------- */
typedef enum {
BSP_GPIO_24V_EN1,
BSP_GPIO_24V_EN2,
BSP_GPIO_5V_EN,
BSP_GPIO_NUM,
BSP_GPIO_ERR,
} BSP_GPIO_t;
typedef enum {
BSP_GPIO_OFF,
BSP_GPIO_ON,
} BSP_GPIO_Switch_t;
/* Exported functions prototypes -------------------------------------------- */
int8_t BSP_GPIO_RegisterCallback(uint16_t pin, void (*callback)(void));
int8_t BSP_GPIO_EnableIRQ(uint16_t pin);
int8_t BSP_GPIO_DisableIRQ(uint16_t pin);
int8_t BSP_GPIO_SetPin(BSP_GPIO_t gpio, BSP_GPIO_Switch_t state);
#ifdef __cplusplus
}
#endif