| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #ifndef __IR_CHECK_H__
- #define __IR_CHECK_H__
- #include "define.h"
- #include "user_uart.h"
- #include "modbus.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #define MAX_REPLAY_COUNT 3
- #define IR_CHECK_UART_ADDR 0xC1
- #define IR_CHECK_MAX_COUNT 16
- #define DEV_TYPE (uint16_t)193
- #define REG_DEV_TYPE_ADDR (uint16_t)0x0000
- #define REG_VERSION_ADDR (uint16_t)0x0003
- #define REG_COLL_STAT_ADDR (uint16_t)0x0010
- #define REG_COLL_COUNT_ADDR (uint16_t)0x0011
- #define REG_COLL_SW_01_STAT_ADDR (uint16_t)0x0020
- #define REG_COLL_SW_02_STAT_ADDR (uint16_t)0x0022
- typedef struct{
- uint16_t ir_01_ready:8;
- uint16_t ir_02_ready:8;
- }ir_check_ready_s;
- typedef struct{
- uint16_t count:8;
- uint16_t :8;
- }ir_check_count_s;
- typedef struct{
- uint32_t sw_idx00:2;
- uint32_t sw_idx01:2;
- uint32_t sw_idx02:2;
- uint32_t sw_idx03:2;
- uint32_t sw_idx04:2;
- uint32_t sw_idx05:2;
- uint32_t sw_idx06:2;
- uint32_t sw_idx07:2;
- uint32_t sw_idx08:2;
- uint32_t sw_idx09:2;
- uint32_t sw_idx10:2;
- uint32_t sw_idx11:2;
- uint32_t sw_idx12:2;
- uint32_t sw_idx13:2;
- uint32_t sw_idx14:2;
- uint32_t sw_idx15:2;
- }ir_check_sw_stat_s;
- typedef struct{
- uint32_t sw_stat:16;
- uint32_t sw_enable:16;
- }ir_check_sw_set_stat_s;
- typedef enum{
- IR_CHECK_DEV_TYPE = 0,
- IR_CHECK_COLL_REDAY_STAT,
- IR_CHECK_COLL_COUNT,
- IR_CHECK_SW_STAT,
- IR_CHECK_SW_SET,
- }ir_check_work_stat_e;
- typedef struct{
- ir_check_work_stat_e workStat;
- ir_check_ready_s ir_check_ready;
- ir_check_count_s ir_check_count;
- ir_check_sw_stat_s sw_stat[IR_CHECK_MAX_COUNT];
- ir_check_sw_set_stat_s set_stat[IR_CHECK_MAX_COUNT];
- bool set_stat_enable[IR_CHECK_MAX_COUNT];
- uint8_t set_stat_enable_idx;
- }ir_check_work_s;
-
- void vIr_check_init(void);
- void vIr_check_pro(void);
- void vIr_check_tick(void);
- #ifdef __cplusplus
- }
- #endif
- #endif //__IR_CHECK_H__
|