Availability:
     Level 7    , 's'
     Level F    , 't'

  Quick Help:
     Write Peripheral Register - channel or preamp, s[OpType],[RegAddr],[RegValue],[RegMask],[RegPagAddr]
     Write Peripheral Register - channel or preamp, t[OpType],[RegAddr],[RegValue],[RegMask],[RegPagAddr]

  Description:
    This command writes the specified value to the specified register in the specified
    peripheral device.

  Input Parameters:

    0 - Operation Type.
    
        This parameter selects the type of peripheral device operation to be performed.
    
             0 = Write Preamp Register
             1 = Write Read Channel Register
    
             2 = Lock Preamp Registers
             3 = Unlock Preamp Registers
             4 = Toggle Preamp Register Lock
    
             5 = Lock Read Channel Registers
             6 = Unlock Read Channel Registers
             7 = Toggle Read Channel Register Lock
    
          Type:    Unsigned 8-bit value
    
          Range:   0 to 7
    
          Default: 1 (Write Read Channel Register)
    
    1 - Register Address Offset.
    
        This parameter specifies the address offset of the peripheral register to be
        written.  If the peripheral registers has the page address mode, this parameter
        specifies the address offset in the page, which has been specified by the
        parameter 1, Register Page Address. Otherwise, it simply specifies the register
        address offset in the whole range of the register address.
    
          Type:    Unsigned 16-bit value
    
          Range:   0 to 0xFFFF
    
          Default: None
    
    2 - Register Value.
    
        This parameter specifies the value with which the specified register is to be
        written.
    
          Type:    Unsigned 16-bit value
    
          Range:   0 to 0xFFFF
    
          Default: 0
    
    3 - Register Mask.
    
        This parameter specifies the bit mask with which the specified value is to be
        written into the register.
    
          Type:    Unsigned 16-bit value
    
          Range:   0 to 0xFFFF
    
          Default: 0xFFFF
    
    4 - Register Page Address.
    
        This parameter specifies the page address of the peripheral register to be
        written.  If the peripheral registers do not have page address in its address
        mode, this input parameter is not needed and its defaul value does not affect
        the write operation to the peripheral register.
    
          Type:    Unsigned 16-bit value
    
          Range:   0 to 0xFFFF
    
          Default: 0
    
  Output Data:

    If an error occurred, the following information will be displayed.
    
          "DiagError aaaaaaaa"
    
       where
    
          aaaaaaaa is the Diagnostic Error Code
    

    If the Read Channel was locked, the following message will be displayed.
    
          "Channel Locked"
    
    If the Read Channel was unlocked, the following message will be displayed.
    
          "Channel Unlocked"
    

    If no error occurred and the Preamp was locked, the following message will be
    displayed.
    
          "Preamp Locked"
    
    If no error occurred and the Preamp was unlocked, the following message will be
    displayed.
    
          "Preamp Unlocked"
    

    If a Preamp register was written, the following information will be displayed.
    
          "Preamp Reg cc = dd"
    
       where
    
          cc is the address of the register that was written
    
          dd is the data with which the register was written
    

    If a Read Channel register was written, the following information will be displayed.
    
          "Read Channel Reg cccc = dddd"
    
       where
    
          cccc is the address of the register that was written
    
          dddd is the data with which the register was written
    
  Revision History:

    0001.0000   Initial revision.
    0011.0000   Combined the PSG Diagnostic Error Codes (PSGDEC) and the Diagnostic External
                Test Service Error Codes (DETSEC) into a single set of Diagnostic Error Codes
                (DiagError).