1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54:
| using System; using System.Collections.Generic; using System.Text;
namespace P40SupportFunctions { class SFRmasks { struct register_info_t { public string name; public ushort addr; public byte size; public ushort reset_value; public ushort reset_value_mask;
public register_info_t(string name, ushort addr, byte size, ushort reset_value, ushort reset_value_mask) { this.name = name; this.addr = addr; this.size = size; this.reset_value = reset_value; this.reset_value_mask = reset_value_mask; } }
class SFR { protected List<register_info_t> register_list = new List<register_info_t>();
register_info_t getSFR(int index) { return register_list[index]; } }
class SFRs : SFR { public void CRC() { register_list.Add(new register_info_t("name1", 0x01, 0x10, 0x1000, 0x1000)); register_list.Add(new register_info_t("name2", 0x02, 0x20, 0x2000, 0x2000)); register_list.Add(new register_info_t("name3", 0x03, 0x30, 0x3000, 0x3000)); }
public void CRYPTO() { register_list.Add(new register_info_t("name4", 0x04, 0x40, 0x4000, 0x4000)); register_list.Add(new register_info_t("name5", 0x05, 0x50, 0x5000, 0x5000)); register_list.Add(new register_info_t("name6", 0x06, 0x60, 0x6000, 0x6000)); } } } } |