| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef _CASCADE_FREEMODBUS_H_
- #define _CASCADE_FREEMODBUS_H_
- #include "stdint.h"
- #include "datadef.h"
- #include "power.h"
- typedef struct {
- union {
- md_ac_dc_t ac_dc;
- md_3_ac_t ac_3;
- }data;
- }north_data_t;
- typedef struct cascade_saddr{
- uint8_t addr;
- uint16_t channels;
- power_ch_new_t ch[POWER_SLAVE_CH_MAX];
- }slave_info_t;
- typedef union{
- slave_info_t info;
- north_data_t north;
- }cascade_data_cache;
- typedef struct {
- uint8_t model; // master or slave model
- uint8_t saddr; // slave addr
- uint32_t baund; //
- uint32_t north_reg_max;
- uint32_t north_reg_start;
- uint32_t cascade_max;
- uint32_t cascade_start;
- cascade_data_cache *cache;
- lock_t lock;
-
- }cascade_freemodbus_t;
- void cascade_freemodbus_init(void);
- void cascade_freemodbus_reset(uint8_t model,uint8_t saddr,uint32_t baund);
- cascade_freemodbus_t * get_cascade_freemodbus(void);
- #endif
|