123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #ifndef __IO_H
- #define __IO_H
- #include <stdbool.h>
- #define INPUT_NUMBER 8
- #define OUTPUT_NUMBER 8
- #define DEBOUNCE_CNT 50
- void io_port_init(void);
- void io_init(void);
- void io_tim_init(void);
- typedef struct
- {
- gpio_type *port;
- uint16_t pin;
-
- } simple_gpio_t;
- typedef struct
- {
- gpio_type *port;
- uint16_t pin;
- uint16_t mode;
- gpio_port_source_type port_source;
- uint16_t pin_source;
- uint32_t deb_counter;
- bool p_flag;
- uint32_t cnt;
-
- } in_t;
- typedef struct
- {
- gpio_type *port;
- uint16_t pin;
- uint16_t mode;
-
- } out_t;
- extern uint16_t input_state[INPUT_NUMBER];
- extern uint32_t input_cnt[INPUT_NUMBER];
- typedef struct
- {
- uint16_t mode;
- uint16_t debounce_time;
- } input_t;
- typedef struct
- {
- uint16_t state;
- uint16_t pwm;
- uint16_t mode;
- uint16_t smode_state;
-
- uint16_t smode_pwm;
- uint16_t normal_state;
-
- } output_t;
- typedef struct
- {
- uint16_t smode;
- uint16_t com_timeout;
- } system_t;
- typedef struct
- {
- uint16_t model;
- uint32_t proddate;
- uint32_t serial;
- uint8_t fw_version[8];
- uint8_t test_state;
-
- } sys_settings_t;
- #endif
|