Пример #1
0
        /// <summary>
        /// Creates a register with one field, serving a purpose of read and write register.
        /// </summary>
        /// <returns>A new register.</returns>
        /// <param name="resetValue">Reset value.</param>
        /// <param name="name">Ignored parameter, for convenience. Treat it as a comment.</param>
        public static DoubleWordRegister CreateRWRegister(uint resetValue = 0, string name = null)
        {
            //null because parent is used for logging purposes only - this will never happen in this case.
            var register = new DoubleWordRegister(null, resetValue);

            register.DefineValueField(0, register.MaxRegisterLength);
            return(register);
        }
Пример #2
0
 /// <summary>
 /// Fluent API for change callback registration. For description see <see cref="DoubleWordRegister.DefineChangeCallback"/>.
 /// </summary>
 /// <returns>This register with a defined callback.</returns>
 public static DoubleWordRegister WithChangeCallback(this DoubleWordRegister register, Action <uint, uint> changeCallback)
 {
     register.DefineChangeCallback(changeCallback);
     return(register);
 }
Пример #3
0
 /// <summary>
 /// Fluent API for write callback registration. For description see <see cref="DoubleWordRegister.DefineWriteCallback"/>.
 /// </summary>
 /// <returns>This register with a defined callback.</returns>
 public static DoubleWordRegister WithWriteCallback(this DoubleWordRegister register, Action <uint, uint> writeCallback)
 {
     register.DefineWriteCallback(writeCallback);
     return(register);
 }
Пример #4
0
 /// <summary>
 /// Fluent API for read callback registration. For description see <see cref="DoubleWordRegister.DefineReadCallback"/>.
 /// </summary>
 /// <returns>This register with a defined callback.</returns>
 public static DoubleWordRegister WithReadCallback(this DoubleWordRegister register, Action <uint, uint> readCallback)
 {
     register.DefineReadCallback(readCallback);
     return(register);
 }