8 #ifndef __MBDRIVERTASK_H
9 #define __MBDRIVERTASK_H
11 #include "fb_modbus.h"
17 #define MODMODE_NORMAL 0x00
18 #define MODMODE_TRANSFER_REQUEST 0x20
19 #define MODMODE_FCOMMS_AUTHORISED 0xC0
21 #define FCOMMS_TRANSFER_REQUEST 0xFFFF // prepare to allow factory comms authorisation
22 #define FCOMMS_AUTHORISE 0x13EC // factory comms authorise key
23 #define FCOMMS_MODBUS 0x00FF // normal mapping
24 #define FCOMMS_RAM 0x01FE // not used (left in for completeness)
25 #define FCOMMS_NVOL 0x02FD // not used (left in for completeness)
26 #define FCOMMS_FLASH_SEG1 0x03FC // not used (left in for completeness)
27 #define FCOMMS_FLASH_SEG2 0x04FB // not used (left in for completeness)
28 #define FCOMMS_FLASH_SEG3 0x05FA // not used (left in for completeness)
29 #define FCOMMS_FEATURES1 0x06F9 // read/write feature word 1
30 #define FCOMMS_FEATURES2 0x07F8 // read/write feature word 2
31 #define FCOMMS_FEATURES3 0x08F7 // read/write feature word 3
32 #define FCOMMS_RESET 0x11EE // reset out of factory comms
33 #define FCOMMS_DTEST_CANCEL 0x12ED // revert back to normal display
34 #define FCOMMS_DTEST1 0x12EE // turn all LED's on
35 #define FCOMMS_DTEST2 0x12EF // test display (All pixels to red)
36 #define FCOMMS_DTEST3 0x12F0 // test display (All pixels to green)
37 #define FCOMMS_DTEST4 0x12F1 // turn all LED's off
38 #define FCOMMS_COLD_START 0x10FE // cold start parameter database
39 #define FCOMMS_CLEAR_MAC_ADDR 0x10FF // clear the mac address to 00:00:00:00:00:00
40 #define FCOMMS_TELEM 0x1AE5 // allow dig o/p in config mode
48 MB_AddressRegions region;
69 static uint8 directModbusAccess(uint16 address, uint16 *data, MB_FunctionCodes cmd);
74 void processTransaction(
void);
75 void createReplyHeader(
void);
76 void createException(uint8 error_code);
77 void createReply(uint16 reg_count, uint8 func_code);
78 uint8 processDiagRequest(uint16 z_length);
79 void sendExchangeMessage(
exchange_id xid, uint32 *pMsg);
80 uint8 getExchangeMessage(
exchange_id xid, uint32 *pMsg);
81 void verbosePrintTransaction(uint8 print_type);
82 uint8 readRegister(uint16 base_address, uint16 count, uint16 data_qty, uint8 connectionNumber, uint16 *direct = NULL);
83 uint8 writeRegister(uint16 base_address, uint16 preset_hi, uint16 preset_lo, uint16 data_qty, uint16 count, uint8 connectionNumber, uint16 *direct = NULL);
84 uint8 readRegisterViaCisp(uint32 address, uint16 *count, uint16 data_qty, uint8 connectionNumber);
85 uint8 writeRegisterViaCisp(uint32 address, uint16 *preset_hi, uint16 *preset_lo, uint16 *count, uint16 data_qty, uint8 connectionNumber);
86 uint8 readFlashRegister(uint16 address);
87 uint8 writeFlashRegister(uint16 address, uint16 offset, uint16 data_qty, uint8 connectionNumber);
88 uint8 readSecurityRegister(uint16 address);
89 bool runtime_lock_required(uint16 address);
90 void factory_command(uint16 z_command);
91 uint16 get_feature_word(uint8 word);
92 uint8 set_feature_word(uint8 z_data_hi, uint8 z_data_lo, uint8 word);
93 bool is_network_TCP_protected(CISP_t z_cisp,
exchange_id Xid);
94 uint8 readPublicKeyRegister(uint16 address);
97 void checkCommsChannels(
void);
110 #endif // __MBDRIVERTASK_H
Definition: mb_manager.h:24
Definition: fb_modbus.h:20
Definition: mb_drivertask.h:58
Definition: stdtypes.h:213
Definition: mb_drivertask.h:45
Definition: mb_datacache.h:21