private static IEnumerable <IRestriction> CreateRestrictions(BitsType bt)
        {
            List <IRestriction> result = new List <IRestriction>();

            if ((bt != null) && (bt.Map != null))
            {
                result.Add(new BitMaskRestriction(bt.Map.GetBitMask()));
            }

            return(result);
        }
Exemple #2
0
        public void Test()
        {
            const string test   = "SomeEnum ::= BITS {first(1), second(2)}";
            Lexer        lexer  = new Lexer();
            StringReader reader = new StringReader(test);

            lexer.Parse(reader);
            string name = lexer.GetNextSymbol().ToString();

            lexer.GetNextSymbol().Expect(Symbol.Assign);
            lexer.GetNextSymbol().Expect(Symbol.Bits);

            BitsType i = new BitsType("module", "name", lexer);

            Assert.AreEqual("first(1)", i[1]);
        }
 public void SetLineProperty(BitsType bits, StopBitsType sbit, ParityType parity)
 {
     CheckRet(ftdi_set_line_property(ref ftdi, bits, sbit, parity));
 }
 [DllImport("libftdi1")] internal static extern int ftdi_set_line_property(ref ftdi_context ftdi, BitsType bits, StopBitsType sbit, ParityType parity);
Exemple #5
0
		private static IEnumerable<IRestriction> CreateRestrictions(BitsType bt)
		{
			List<IRestriction> result = new List<IRestriction>();

			if ((bt != null) && (bt.Map != null))
			{
				result.Add(new BitMaskRestriction(bt.Map.GetBitMask()));
			}

			return result;
		}
		public void SetLineProperty(BitsType bits, StopBitsType sbit, ParityType parity) 
		{
			CheckRet(ftdi_set_line_property(ref ftdi, bits, sbit, parity));
		}
		[DllImport("libftdi")] internal static extern int ftdi_set_line_property(ref ftdi_context ftdi, BitsType bits, StopBitsType sbit, ParityType parity);
Exemple #8
0
 [DllImport("libftdi1", CallingConvention = CallingConvention.Cdecl)] internal static extern int ftdi_set_line_property(ref ftdi_context ftdi, BitsType bits, StopBitsType sbit, ParityType parity);