You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
1.6 KiB
79 lines
1.6 KiB
#ifndef APP_TYPES_H
|
|
#define APP_TYPES_H
|
|
|
|
#include "r_cg_macrodriver.h"
|
|
#include <stdint.h>
|
|
|
|
#define APP_JOB_PAYLOAD_MAX 320
|
|
#define APP_JOB_LINE_MAX 320
|
|
|
|
typedef enum {
|
|
APP_CMD_SRC_PC = 0,
|
|
APP_CMD_SRC_RS485 = 1
|
|
} app_cmd_src_t;
|
|
|
|
typedef enum {
|
|
APP_JOB_NONE = 0,
|
|
APP_JOB_PROTO_OW,
|
|
APP_JOB_PROTO_OR,
|
|
APP_JOB_FORWARD_LINE,
|
|
APP_JOB_LOCAL_EXEC
|
|
} app_job_type_t;
|
|
|
|
typedef enum {
|
|
APP_PROTO_NONE = 0,
|
|
APP_PROTO_OWIW,
|
|
APP_PROTO_OWIT,
|
|
APP_PROTO_OWIR,
|
|
|
|
/* r_main.c ȣȯ¿ë */
|
|
APP_PROTO_I2CW,
|
|
APP_PROTO_I2CT,
|
|
APP_PROTO_I2CR
|
|
} app_proto_t;
|
|
|
|
/* r_main.c ȣȯ alias */
|
|
typedef app_cmd_src_t CmdSource;
|
|
#define CMD_SRC_PC APP_CMD_SRC_PC
|
|
#define CMD_SRC_RS485 APP_CMD_SRC_RS485
|
|
|
|
typedef app_proto_t ProtocolType;
|
|
#define PROTOCOL_UNKNOWN APP_PROTO_NONE
|
|
#define PROTOCOL_OWIW APP_PROTO_OWIW
|
|
#define PROTOCOL_OWIT APP_PROTO_OWIT
|
|
#define PROTOCOL_OWIR APP_PROTO_OWIR
|
|
#define PROTOCOL_I2CW APP_PROTO_I2CW
|
|
#define PROTOCOL_I2CT APP_PROTO_I2CT
|
|
#define PROTOCOL_I2CR APP_PROTO_I2CR
|
|
|
|
typedef enum {
|
|
PREFIX_NONE = 0,
|
|
PREFIX_CAL
|
|
} PrefixMode;
|
|
|
|
typedef struct {
|
|
app_job_type_t type;
|
|
app_cmd_src_t src;
|
|
|
|
uint8_t addr;
|
|
uint8_t channel;
|
|
char mode;
|
|
uint8_t hash_on;
|
|
uint8_t anaout_on;
|
|
uint8_t check_on;
|
|
|
|
app_proto_t proto;
|
|
uint8_t id;
|
|
uint16_t len;
|
|
uint8_t payload[APP_JOB_PAYLOAD_MAX];
|
|
|
|
char line[APP_JOB_LINE_MAX];
|
|
} app_job_t;
|
|
|
|
/* r_main.c¿¡¼ ¾²´Â ÃÖ¼Ò runtime wrapper */
|
|
typedef struct {
|
|
uint8_t active;
|
|
app_job_t job;
|
|
} app_runtime_job_t;
|
|
|
|
#endif
|