123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
-
- #ifndef __IO_H
- #define __IO_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <stdint.h>
-
- typedef enum
- {
- IO_PIN_RESET = 0,
- IO_PIN_SET
- }IO_PinState;
- typedef enum
- {
- IO_MODE_INPUT = 0,
- IO_MODE_OUTPUT,
- IO_MODE_IT_RISING_EDGE,
- IO_MODE_IT_FALLING_EDGE,
- IO_MODE_IT_LOW_LEVEL,
- IO_MODE_IT_HIGH_LEVEL,
-
- IO_MODE_ANALOG,
- IO_MODE_OFF,
- IO_MODE_INPUT_PU,
- IO_MODE_INPUT_PD,
- IO_MODE_OUTPUT_OD,
- IO_MODE_OUTPUT_OD_PU,
- IO_MODE_OUTPUT_OD_PD,
- IO_MODE_OUTPUT_PP,
- IO_MODE_OUTPUT_PP_PU,
- IO_MODE_OUTPUT_PP_PD,
- IO_MODE_IT_RISING_EDGE_PU,
- IO_MODE_IT_RISING_EDGE_PD,
- IO_MODE_IT_FALLING_EDGE_PU,
- IO_MODE_IT_FALLING_EDGE_PD,
- IO_MODE_IT_LOW_LEVEL_PU,
- IO_MODE_IT_LOW_LEVEL_PD,
- IO_MODE_IT_HIGH_LEVEL_PU,
- IO_MODE_IT_HIGH_LEVEL_PD,
- }IO_ModeTypedef;
- typedef struct
- {
- void (*Init)(uint16_t);
- uint16_t (*ReadID)(uint16_t);
- void (*Reset)(uint16_t);
-
- void (*Start)(uint16_t, uint32_t);
- uint8_t (*Config)(uint16_t, uint32_t, IO_ModeTypedef);
- void (*WritePin)(uint16_t, uint32_t, uint8_t);
- uint32_t (*ReadPin)(uint16_t, uint32_t);
-
- void (*EnableIT)(uint16_t);
- void (*DisableIT)(uint16_t);
- uint32_t (*ITStatus)(uint16_t, uint32_t);
- void (*ClearIT)(uint16_t, uint32_t);
-
- }IO_DrvTypeDef;
- #ifdef __cplusplus
- }
- #endif
- #endif
|