versadac  1
versadac - Scalable Recorder Firmware
mb_datacache.h
1 /*****************************************************************************
2 FILE : MB_DataCache.h
3 AUTHOR : Karl wakeham
4 SYSTEM : GNU C++ for ARM
5 DESCRIPTION : Data storage object
6 *****************************************************************************/
7 
8 #ifndef __MBDATACACHE_H
9 #define __MBDATACACHE_H
10 
11 // with the following enabled the values in the data cache are
12 // updated with 0xAAAAAAAA and 0x55555555 on every alternate execution
13 // this is to be used to test for data coherency of runtime parameters
14 #define DATA_CACHE_TEST_EN 0
15 
16 extern "C"
17 {
18 #include "instances.h"
19 }
20 
22 {
23  public:
24 
25  friend class fb_modbus;
26  friend class MB_Driver;
27 
28  MB_DataCache(fb_modbus *fnBlock, char *lockName);
29  ~MB_DataCache();
30 
31  void getLock(void);
32  bool getLockIfFree(void);
33  void releaseLock(void);
34  void updateRunTime(void);
35  void updateConfig(void);
36  uint16 get_scaled_integer_cached_value(int16 index);
37  uint16 get_ieee_cached_value(uint16 z_address, int16 index);
38 
39  fb_modbus *m_pFnBlock;
40  union_t runtime_cache[RUNTIME_PARAMS];
41 
42  private:
43 
44  int32 convert_cached_to_int (CISP_t z_cisp, uint8 type, int16 index);
45 
46  uint32 m_lock;
47 };
48 
49 #endif // __MBDATACACHE_H
50 
Definition: fb_modbus.h:20
Definition: stdtypes.h:134
Definition: mb_drivertask.h:58
Definition: mb_datacache.h:21