text:
This library provides a .Net adaptation of the `QHsm` and `QHsmWithQueue`
base classes, which come from [Samek's QP Framework](http://www.state-machine.com/).
These are base classes that allow a simple and direct implementation of finite-automata,
hierarchical state-charts.  It is compatible with .NET Core (RC1-update2).

This adaption has two primary goals:

 * Enable a persistence or "durable state-machine" capability.
 * Integrate with asynchronous (async / await) event processing.

## Contents

The Visual Studio 2015 solution contains a single QHsm project, and a QHsm.Tests project.
The test project is simultaneously an xUnit unit-test project and a demo executable.  The
[xUnit.net framework](https://xunit.github.io/docs/getting-started-dnx.html) was chosen
because it is the semi-official unit-test framework for .NET Core.

## Usage Examples

The xUnit project contains a state-machine sample of a "moody person".  Using that code for examples,
the basic components of a state-machine are shown here:

    /// <summary>
    /// In the QHSM, enum values represent events.  In contrast, the .NET paradigm
    /// is best suited with objects as events.  To resolve this mismatch,
    /// this customized .NET QHSM maps object messages to enum values by using
    /// a MessageAttribute.
    /// </summary>
    public enum PersonSignals
    {
        [Message(typeof(PokeMessage))]
        Poke = QSignals.UserSig,
        [Message(typeof(TiredMessage))]
        Tired,
        Noise,
        [Message(typeof(PunchMessage))]
        Punch
    };

    /// <summary>
    /// In a real state-machine, these "message objects" likely
    /// would have content (i.e. public properties).
    /// </summary>
    public class PokeMessage { }
    public class TiredMessage { }
    public class PunchMessage { }

    public class PersonMachine : QHsmQ
    {
        // The state machine knows how to convert object messages into
        // the enum "signals" expected by the QHSM, based on reflecting
        // the enum type supplied as a paramter.
        public PersonMachine() : base(typeof(PersonSignals)) { }

        // The transition to the initial event is specified in this
        // method override.
        protected override void InitializeStateMachine()
        {
            //Perform state-machine init.
            TransitionTo(Happy);
        }

        // ... state and action implementation provided by you.
    }

An example of creating, using, and then persisting the state machine is as follows:

    var person = new PersonMachine();

    //Optionally provide a delegate for logging.
    person.TraceEvent = (i,e) => Console.WriteLine(i.Name);

    // Initialize the state-machine for first-time use.
    // There is a matching Close() routine that should
    // only be called if an urgent shut-down of the
    // overall process is needed.
    person.Start();

    //Dispatch a couple events, to simulate work...
    // An example of an object-based event.
    await person.Dispatch(new TiredMessage());
    // An example of an enum-based event.
    await person.Dispatch(PersonSignals.Noise);

    //Time to persist.  Under normal operations,
    //this is NOT grounds for calling person.Close().

    //The type of 'state' depends on how the state
    //machine was declared.
    var state = person.CurrentState;
    SaveTheStateSomewhere(state);

The `await` statements shown above allow the calling code to know when the
state-machine is no longer processing events, which means it is safe to
persist the state.

### Persistence Deep Dive

Because the state-machine is still online (but inactive) during your persistence
step, it can be directed to take contingency steps to compensate for a
persistence failure:

    var state = person.CurrentState;
    try
    {
        await SaveTheStateSomewhere(state);
    }
    catch (Exception ex)
    {
        //Both of the examples in this catch block assume
        //that the "PersonSignals" for the "PersonMachine"
        //have had suitable additions...

        //Here "Partition" is meant in the CAP theory sense.
        //It is just an example event to send...
        await person.Dispatch(SubscriberSigs.Partition);
        //Or another possibility:
        await person.Dispatch(ex);
    }

In the above example, the state-machine might do something as complex as
initiating a saga-oriented transaction rollback, or something as simple as
writing a message to an emergency log.

To restore the state-machine from the persistent store, the code would be:

    //User defined routine to fetch the state.
    var state = GetTheStateFromSomwhere(id);
    person.Start(state);

The variable `state` is either a string, or a user defined type.  To declare a
user defined type, then the state machine is declared with that type:

    public class MyStateMachine : QHsm<MyUserType> {...}

The user defined type must implement the `IQHsmState` interface, which is defined
as follows:

    public interface IQHsmState
    {
        string Workflow { get; set; }
    }

An example might look like this:

    //Some arbitrary "memento" of state...
    public class PersonState : IQHsmState
    {
        public string Workflow { get; set; }
        /// <summary>
        /// A typical state machine has arbitrary additional state,
        /// called "extended state."  In this case, we are tracking
        /// the amount of noise heard by our Moody Person.
        /// </summary>
        public int DB; //represents decibels of noise
    }

    public class PersonMachine : ExtendedQHsmQ<PersonState>
    {
        //...the rest as before...
    }

When the state-machine is declared with a user defined state type, the `CurrentState`
property will return that user defined state.

### Shunting (asynchronous actions)

Because the `Dispatch` method of the state-machine is awaitable, the internal
implementation of a state-machine must cooperate.  This is done through "shunting,"
as shown in this example:

    //This state is declared within the PersonMachine...
    protected QState Elated(IQEvent evt)
    {
        switch (evt.QSignal)
        {
            //Other signal handlers removed for brevity...
            case (int)PersonSignals.Punch:
                Shunt = SomeAction(Actions.Sigh);
                Shunt = AnotherAction();
                TransitionTo(Sad);
                return null;
        }
        return Happy;
    }

    //These actions are also declared within the PersonMachine sample...
    protected async Task SomeAction(PersonalSignals sig)
    {
        await SomeArbitraryCommand(...);
    }

    protected async Task AnotherAction()
    {
        await MoreWorkOfSomeKind();
        //When the work is done, naturally we want to punch
        //the moody person...
        Dispatch(PersonSignals.Punch);
    }

Internally, the state-machine `Shunt` property provides reference-counting for
the number of outstanding or incomplete asynchronous actions.  When all async actions
have completed, then the completion `Task` returned by the `Dispatch` method will
be signalled.  Accordingly, if any async action throws an *unhandled* exception,
the completion `Task` will also be signalled, and will contain the exception.

If any async action has an unhandled exception, the state-machine will enter
an internal `faulted` state, and will no longer respond to further input.  This
is by design; once an *unhandled* exception occurs within the state-machine, there
is no way to know if the state-machine is stable.

>Note: An asynchronous usage of a state-machine only makes sense with the
QHsmWithQueue base type.  It was adapted for multi-threaded and asynchronous
programming in .Net.

## Quick Start

The test project contains a "moody person" sample state-machine, with
instrumentation attached that sends messaging output to the console.
The sample state-machine serves both purposes of testing the QHSM
library, and filling an educational role for those who are new to Samek's QHSM.

### Visual Studio 2015

To run the demo from Visual Studio, simply debug-launch (F5) the QHsm.Tests project.

### Command-line

To run either the xUnit unit-tests or the "moody person" demo,
open a console window in the QHsm.Tests folder and execute:

    dnu restore

Then, to run the unit-tests:

    dnx test

Or to run the demo:

    dnx run

### Visual Studio Code (cross-platform IDE)

As of 3/21/2016, [VSCode offers only experimental debugging
features for .NET Core](https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/10/experimental-net-core-debugging-in-vs-code/).
However, to simply launch the "moody person" sample state-machine
from within VSCode, follow these steps:

 1. Use the VSCode explorer to open any C# file found inside the `QHsm.Tests` folder.
 In the status bar, at the bottom right corner of VSCode, a `Select Project` option appears.
 1. Use `Select Project` to pick `QHsm.Tests`.
 1. Open the VSCode "command palette" (press F1), type `dnx` and select the `dnx: run command` option.
 This will bring up two options: `dnx run` and `dnx test`.
 1. Select `dnx run`

See [Visual Studio Code documentation](https://code.visualstudio.com/docs/runtimes/aspnet5)
for more information.

>Note: As of 3/22/2106, Visual Studio Code has instability even with
the directions given above. It is probably safest to run the tests
or demo from Visual Studio or the command prompt.

## Customization

This QHSM .Net adaptation consists primarily of the following customizations:

 * The initial state transition mechanism has been replaced with the `TransitionTo(...)` standard mechanism.

 This simplifies readability and the learning process, without sacrificing any functionality.

 * The QHsmWithQueue `Dispatch` routine has been modified to allow non-blocking, multi-threaded dispatch.
 * The state-machines are now persistable.

 This mechanism allows for durable state-machines.  This new capability required state machine initialization
 to be replaced with `Start` and `Stop` entry points.

 * Logging event hooks have been added.
 * A new `Dispatch` entry point allows `object` instances to serve as signals, instead of enum values.

The object-dispatch capability is the recommended way to interact with these base classes.

## Credits

This adaptation is based on a prior [QP .net port provided by Dr. Rainer Hessmer](http://www.hessmer.org/dev/qhsm/).
The initial check-in for this repo contained an unmodified
subset of Hessmer's port, to facilitate comparisons between
the original and this current distro.


text:
////package org.jasig.cas.util;

////import java.security.SecureRandom;

/**
 * Implementation of the RandomStringGenerator that allows you to define the
 * length of the random part.
 *
 * @author Scott Battaglia
 * @version $Revision$ $Date$
 * @since 3.0
 */

using System;

namespace NCAS.jasig.util
{
    public class DefaultRandomStringGenerator : RandomStringGenerator
    {

        /** The array of printable characters to be used in our random string. */
        private static char[] PRINTABLE_CHARACTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345679"
            .ToCharArray();

        /** The default maximum length. */
        private static int DEFAULT_MAX_RANDOM_LENGTH = 35;

        /** An instance of secure random to ensure randomness is secure. */
        private Random randomizer = new Random();

        /** The maximum length the random string can be. */
        private int maximumRandomLength;

        public DefaultRandomStringGenerator()
        {
            this.maximumRandomLength = DEFAULT_MAX_RANDOM_LENGTH;
        }

        public DefaultRandomStringGenerator(int maxRandomLength)
        {
            this.maximumRandomLength = maxRandomLength;
        }

        public int getMinLength()
        {
            return this.maximumRandomLength;
        }

        public int getMaxLength()
        {
            return this.maximumRandomLength;
        }

        public string getNewString()
        {
            byte[] random = this.getNewStringAsBytes();

            return this.convertBytesToString(random);
        }

        public byte[] getNewStringAsBytes()
        {
            byte[] random = new byte[this.maximumRandomLength];

            this.randomizer.NextBytes(random);

            return random;
        }

        private string convertBytesToString(byte[] random)
        {
            char[] output = new char[random.Length];
            for (int i = 0; i < random.Length; i++)
            {
                int index = Math.Abs(random[i] % PRINTABLE_CHARACTERS.Length);
                output[i] = PRINTABLE_CHARACTERS[index];
            }

            return new string(output);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using Alensia.Core.Common;
using UnityEngine;

namespace Alensia.Core.UI
{
    public interface IUIDefinition : IEditorSettings, INamed, IComparable<IUIDefinition>
    {
        GameObject Item { get; }

        bool Enable { get; }

        int Order { get; }
    }
}


text: default_app_config = 'shipping.apps.ShippingConfig'


text:
{{artist.name}}

{{artist.biography}}

 «« Similar Artist »»


text:
//
//  TwoAnyOneManager.m
//  2-1-14
//
//  Created by yogasawara@stv on 2017/03/25.
//  Copyright © 2017年 stv. All rights reserved.
//

#import "TwoAnyOneManager.h"
NSString* const twoAnyOne = @"2NE1";
NSString* const nameKey = @"name";
NSString* const explanationKey = @"explanation";

@implementation TwoAnyOneManager
-(NSArray<Member*> *)members{
    NSArray<NSDictionary*> *array = [self objectFromPlistOf:twoAnyOne rootTypeOfPlist:Array];
    NSMutableArray<Member*> *memberArray = [NSMutableArray array];

    for (NSDictionary<NSString*,NSString*> *mem in array) {
        Member *member = [[Member alloc] initWithName:mem[nameKey]
                                          explanation:mem[explanationKey]];
        [memberArray addObject:member];
    }

    return (NSArray<Member*> *)memberArray;
}

/**
 plistからオブジェクトを取得する

 @param fileName plistの名前
 @param type plistのrootの型。
 @return plistから取得したオブジェクト。
 */
- (id)objectFromPlistOf:(NSString *)fileName
        rootTypeOfPlist:(RootType)type
{
    NSBundle *bundle = [NSBundle mainBundle];
    NSString *path = [bundle pathForResource:fileName ofType:@"plist"];

    switch (type) {
        case Array:
            return [NSArray arrayWithContentsOfFile:path];
            break;

        case Dictionary:
            return [NSDictionary dictionaryWithContentsOfFile:path];
            break;
    }
}

@end


text:
namespace UniversityStudentSystem.Common
{
    public class RoleConstants
    {
        public const string Admin = "Admin";
        public const string Trainer = "Trainer";
    }
}


text:
package org.jkiss.dbeaver.ui.gis.preferences;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.jkiss.dbeaver.model.preferences.DBPPreferenceStore;
import org.jkiss.dbeaver.ui.UIUtils;
import org.jkiss.dbeaver.ui.gis.GeometryViewerConstants;
import org.jkiss.dbeaver.ui.gis.internal.GISMessages;
import org.jkiss.dbeaver.ui.gis.internal.GISViewerActivator;
import org.jkiss.dbeaver.ui.preferences.AbstractPrefPage;
import org.jkiss.utils.CommonUtils;

import java.util.Locale;

public class PrefPageGIS extends AbstractPrefPage implements IWorkbenchPreferencePage {
    public static final String PAGE_ID = "org.jkiss.dbeaver.preferences.gis";

    private Text defaultSridText;
    private Text maxObjectsText;

    @Override
    public void init(IWorkbench workbench) {
        // nothing to initialize
    }

    @Override
    protected Control createContents(Composite parent) {
        final Composite composite = UIUtils.createComposite(parent, 1);
        final DBPPreferenceStore preferences = GISViewerActivator.getDefault().getPreferences();

        {
            final Group group = UIUtils.createControlGroup(composite, GISMessages.pref_page_gis_viewer_group, 2, SWT.NONE, 0);

            defaultSridText = UIUtils.createLabelText(group, GISMessages.pref_page_gis_viewer_label_srid, preferences.getString(GeometryViewerConstants.PREF_DEFAULT_SRID), SWT.BORDER);
            defaultSridText.addVerifyListener(UIUtils.getIntegerVerifyListener(Locale.ENGLISH));

            maxObjectsText = UIUtils.createLabelText(group, GISMessages.pref_page_gis_viewer_label_max_objects, preferences.getString(GeometryViewerConstants.PREF_MAX_OBJECTS_RENDER), SWT.BORDER);
            maxObjectsText.addVerifyListener(UIUtils.getIntegerVerifyListener(Locale.ENGLISH));
        }

        return composite;
    }

    @Override
    protected void performDefaults() {
        final DBPPreferenceStore preferences = GISViewerActivator.getDefault().getPreferences();
        defaultSridText.setText(preferences.getDefaultString(GeometryViewerConstants.PREF_DEFAULT_SRID));
        maxObjectsText.setText(preferences.getDefaultString(GeometryViewerConstants.PREF_MAX_OBJECTS_RENDER));
    }

    @Override
    public boolean performOk() {
        final DBPPreferenceStore preferences = GISViewerActivator.getDefault().getPreferences();
        preferences.setValue(GeometryViewerConstants.PREF_DEFAULT_SRID, CommonUtils.toInt(defaultSridText.getText()));
        preferences.setValue(GeometryViewerConstants.PREF_MAX_OBJECTS_RENDER, CommonUtils.toInt(maxObjectsText.getText()));
        return true;
    }
}


text:
import { WatsonHealthRegionAnalysisVolume24 } from "../../../";

export = WatsonHealthRegionAnalysisVolume24;


text:
package gov.nih.nci.rembrandt.dto.lookup;

public interface DownloadFileLookup {

	public abstract Long getAccessCode();

	public abstract void setAccessCode(Long accessCode);

	public abstract Long getFileId();

	public abstract void setFileId(Long fileId);

	public abstract String getFileName();

	public abstract void setFileName(String fileName);

	public abstract String getFileType();

	public abstract void setFileType(String fileType);

}


text:
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32G4xx_LL_FMAC_H
#define STM32G4xx_LL_FMAC_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32g4xx.h"

/** @addtogroup STM32G4xx_LL_Driver
  * @{
  */

#if defined(FMAC)

/** @defgroup FMAC_LL FMAC
  * @{
  */

/* Private variables ---------------------------------------------------------*/

/* Private constants ---------------------------------------------------------*/

/* Private macros ------------------------------------------------------------*/
#if defined(USE_FULL_LL_DRIVER)
/** @defgroup FMAC_LL_Private_Macros FMAC Private Macros
  * @{
  */
/**
  * @}
  */
#endif /*USE_FULL_LL_DRIVER*/

/* Exported types ------------------------------------------------------------*/

/* Exported constants --------------------------------------------------------*/
/** @defgroup FMAC_LL_Exported_Constants FMAC Exported Constants
  * @{
  */

/** @defgroup FMAC_LL_EC_GET_FLAG Get Flag Defines
  * @brief    Flag defines which can be used with LL_FMAC_ReadReg function
  * @{
  */
#define LL_FMAC_SR_SAT                     FMAC_SR_SAT
#define LL_FMAC_SR_UNFL                    FMAC_SR_UNFL
#define LL_FMAC_SR_OVFL                    FMAC_SR_OVFL
#define LL_FMAC_SR_X1FULL                  FMAC_SR_X1FULL
#define LL_FMAC_SR_YEMPTY                  FMAC_SR_YEMPTY
/**
  * @}
  */

/** @defgroup FMAC_LL_EC_IT IT Defines
  * @brief    IT defines which can be used with LL_FMAC_ReadReg and LL_FMAC_WriteReg functions
  * @{
  */
#define LL_FMAC_CR_SATIEN                  FMAC_CR_SATIEN
#define LL_FMAC_CR_UNFLIEN                 FMAC_CR_UNFLIEN
#define LL_FMAC_CR_OVFLIEN                 FMAC_CR_OVFLIEN
#define LL_FMAC_CR_WIEN                    FMAC_CR_WIEN
#define LL_FMAC_CR_RIEN                    FMAC_CR_RIEN
/**
  * @}
  */

/** @defgroup FMAC_LL_EC_WM FMAC watermarks
  * @brief    Watermark defines that can be used for buffer full (input) or buffer empty (output)
  * @{
  */
#define LL_FMAC_WM_0_THRESHOLD_1           0x00000000UL /*!< Buffer full/empty flag set if there is less than 1 free/unread space. */
#define LL_FMAC_WM_1_THRESHOLD_2           0x01000000UL /*!< Buffer full/empty flag set if there are less than 2 free/unread spaces. */
#define LL_FMAC_WM_2_THRESHOLD_4           0x02000000UL /*!< Buffer full/empty flag set if there are less than 4 free/unread spaces. */
#define LL_FMAC_WM_3_THRESHOLD_8           0x03000000UL /*!< Buffer full/empty flag set if there are less than 8 free/empty spaces. */
/**
  * @}
  */

/** @defgroup FMAC_LL_EC_FUNC FMAC functions
  * @{
  */
#define LL_FMAC_FUNC_LOAD_X1               ((uint32_t)(FMAC_PARAM_FUNC_0))                                         /*!< Load X1 buffer */
#define LL_FMAC_FUNC_LOAD_X2               ((uint32_t)(FMAC_PARAM_FUNC_1))                                         /*!< Load X2 buffer */
#define LL_FMAC_FUNC_LOAD_Y                ((uint32_t)(FMAC_PARAM_FUNC_1 | FMAC_PARAM_FUNC_0))                     /*!< Load Y buffer */
#define LL_FMAC_FUNC_CONVO_FIR             ((uint32_t)(FMAC_PARAM_FUNC_3))                                         /*!< Convolution (FIR filter) */
#define LL_FMAC_FUNC_IIR_DIRECT_FORM_1     ((uint32_t)(FMAC_PARAM_FUNC_3 | FMAC_PARAM_FUNC_0))                     /*!< IIR filter (direct form 1) */
/**
  * @}
  */

/**
  * @}
  */

/* Exported macro ------------------------------------------------------------*/
/** @defgroup FMAC_LL_Exported_Macros FMAC Exported Macros
  * @{
  */

/** @defgroup FMAC_LL_EM_WRITE_READ Common Write and read registers Macros
  * @{
  */

/**
  * @brief  Write a value in FMAC register
  * @param  __INSTANCE__ FMAC Instance
  * @param  __REG__ Register to be written
  * @param  __VALUE__ Value to be written in the register
  * @retval None
  */
#define LL_FMAC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))

/**
  * @brief  Read a value in FMAC register
  * @param  __INSTANCE__ FMAC Instance
  * @param  __REG__ Register to be read
  * @retval Register value
  */
#define LL_FMAC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
/**
  * @}
  */

/**
  * @}
  */

/* Exported functions --------------------------------------------------------*/

/** @defgroup FMAC_LL_Exported_Functions FMAC Exported Functions
  * @{
  */

/** @defgroup FMAC_LL_EF_Configuration FMAC Configuration functions
  * @{
  */

/**
  * @brief  Configure X1 full watermark.
  * @rmtoll X1BUFCFG     FULL_WM       LL_FMAC_SetX1FullWatermark
  * @param  FMACx FMAC instance
  * @param  Watermark This parameter can be one of the following values:
  *         @arg @ref LL_FMAC_WM_0_THRESHOLD_1
  *         @arg @ref LL_FMAC_WM_1_THRESHOLD_2
  *         @arg @ref LL_FMAC_WM_2_THRESHOLD_4
  *         @arg @ref LL_FMAC_WM_3_THRESHOLD_8
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetX1FullWatermark(FMAC_TypeDef *FMACx, uint32_t Watermark)
{
  MODIFY_REG(FMACx->X1BUFCFG, FMAC_X1BUFCFG_FULL_WM, Watermark);
}

/**
  * @brief  Return X1 full watermark.
  * @rmtoll X1BUFCFG     FULL_WM       LL_FMAC_GetX1FullWatermark
  * @param  FMACx FMAC instance
  * @retval Returned value can be one of the following values:
  *         @arg @ref LL_FMAC_WM_0_THRESHOLD_1
  *         @arg @ref LL_FMAC_WM_1_THRESHOLD_2
  *         @arg @ref LL_FMAC_WM_2_THRESHOLD_4
  *         @arg @ref LL_FMAC_WM_3_THRESHOLD_8
  */
__STATIC_INLINE uint32_t LL_FMAC_GetX1FullWatermark(FMAC_TypeDef *FMACx)
{
  return (uint32_t)(READ_BIT(FMACx->X1BUFCFG, FMAC_X1BUFCFG_FULL_WM));
}

/**
  * @brief  Configure X1 buffer size.
  * @rmtoll X1BUFCFG     X1_BUF_SIZE   LL_FMAC_SetX1BufferSize
  * @param  FMACx FMAC instance
  * @param  BufferSize 0x01 .. 0xFF: Number of 16-bit addresses allocated to the input buffer (including the optional "headroom").
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetX1BufferSize(FMAC_TypeDef *FMACx, uint8_t BufferSize)
{
  MODIFY_REG(FMACx->X1BUFCFG, FMAC_X1BUFCFG_X1_BUF_SIZE, ((uint32_t)BufferSize) << FMAC_X1BUFCFG_X1_BUF_SIZE_Pos);
}

/**
  * @brief  Return X1 buffer size.
  * @rmtoll X1BUFCFG     X1_BUF_SIZE   LL_FMAC_GetX1BufferSize
  * @param  FMACx FMAC instance
  * @retval 0x01 .. 0xFF: Number of 16-bit addresses allocated to the input buffer (including the optional "headroom").
  */
__STATIC_INLINE uint8_t LL_FMAC_GetX1BufferSize(FMAC_TypeDef *FMACx)
{
  return (uint8_t)(READ_BIT(FMACx->X1BUFCFG, FMAC_X1BUFCFG_X1_BUF_SIZE) >> FMAC_X1BUFCFG_X1_BUF_SIZE_Pos);
}

/**
  * @brief  Configure X1 base.
  * @rmtoll X1BUFCFG     X1_BASE       LL_FMAC_SetX1Base
  * @param  FMACx FMAC instance
  * @param  Base 0x00 .. 0xFF: Base address of the input buffer (X1) within the internal memory.
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetX1Base(FMAC_TypeDef *FMACx, uint8_t Base)
{
  MODIFY_REG(FMACx->X1BUFCFG, FMAC_X1BUFCFG_X1_BASE, ((uint32_t)Base) << FMAC_X1BUFCFG_X1_BASE_Pos);
}

/**
  * @brief  Return X1 base.
  * @rmtoll X1BUFCFG     X1_BASE       LL_FMAC_GetX1Base
  * @param  FMACx FMAC instance
  * @retval 0x00 .. 0xFF: Base address of the input buffer (X1) within the internal memory.
  */
__STATIC_INLINE uint8_t LL_FMAC_GetX1Base(FMAC_TypeDef *FMACx)
{
  return (uint8_t)(READ_BIT(FMACx->X1BUFCFG, FMAC_X1BUFCFG_X1_BASE) >> FMAC_X1BUFCFG_X1_BASE_Pos);
}

/**
  * @brief  Configure X2 buffer size.
  * @rmtoll X2BUFCFG     X2_BUF_SIZE   LL_FMAC_SetX2BufferSize
  * @param  FMACx FMAC instance
  * @param  BufferSize 0x01 .. 0xFF: Number of 16-bit addresses allocated to the coefficient buffer.
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetX2BufferSize(FMAC_TypeDef *FMACx, uint8_t BufferSize)
{
  MODIFY_REG(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BUF_SIZE, ((uint32_t)BufferSize) << FMAC_X2BUFCFG_X2_BUF_SIZE_Pos);
}

/**
  * @brief  Return X2 buffer size.
  * @rmtoll X2BUFCFG     X2_BUF_SIZE   LL_FMAC_GetX2BufferSize
  * @param  FMACx FMAC instance
  * @retval 0x01 .. 0xFF: Number of 16-bit addresses allocated to the coefficient buffer.
  */
__STATIC_INLINE uint8_t LL_FMAC_GetX2BufferSize(FMAC_TypeDef *FMACx)
{
  return (uint8_t)(READ_BIT(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BUF_SIZE) >> FMAC_X2BUFCFG_X2_BUF_SIZE_Pos);
}

/**
  * @brief  Configure X2 base.
  * @rmtoll X2BUFCFG     X2_BASE       LL_FMAC_SetX2Base
  * @param  FMACx FMAC instance
  * @param  Base 0x00 .. 0xFF: Base address of the coefficient buffer (X2) within the internal memory.
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetX2Base(FMAC_TypeDef *FMACx, uint8_t Base)
{
  MODIFY_REG(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BASE, ((uint32_t)Base) << FMAC_X2BUFCFG_X2_BASE_Pos);
}

/**
  * @brief  Return X2 base.
  * @rmtoll X2BUFCFG     X2_BASE       LL_FMAC_GetX2Base
  * @param  FMACx FMAC instance
  * @retval 0x00 .. 0xFF: Base address of the coefficient buffer (X2) within the internal memory.
  */
__STATIC_INLINE uint8_t LL_FMAC_GetX2Base(FMAC_TypeDef *FMACx)
{
  return (uint8_t)(READ_BIT(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BASE) >> FMAC_X2BUFCFG_X2_BASE_Pos);
}

/**
  * @brief  Configure Y empty watermark.
  * @rmtoll YBUFCFG      EMPTY_WM      LL_FMAC_SetYEmptyWatermark
  * @param  FMACx FMAC instance
  * @param  Watermark This parameter can be one of the following values:
  *         @arg @ref LL_FMAC_WM_0_THRESHOLD_1
  *         @arg @ref LL_FMAC_WM_1_THRESHOLD_2
  *         @arg @ref LL_FMAC_WM_2_THRESHOLD_4
  *         @arg @ref LL_FMAC_WM_3_THRESHOLD_8
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetYEmptyWatermark(FMAC_TypeDef *FMACx, uint32_t Watermark)
{
  MODIFY_REG(FMACx->YBUFCFG, FMAC_YBUFCFG_EMPTY_WM, Watermark);
}

/**
  * @brief  Return Y empty watermark.
  * @rmtoll YBUFCFG      EMPTY_WM      LL_FMAC_GetYEmptyWatermark
  * @param  FMACx FMAC instance
  * @retval Returned value can be one of the following values:
  *         @arg @ref LL_FMAC_WM_0_THRESHOLD_1
  *         @arg @ref LL_FMAC_WM_1_THRESHOLD_2
  *         @arg @ref LL_FMAC_WM_2_THRESHOLD_4
  *         @arg @ref LL_FMAC_WM_3_THRESHOLD_8
  */
__STATIC_INLINE uint32_t LL_FMAC_GetYEmptyWatermark(FMAC_TypeDef *FMACx)
{
  return (uint32_t)(READ_BIT(FMACx->YBUFCFG, FMAC_YBUFCFG_EMPTY_WM));
}

/**
  * @brief  Configure Y buffer size.
  * @rmtoll YBUFCFG      Y_BUF_SIZE    LL_FMAC_SetYBufferSize
  * @param  FMACx FMAC instance
  * @param  BufferSize 0x01 .. 0xFF: Number of 16-bit addresses allocated to the output buffer (including the optional "headroom").
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetYBufferSize(FMAC_TypeDef *FMACx, uint8_t BufferSize)
{
  MODIFY_REG(FMACx->YBUFCFG, FMAC_YBUFCFG_Y_BUF_SIZE, ((uint32_t)BufferSize) << FMAC_YBUFCFG_Y_BUF_SIZE_Pos);
}

/**
  * @brief  Return Y buffer size.
  * @rmtoll YBUFCFG      Y_BUF_SIZE    LL_FMAC_GetYBufferSize
  * @param  FMACx FMAC instance
  * @retval 0x01 .. 0xFF: Number of 16-bit addresses allocated to the output buffer (including the optional "headroom").
  */
__STATIC_INLINE uint8_t LL_FMAC_GetYBufferSize(FMAC_TypeDef *FMACx)
{
  return (uint8_t)(READ_BIT(FMACx->YBUFCFG, FMAC_YBUFCFG_Y_BUF_SIZE) >> FMAC_YBUFCFG_Y_BUF_SIZE_Pos);
}

/**
  * @brief  Configure Y base.
  * @rmtoll YBUFCFG      Y_BASE        LL_FMAC_SetYBase
  * @param  FMACx FMAC instance
  * @param  Base 0x00 .. 0xFF: Base address of the output buffer (Y) within the internal memory.
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetYBase(FMAC_TypeDef *FMACx, uint8_t Base)
{
  MODIFY_REG(FMACx->YBUFCFG, FMAC_YBUFCFG_Y_BASE, ((uint32_t)Base) << FMAC_YBUFCFG_Y_BASE_Pos);
}

/**
  * @brief  Return Y base.
  * @rmtoll YBUFCFG      Y_BASE        LL_FMAC_GetYBase
  * @param  FMACx FMAC instance
  * @retval 0x00 .. 0xFF: Base address of the output buffer (Y) within the internal memory.
  */
__STATIC_INLINE uint8_t LL_FMAC_GetYBase(FMAC_TypeDef *FMACx)
{
  return (uint8_t)(READ_BIT(FMACx->YBUFCFG, FMAC_YBUFCFG_Y_BASE) >> FMAC_YBUFCFG_Y_BASE_Pos);
}

/**
  * @brief  Start FMAC processing.
  * @rmtoll PARAM        START         LL_FMAC_EnableStart
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableStart(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->PARAM, FMAC_PARAM_START);
}

/**
  * @brief  Stop FMAC processing.
  * @rmtoll PARAM        START         LL_FMAC_DisableStart
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableStart(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->PARAM, FMAC_PARAM_START);
}

/**
  * @brief  Check the state of FMAC processing.
  * @rmtoll PARAM        START         LL_FMAC_IsEnabledStart
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledStart(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->PARAM, FMAC_PARAM_START) == (FMAC_PARAM_START)) ? 1UL : 0UL);
}

/**
  * @brief  Configure function.
  * @rmtoll PARAM        FUNC          LL_FMAC_SetFunction
  * @param  FMACx FMAC instance
  * @param  Function This parameter can be one of the following values:
  *         @arg @ref LL_FMAC_FUNC_LOAD_X1
  *         @arg @ref LL_FMAC_FUNC_LOAD_X2
  *         @arg @ref LL_FMAC_FUNC_LOAD_Y
  *         @arg @ref LL_FMAC_FUNC_CONVO_FIR
  *         @arg @ref LL_FMAC_FUNC_IIR_DIRECT_FORM_1
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetFunction(FMAC_TypeDef *FMACx, uint32_t Function)
{
  MODIFY_REG(FMACx->PARAM, FMAC_PARAM_FUNC, Function);
}

/**
  * @brief  Return function.
  * @rmtoll PARAM        FUNC          LL_FMAC_GetFunction
  * @param  FMACx FMAC instance
  * @retval Returned value can be one of the following values:
  *         @arg @ref LL_FMAC_FUNC_LOAD_X1
  *         @arg @ref LL_FMAC_FUNC_LOAD_X2
  *         @arg @ref LL_FMAC_FUNC_LOAD_Y
  *         @arg @ref LL_FMAC_FUNC_CONVO_FIR
  *         @arg @ref LL_FMAC_FUNC_IIR_DIRECT_FORM_1
  */
__STATIC_INLINE uint32_t LL_FMAC_GetFunction(FMAC_TypeDef *FMACx)
{
  return (uint32_t)(READ_BIT(FMACx->PARAM, FMAC_PARAM_FUNC));
}

/**
  * @brief  Configure input parameter R.
  * @rmtoll PARAM        R             LL_FMAC_SetParamR
  * @param  FMACx FMAC instance
  * @param  Param 0x00 .. 0xFF: Parameter R (gain, etc.).
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetParamR(FMAC_TypeDef *FMACx, uint8_t Param)
{
  MODIFY_REG(FMACx->PARAM, FMAC_PARAM_R, ((uint32_t)Param) << FMAC_PARAM_R_Pos);
}

/**
  * @brief  Return input parameter R.
  * @rmtoll PARAM        R             LL_FMAC_GetParamR
  * @param  FMACx FMAC instance
  * @retval 0x00 .. 0xFF: Parameter R (gain, etc.).
  */
__STATIC_INLINE uint8_t LL_FMAC_GetParamR(FMAC_TypeDef *FMACx)
{
  return (uint8_t)(READ_BIT(FMACx->PARAM, FMAC_PARAM_R) >> FMAC_PARAM_R_Pos);
}

/**
  * @brief  Configure input parameter Q.
  * @rmtoll PARAM        Q             LL_FMAC_SetParamQ
  * @param  FMACx FMAC instance
  * @param  Param 0x00 .. 0xFF: Parameter Q (vector length, etc.).
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetParamQ(FMAC_TypeDef *FMACx, uint8_t Param)
{
  MODIFY_REG(FMACx->PARAM, FMAC_PARAM_Q, ((uint32_t)Param) << FMAC_PARAM_Q_Pos);
}

/**
  * @brief  Return input parameter Q.
  * @rmtoll PARAM        Q             LL_FMAC_GetParamQ
  * @param  FMACx FMAC instance
  * @retval 0x00 .. 0xFF: Parameter Q (vector length, etc.).
  */
__STATIC_INLINE uint8_t LL_FMAC_GetParamQ(FMAC_TypeDef *FMACx)
{
  return (uint8_t)(READ_BIT(FMACx->PARAM, FMAC_PARAM_Q) >> FMAC_PARAM_Q_Pos);
}

/**
  * @brief  Configure input parameter P.
  * @rmtoll PARAM        P             LL_FMAC_SetParamP
  * @param  FMACx FMAC instance
  * @param  Param 0x00 .. 0xFF: Parameter P (vector length, number of filter taps, etc.).
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_SetParamP(FMAC_TypeDef *FMACx, uint8_t Param)
{
  MODIFY_REG(FMACx->PARAM, FMAC_PARAM_P, ((uint32_t)Param) << FMAC_PARAM_P_Pos);
}

/**
  * @brief  Return input parameter P.
  * @rmtoll PARAM        P             LL_FMAC_GetParamP
  * @param  FMACx FMAC instance
  * @retval 0x00 .. 0xFF: Parameter P (vector length, number of filter taps, etc.).
  */
__STATIC_INLINE uint8_t LL_FMAC_GetParamP(FMAC_TypeDef *FMACx)
{
  return (uint8_t)(READ_BIT(FMACx->PARAM, FMAC_PARAM_P) >> FMAC_PARAM_P_Pos);
}

/**
  * @}
  */

/** @defgroup FMAC_LL_EF_Reset_Management Reset_Management
  * @{
  */

/**
  * @brief  Start the FMAC reset.
  * @rmtoll CR           RESET         LL_FMAC_EnableReset
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableReset(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->CR, FMAC_CR_RESET);
}

/**
  * @brief  Interrupt the FMAC reset.
  * @rmtoll CR           RESET         LL_FMAC_DisableReset
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableReset(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->CR, FMAC_CR_RESET);
}

/**
  * @brief  Check the state of the FMAC reset.
  * @rmtoll CR           RESET         LL_FMAC_IsEnabledReset
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledReset(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->CR, FMAC_CR_RESET) == (FMAC_CR_RESET)) ? 1UL : 0UL);
}

/**
  * @}
  */

/** @defgroup FMAC_LL_EF_Configuration FMAC Configuration functions
  * @{
  */

/**
  * @brief  Enable Clipping.
  * @rmtoll CR           CLIPEN        LL_FMAC_EnableClipping
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableClipping(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->CR, FMAC_CR_CLIPEN);
}

/**
  * @brief  Disable Clipping.
  * @rmtoll CR           CLIPEN        LL_FMAC_DisableClipping
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableClipping(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->CR, FMAC_CR_CLIPEN);
}

/**
  * @brief  Check Clipping State.
  * @rmtoll CR           CLIPEN        LL_FMAC_IsEnabledClipping
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledClipping(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->CR, FMAC_CR_CLIPEN) == (FMAC_CR_CLIPEN)) ? 1UL : 0UL);
}

/**
  * @}
  */

/** @defgroup FMAC_LL_EF_DMA_Management DMA_Management
  * @{
  */

/**
  * @brief  Enable FMAC DMA write channel request.
  * @rmtoll CR           DMAWEN        LL_FMAC_EnableDMAReq_WRITE
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableDMAReq_WRITE(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->CR, FMAC_CR_DMAWEN);
}

/**
  * @brief  Disable FMAC DMA write channel request.
  * @rmtoll CR           DMAWEN        LL_FMAC_DisableDMAReq_WRITE
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableDMAReq_WRITE(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->CR, FMAC_CR_DMAWEN);
}

/**
  * @brief  Check FMAC DMA write channel request state.
  * @rmtoll CR           DMAWEN        LL_FMAC_IsEnabledDMAReq_WRITE
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledDMAReq_WRITE(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->CR, FMAC_CR_DMAWEN) == (FMAC_CR_DMAWEN)) ? 1UL : 0UL);
}

/**
  * @brief  Enable FMAC DMA read channel request.
  * @rmtoll CR           DMAREN        LL_FMAC_EnableDMAReq_READ
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableDMAReq_READ(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->CR, FMAC_CR_DMAREN);
}

/**
  * @brief  Disable FMAC DMA read channel request.
  * @rmtoll CR           DMAREN        LL_FMAC_DisableDMAReq_READ
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableDMAReq_READ(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->CR, FMAC_CR_DMAREN);
}

/**
  * @brief  Check FMAC DMA read channel request state.
  * @rmtoll CR           DMAREN        LL_FMAC_IsEnabledDMAReq_READ
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledDMAReq_READ(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->CR, FMAC_CR_DMAREN) == (FMAC_CR_DMAREN)) ? 1UL : 0UL);
}

/**
  * @}
  */

/** @defgroup FMAC_LL_EF_IT_Management IT_Management
  * @{
  */

/**
  * @brief  Enable FMAC saturation error interrupt.
  * @rmtoll CR           SATIEN        LL_FMAC_EnableIT_SAT
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableIT_SAT(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->CR, FMAC_CR_SATIEN);
}

/**
  * @brief  Disable FMAC saturation error interrupt.
  * @rmtoll CR           SATIEN        LL_FMAC_DisableIT_SAT
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableIT_SAT(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->CR, FMAC_CR_SATIEN);
}

/**
  * @brief  Check FMAC saturation error interrupt state.
  * @rmtoll CR           SATIEN        LL_FMAC_IsEnabledIT_SAT
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_SAT(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->CR, FMAC_CR_SATIEN) == (FMAC_CR_SATIEN)) ? 1UL : 0UL);
}

/**
  * @brief  Enable FMAC underflow error interrupt.
  * @rmtoll CR           UNFLIEN       LL_FMAC_EnableIT_UNFL
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableIT_UNFL(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->CR, FMAC_CR_UNFLIEN);
}

/**
  * @brief  Disable FMAC underflow error interrupt.
  * @rmtoll CR           UNFLIEN       LL_FMAC_DisableIT_UNFL
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableIT_UNFL(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->CR, FMAC_CR_UNFLIEN);
}

/**
  * @brief  Check FMAC underflow error interrupt state.
  * @rmtoll CR           UNFLIEN       LL_FMAC_IsEnabledIT_UNFL
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_UNFL(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->CR, FMAC_CR_UNFLIEN) == (FMAC_CR_UNFLIEN)) ? 1UL : 0UL);
}

/**
  * @brief  Enable FMAC overflow error interrupt.
  * @rmtoll CR           OVFLIEN       LL_FMAC_EnableIT_OVFL
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableIT_OVFL(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->CR, FMAC_CR_OVFLIEN);
}

/**
  * @brief  Disable FMAC overflow error interrupt.
  * @rmtoll CR           OVFLIEN       LL_FMAC_DisableIT_OVFL
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableIT_OVFL(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->CR, FMAC_CR_OVFLIEN);
}

/**
  * @brief  Check FMAC overflow error interrupt state.
  * @rmtoll CR           OVFLIEN       LL_FMAC_IsEnabledIT_OVFL
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_OVFL(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->CR, FMAC_CR_OVFLIEN) == (FMAC_CR_OVFLIEN)) ? 1UL : 0UL);
}

/**
  * @brief  Enable FMAC write interrupt.
  * @rmtoll CR           WIEN          LL_FMAC_EnableIT_WR
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableIT_WR(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->CR, FMAC_CR_WIEN);
}

/**
  * @brief  Disable FMAC write interrupt.
  * @rmtoll CR           WIEN          LL_FMAC_DisableIT_WR
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableIT_WR(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->CR, FMAC_CR_WIEN);
}

/**
  * @brief  Check FMAC write interrupt state.
  * @rmtoll CR           WIEN          LL_FMAC_IsEnabledIT_WR
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_WR(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->CR, FMAC_CR_WIEN) == (FMAC_CR_WIEN)) ? 1UL : 0UL);
}

/**
  * @brief  Enable FMAC read interrupt.
  * @rmtoll CR           RIEN          LL_FMAC_EnableIT_RD
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_EnableIT_RD(FMAC_TypeDef *FMACx)
{
  SET_BIT(FMACx->CR, FMAC_CR_RIEN);
}

/**
  * @brief  Disable FMAC read interrupt.
  * @rmtoll CR           RIEN          LL_FMAC_DisableIT_RD
  * @param  FMACx FMAC instance
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_DisableIT_RD(FMAC_TypeDef *FMACx)
{
  CLEAR_BIT(FMACx->CR, FMAC_CR_RIEN);
}

/**
  * @brief  Check FMAC read interrupt state.
  * @rmtoll CR           RIEN          LL_FMAC_IsEnabledIT_RD
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_RD(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->CR, FMAC_CR_RIEN) == (FMAC_CR_RIEN)) ? 1UL : 0UL);
}

/**
  * @}
  */

/** @defgroup FMAC_LL_EF_FLAG_Management FLAG_Management
  * @{
  */

/**
  * @brief  Check FMAC saturation error flag state.
  * @rmtoll SR           SAT           LL_FMAC_IsActiveFlag_SAT
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_SAT(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->SR, FMAC_SR_SAT) == (FMAC_SR_SAT)) ? 1UL : 0UL);
}

/**
  * @brief  Check FMAC underflow error flag state.
  * @rmtoll SR           UNFL          LL_FMAC_IsActiveFlag_UNFL
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_UNFL(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->SR, FMAC_SR_UNFL) == (FMAC_SR_UNFL)) ? 1UL : 0UL);
}

/**
  * @brief  Check FMAC overflow error flag state.
  * @rmtoll SR           OVFL          LL_FMAC_IsActiveFlag_OVFL
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_OVFL(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->SR, FMAC_SR_OVFL) == (FMAC_SR_OVFL)) ? 1UL : 0UL);
}

/**
  * @brief  Check FMAC X1 buffer full flag state.
  * @rmtoll SR           X1FULL        LL_FMAC_IsActiveFlag_X1FULL
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_X1FULL(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->SR, FMAC_SR_X1FULL) == (FMAC_SR_X1FULL)) ? 1UL : 0UL);
}

/**
  * @brief  Check FMAC Y buffer empty flag state.
  * @rmtoll SR           YEMPTY        LL_FMAC_IsActiveFlag_YEMPTY
  * @param  FMACx FMAC instance
  * @retval State of bit (1 or 0).
  */
__STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_YEMPTY(FMAC_TypeDef *FMACx)
{
  return ((READ_BIT(FMACx->SR, FMAC_SR_YEMPTY) == (FMAC_SR_YEMPTY)) ? 1UL : 0UL);
}

/**
  * @}
  */

/** @defgroup FMAC_LL_EF_Data_Management Data_Management
  * @{
  */

/**
  * @brief  Write 16-bit input data for the FMAC processing.
  * @rmtoll WDATA        WDATA         LL_FMAC_WriteData
  * @param  FMACx FMAC instance
  * @param  InData 0x0000 .. 0xFFFF: 16-bit value to be provided as input data for FMAC processing.
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_WriteData(FMAC_TypeDef *FMACx, uint16_t InData)
{
  WRITE_REG(FMACx->WDATA, InData);
}

/**
  * @brief  Return 16-bit output data of FMAC processing.
  * @rmtoll RDATA        RDATA         LL_FMAC_ReadData
  * @param  FMACx FMAC instance
  * @retval 0x0000 .. 0xFFFF: 16-bit output data of FMAC processing.
  */
__STATIC_INLINE uint16_t LL_FMAC_ReadData(FMAC_TypeDef *FMACx)
{
  return (uint16_t)(READ_REG(FMACx->RDATA));
}

/**
  * @}
  */

/** @defgroup FMAC_LL_EF_Configuration FMAC Configuration functions
  * @{
  */

/**
  * @brief  Configure memory for X1 buffer.
  * @rmtoll X1BUFCFG     FULL_WM       LL_FMAC_ConfigX1\n
  *         X1BUFCFG     X1_BASE       LL_FMAC_ConfigX1\n
  *         X1BUFCFG     X1_BUF_SIZE   LL_FMAC_ConfigX1
  * @param  FMACx FMAC instance
  * @param  Watermark This parameter can be one of the following values:
  *         @arg @ref LL_FMAC_WM_0_THRESHOLD_1
  *         @arg @ref LL_FMAC_WM_1_THRESHOLD_2
  *         @arg @ref LL_FMAC_WM_2_THRESHOLD_4
  *         @arg @ref LL_FMAC_WM_3_THRESHOLD_8
  * @param  Base 0x00 .. 0xFF: Base address of the input buffer (X1) within the internal memory.
  * @param  BufferSize 0x01 .. 0xFF: Number of 16-bit addresses allocated to the input buffer (including the optional "headroom").
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_ConfigX1(FMAC_TypeDef *FMACx, uint32_t Watermark, uint8_t Base, uint8_t BufferSize)
{
  MODIFY_REG(FMACx->X1BUFCFG, FMAC_X1BUFCFG_FULL_WM | FMAC_X1BUFCFG_X1_BASE | FMAC_X1BUFCFG_X1_BUF_SIZE,
             Watermark | (((uint32_t)Base) << FMAC_X1BUFCFG_X1_BASE_Pos) | (((uint32_t)BufferSize) << FMAC_X1BUFCFG_X1_BUF_SIZE_Pos));
}

/**
  * @brief  Configure memory for X2 buffer.
  * @rmtoll X2BUFCFG     X2_BASE       LL_FMAC_ConfigX2\n
  *         X2BUFCFG     X2_BUF_SIZE   LL_FMAC_ConfigX2
  * @param  FMACx FMAC instance
  * @param  Base 0x00 .. 0xFF: Base address of the coefficient buffer (X2) within the internal memory.
  * @param  BufferSize 0x01 .. 0xFF: Number of 16-bit addresses allocated to the coefficient buffer.
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_ConfigX2(FMAC_TypeDef *FMACx, uint8_t Base, uint8_t BufferSize)
{
  MODIFY_REG(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BASE | FMAC_X2BUFCFG_X2_BUF_SIZE,
             (((uint32_t)Base) << FMAC_X2BUFCFG_X2_BASE_Pos) | (((uint32_t)BufferSize) << FMAC_X2BUFCFG_X2_BUF_SIZE_Pos));
}

/**
  * @brief  Configure memory for Y buffer.
  * @rmtoll YBUFCFG      EMPTY_WM      LL_FMAC_ConfigY\n
  *         YBUFCFG      Y_BASE        LL_FMAC_ConfigY\n
  *         YBUFCFG      Y_BUF_SIZE    LL_FMAC_ConfigY
  * @param  FMACx FMAC instance
  * @param  Watermark This parameter can be one of the following values:
  *         @arg @ref LL_FMAC_WM_0_THRESHOLD_1
  *         @arg @ref LL_FMAC_WM_1_THRESHOLD_2
  *         @arg @ref LL_FMAC_WM_2_THRESHOLD_4
  *         @arg @ref LL_FMAC_WM_3_THRESHOLD_8
  * @param  Base 0x00 .. 0xFF: Base address of the output buffer (Y) within the internal memory.
  * @param  BufferSize 0x01 .. 0xFF: Number of 16-bit addresses allocated to the output buffer (including the optional "headroom").
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_ConfigY(FMAC_TypeDef *FMACx, uint32_t Watermark, uint8_t Base, uint8_t BufferSize)
{
  MODIFY_REG(FMACx->YBUFCFG, FMAC_YBUFCFG_EMPTY_WM | FMAC_YBUFCFG_Y_BASE | FMAC_YBUFCFG_Y_BUF_SIZE,
             Watermark | (((uint32_t)Base) << FMAC_YBUFCFG_Y_BASE_Pos) | (((uint32_t)BufferSize) << FMAC_YBUFCFG_Y_BUF_SIZE_Pos));
}

/**
  * @brief  Configure the FMAC processing.
  * @rmtoll PARAM        START         LL_FMAC_ConfigFunc\n
  *         PARAM        FUNC          LL_FMAC_ConfigFunc\n
  *         PARAM        P             LL_FMAC_ConfigFunc\n
  *         PARAM        Q             LL_FMAC_ConfigFunc\n
  *         PARAM        R             LL_FMAC_ConfigFunc
  * @param  FMACx FMAC instance
  * @param  Start 0x00 .. 0x01: Enable or disable FMAC processing.
  * @param  Function This parameter can be one of the following values:
  *         @arg @ref LL_FMAC_FUNC_LOAD_X1
  *         @arg @ref LL_FMAC_FUNC_LOAD_X2
  *         @arg @ref LL_FMAC_FUNC_LOAD_Y
  *         @arg @ref LL_FMAC_FUNC_CONVO_FIR
  *         @arg @ref LL_FMAC_FUNC_IIR_DIRECT_FORM_1
  * @param  ParamP 0x00 .. 0xFF: Parameter P (vector length, number of filter taps, etc.).
  * @param  ParamQ 0x00 .. 0xFF: Parameter Q (vector length, etc.).
  * @param  ParamR 0x00 .. 0xFF: Parameter R (gain, etc.).
  * @retval None
  */
__STATIC_INLINE void LL_FMAC_ConfigFunc(FMAC_TypeDef *FMACx, uint8_t Start, uint32_t Function, uint8_t ParamP,
                                        uint8_t ParamQ, uint8_t ParamR)
{
  MODIFY_REG(FMACx->PARAM, FMAC_PARAM_START | FMAC_PARAM_FUNC | FMAC_PARAM_P | FMAC_PARAM_Q | FMAC_PARAM_R,
             (((uint32_t)Start) << FMAC_PARAM_START_Pos) | Function | (((uint32_t)ParamP) << FMAC_PARAM_P_Pos) | (((uint32_t)ParamQ) << FMAC_PARAM_Q_Pos) | (((uint32_t)ParamR) << FMAC_PARAM_R_Pos));
}

/**
  * @}
  */

#if defined(USE_FULL_LL_DRIVER)
/** @defgroup FMAC_LL_EF_Init Initialization and de-initialization functions
  * @{
  */
ErrorStatus LL_FMAC_Init(FMAC_TypeDef *FMACx);
ErrorStatus LL_FMAC_DeInit(FMAC_TypeDef *FMACx);

/**
  * @}
  */
#endif /* USE_FULL_LL_DRIVER */

/**
  * @}
  */

/**
  * @}
  */

#endif /* defined(FMAC) */

/**
  * @}
  */

#ifdef __cplusplus
}
#endif

#endif /* STM32G4xx_LL_FMAC_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

// Include required modules
var domUtils = require("../../../lib/dom-utils");
var utils = require("../../../lib/utils");
var windows = require("../../../lib/windows");

var baseWindow = require("../../../lib/ui/base-window");

/**
 * 'PageInfo' Window  class
 *
 * @constructor
 * @param {MozMillController} aController
 *        Controller of the page info window
 */
function PageInfoWindow(aController) {
  baseWindow.BaseWindow.call(this, aController);

  this._dtds = ["chrome://browser/locale/pageInfo.dtd"];
  this._properties = ["chrome://browser/locale/pageInfo.properties"];
}

PageInfoWindow.prototype = Object.create(baseWindow.BaseWindow.prototype);
PageInfoWindow.constructor = PageInfoWindow;

/**
 * Get the selected category
 *
 * @returns {string} The selected category
 */
PageInfoWindow.prototype.__defineGetter__("category", function () {
  var panel = this.getElement({type: "panelsContainer"});
  return panel.getNode().selectedPanel.id.split("Panel")[0];
});

/**
 * Set the selected category
 *
 * @param {string} aCategory
 *        Category tab to click on
 */
PageInfoWindow.prototype.__defineSetter__("category", function (aCategory) {
  assert.equal(typeof aCategory, "string", "tab has been defined");
  var category = this.getElement({type:  "category", subtype: aCategory});

  // Return early if category is already selected
  if (this.category === aCategory) {
    return;
  }

  var selectFlag = false;
  var onSelect = function () { selectFlag = true; };

  this.controller.window.addEventListener("select", onSelect);

  try {
    category.waitThenClick();
    assert.waitFor(() => selectFlag, "Select event has been fired");
  }
  finally {
    this.controller.window.removeEventListener("select", onSelect);
  }

  assert.waitFor(() => (this.category === aCategory),
                 "Category '" + aCategory + "' has been selected");
});

/**
 * Retrieve list of UI elements based on the given specification
 *
 * @param {object} aSpec
 *        Information of the UI elements which should be retrieved
 * @parma {string} aSpec.type
 *        Identifier of the element
 * @param {string} [aSpec.subtype]
 *        Attribute of the element to filter
 * @param {string} [aSpec.value]
 *        Value of the attribute to filter
 * @param {string} [aSpec.parent=document]
 *        Parent of the to find element
 *
 * @returns {ElemBase[]} Elements which have been found
 */
PageInfoWindow.prototype.getElements = function PIW_getElements(aSpec={}) {
  var root = aSpec.parent || this.controller.window.document;
  var elems = null;

  switch (aSpec.type) {
    case "panelsContainer":
      elems = [findElement.ID(root, "mainDeck")];
      break;
    case "categories":
      var viewGroup = findElement.ID(root, "viewGroup");
      var nodeCollector = new domUtils.nodeCollector(viewGroup.getNode());
      nodeCollector.queryNodes("radio").filterByJSProperty("hidden", false);
      elems = nodeCollector.elements;
      break;
    case "category":
      elems = [findElement.ID(root, aSpec.subtype + "Tab")];
      break;
    case "panel":
      elems = [findElement.ID(root, aSpec.subtype + "Panel")];
      break;
    case "security":
      switch (aSpec.subtype) {
        case "domain":
        case "owner":
        case "verifier":
          elems = [findElement.ID(root, "security-identity-" + aSpec.subtype + "-value")];
          break;
        case "cert":
        case "cookies":
        case "password":
          elems = [findElement.ID(root, "security-view-" + aSpec.subtype)];
          break;
      }
      break;
    default:
      assert.fail("Unknown element type - " + aSpec.type);
  }

  return elems;
};

/**
 * Open the page info window
 *
 * @param {function} aCallback
 *        Callback that triggers the opening
 *
 * @returns {PageInfoWindow} New instance of the PageInfoWindow class
 */
function open(aCallback) {
  assert.equal(typeof aCallback, "function",
               "Callback has been defined");

  var controller = windows.waitForWindowState(() => {
    aCallback();
  }, {state: "open", type: "Browser:page-info", observer: "page-info-dialog-loaded"});

  return new PageInfoWindow(controller);
};

// Export classes
exports.pageInfoWindow = PageInfoWindow;

// Export methods
exports.open = open;


text:
import Select from 'react-select';

export const SelectField = ({
  input: { value, onChange },
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  meta,
  simpleValue,
  options,
  ...props
}) => (
  <Select
    value={
      simpleValue ? options.filter((option) => option.value === value) : value
    }
    onChange={(newValue: any) =>
      simpleValue ? onChange(newValue.value) : onChange(newValue)
    }
    options={options}
    {...props}
  />
);