##############################################################################
## This file is part of 'LCLS2 Common Carrier Core'.
## It is subject to the license terms in the LICENSE.txt file found in the 
## top-level directory of this distribution and at: 
##    https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 
## No part of 'LCLS2 Common Carrier Core', including this file, 
## may be copied, modified, propagated, or distributed except according to 
## the terms contained in the LICENSE.txt file.
##############################################################################
#schemaversion 3.0.0
#once AppMpsRegAppCh.yaml

threshold: &threshold
  class: MMIODev
  configPrio: 1
  description: Threshold duplex
  size: 0x10
  children:
    minEn:
      at:
        offset:    0x00
      class:       IntField
      sizeBits:    1
      lsBit:       0
      mode:        RW
      description: Minimun threshold enable
    maxEn:
      at:
        offset:    0x00
      class:       IntField
      sizeBits:    1
      lsBit:       1
      mode:        RW
      description: Maximun threshold enable
    min:
      at:
        offset:    0x04
      class:       IntField
      sizeBits:    32
      lsBit:       0
      mode:        RW
      description: Minimun threshold
    max:
      at:
        offset:    0x08
      class:       IntField
      sizeBits:    32
      lsBit:       0
      mode:        RW
      description: Maximum threshold


channel: &channel
  class: MMIODev
  configPrio: 1
  description: threshold channel
  size: 0x200
  children:
    thresholdCount:
      at:
        offset:     0
      class:        IntField
      sizeBits:     8
      lsBit:        0
      mode:         RO
      description:  Number of thresholds enabled
    idleEn:
      at:
        offset:     1
      class:        IntField
      sizeBits:     1
      lsBit:        0
      mode:         RW
      description:  Idle threshold table enable
    altEn:
      at:
        offset:     1
      class:        IntField
      sizeBits:     1
      lsBit:        1
      mode:         RO
      description:  Alt threshold table enable      
    lcls1En:
      at:
        offset:     1
      class:        IntField
      sizeBits:     1
      lsBit:        2
      mode:         RO
      description:  LCLS-1 threshold table enable
    byteMap:
      at:
        offset:     2
      class:        IntField
      sizeBits:     8
      lsBit:        0
      mode:         RO
      description:  Idle threshold table enable
    lcls1Thr:
      <<: *threshold
      at:
        offset: 0x10
        nelms:  1
    idleThr:
      <<: *threshold
      at:
        offset: 0x20
        nelms:  1
    stdThr:
      <<: *threshold
      at:
        offset: 0x100
        nelms:  8
        stride: 0x10
    altThr:
      <<: *threshold
      at:
        offset: 0x180
        nelms:  8
        stride: 0x10

AppMpsRegAppCh: &AppMpsRegAppCh
  class: MMIODev
  configPrio: 1
  description: Mps application application channel registers
  size: 0x10000
  children:
    channel:
      <<: *channel
      at:
        offset: 0x000
        nelms:  24
        stride: 0x200