Lorcan Smith
/
Enet_SPI
SNMP agent attached to SPI slave
Diff: IO_file.h
- Revision:
- 2:25e12a7fe0aa
- Parent:
- 1:bbae6f16a449
--- a/IO_file.h Mon Sep 03 10:46:04 2012 +0000 +++ b/IO_file.h Thu Sep 06 12:52:48 2012 +0000 @@ -1,9 +1,9 @@ /***************************************************************************** -* Copyright Field Electronics Ltd +* Copyright SEEC Ltd * File: IO_file.h -* Reference: 1000PX-BM1660-HDR-IO_file +* Reference: A3600-HDR-IO_file * Content: Defines & declarations for HTTP server -* Version: 1.2 +* Version: 1.1 * System: mbed * Target Hardware: mbed * Amendment Record: @@ -14,15 +14,12 @@ 0.3 22/12/11 Add new_cmd_idx to indicate which parameter has been set. 0.4 27/12/11 Add RUN_SCAN_CMD as index for writing wiring scan enable. 0.5 29/12/11 Add net_addrs_set for writing net address to file. - 0.6 06/01/12 Change 3000 index for version & add indices for net addresses + 0.6 06/01/12 Change main CPU index for version & add indices for net addresses 0.7 09/01/12 #define NET_ADDRESS_CHANGE to flag net address changes 0.8 30/01/12 Add get_SPI_count() & #define SPI_COUNT = 1752 0.9 03/05/12 Add definitions used for trap handling 1.0 15/06/12 Make TRAP_HOST_ADDRESS contiguous with SNMP net addresses 1.1 18/06/12 Add get_hex_mask for updates from SNMP - 1.2 09/08/12 #define MSG_LNGTH 16. #define NUM_MASK 8 - Declare extern char alarm_msg[NUM_MASK][MSG_LNGTH] - Declare extern unsigned long io_mask[] */ /****************************************************************************/ @@ -33,36 +30,33 @@ #define __DEBUG #include "dbg/dbg.h" #include "ipaddr.h" -#include "private_mib.h" //#include "rpc.h" -#define H_H_LINK_MSBYTE 62 // index to 3000 head-head link status ms byte +#define H_H_LINK_MSBYTE 62 // index to main CPU head-head link status ms byte #define H_H_LINK_LSBYTE 63 // DEBUG head-head link status ls byte should be 63 #define MAX_IO_REG_BYTE 63 // Maximum I/O byte checked for changes -#define NET_IP_ADDRESS 1704 // index to 3000 firmware IP addresses -#define NET_ADDRESS_MASK 1708 // index to 3000 firmware address mask -#define NET_GATEWAY_ADDRS 1712 // index to 3000 firmware gateway address -#define NET_DNS_ADDRESS 1716 // index to 3000 firmware DNS address -#define TRAP_HOST_ADDRESS 1720 // index to 3000 firmware address for trap host -#define NET_ADDRESS_CHANGE 1736 // index to 3000 address change flag -#define SPI_COUNT 1752 // index to 3000 SPI write count (activity indicator) -#define VERSION_IDX 1754 // index to 3000 firmware version number -#define RUN_SCAN_IDX 1758 // index to wiring scan enable in 3000 unit -#define NUM_CARD_IDX 2045 // index to number of card in 3000 unit -#define COMMS_IDX 2046 // index to 3000 Modbus comms type and speed -#define UNIT_ID_IDX 2047 // index to 3000 Modbus comms unit ident +#define NET_IP_ADDRESS 1704 // index to main CPU firmware IP addresses +#define NET_ADDRESS_MASK 1708 // index to main CPU firmware address mask +#define NET_GATEWAY_ADDRS 1712 // index to main CPU firmware gateway address +#define NET_DNS_ADDRESS 1716 // index to main CPU firmware DNS address +#define TRAP_HOST_ADDRESS 1720 // index to main CPU firmware address for trap host +#define NET_ADDRESS_CHANGE 1736 // index to main CPU address change flag +#define SPI_COUNT 1752 // index to main CPU SPI write count (activity indicator) +#define VERSION_IDX 1754 // index to main CPU firmware version number +#define RUN_SCAN_IDX 1758 // index to wiring scan enable in main CPU unit +#define NUM_CARD_IDX 2045 // index to number of card in main CPU unit +#define COMMS_IDX 2046 // index to main CPU Modbus comms type and speed +#define UNIT_ID_IDX 2047 // index to main CPU Modbus comms unit ident #define MAX_RAM 2048 // size of RAM to copy #define UNIT_ID_CMD 1 // index to command for Modbus comms unit ident #define RUN_SCAN_CMD 2 // index to command for 1000PX run scan enable -/* v0.9: Trap definitions added */ -#define ONLY_TRAP 0 // index for trap when only one used +/* v0.9: Trap definitions addeds */ +#define ONLY_TRAP 0 // index for trap when only one used #define DISABLED 0 #define ENABLED 1 -#define MSG_LNGTH 16 // length of strings for alarm & location messages -#define NUM_MASK 8 // MAX_ALARM_ID # of io_masks available for alarms class SPI_Server { @@ -104,20 +98,12 @@ extern unsigned char dns_ad[]; extern unsigned char th_ad[]; extern unsigned char net_addrs_set; // flags net address change -extern unsigned char alarm_str_set; // flags alarm string update from SNMP extern unsigned char blink_led; -extern char alarm_msg[NUM_MASK][MSG_LNGTH]; // alarm messages associated with io_masks -extern unsigned long io_mask[]; // masks for alarms on IO registers -extern unsigned long mask4_IO_registers; // mask for IO regs ignoring IO31 & 32 - - extern SPI_Server fsvr; extern void check4write_offset( char * req ); -extern char * get_hex_mask( unsigned long bit_mask ); -extern char * get_alarm_string(unsigned char alarm_idx); -extern int read_alarm_from_file(unsigned char alarm_idx); +extern char * get_hex_mask( void ); extern IpAddr mip;