mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-02-28 03:44:30 +03:00
add modbus (not tested yet)
This commit is contained in:
@@ -23,6 +23,15 @@
|
||||
#define FLASH_SIZE_REG ((uint32_t)0x1FFFF7E0)
|
||||
#define FLASH_SIZE *((uint16_t*)FLASH_SIZE_REG)
|
||||
|
||||
// maximal bit number of flags
|
||||
#define MAX_FLAG_BITNO (0)
|
||||
typedef union{
|
||||
uint32_t u32;
|
||||
struct{
|
||||
uint32_t sw_send_relay_cmd; // switching ESW state will send also CMD_RELAY command with CANID_OUT
|
||||
};
|
||||
} confflags_t;
|
||||
|
||||
/*
|
||||
* struct to save user configurations
|
||||
*/
|
||||
@@ -30,10 +39,13 @@ typedef struct __attribute__((aligned(4))){
|
||||
uint16_t userconf_sz; // "magick number"
|
||||
uint16_t CANIDin; // CAN bus device ID for input commands
|
||||
uint16_t CANIDout; // -//- for output signals
|
||||
uint16_t reserved;
|
||||
uint16_t reserved; // added for 32-bit align
|
||||
uint32_t bouncetime; // anti-bounce timeout (ms)
|
||||
uint32_t usartspeed; // RS-232 speed
|
||||
uint32_t CANspeed; // CAN bus speed
|
||||
confflags_t flags; // different flags
|
||||
uint32_t modbusID; // MODBUS-RTU ID (0 for master)
|
||||
uint32_t modbusspeed; // Speed of modbus interface
|
||||
} user_conf;
|
||||
|
||||
extern user_conf the_conf;
|
||||
|
||||
Reference in New Issue
Block a user