public static async Task Aggregator(
            // blinker
            FPGA.OutputSignal <bool> LED1,

            // keypad
            FPGA.OutputSignal <bool> K7,
            FPGA.OutputSignal <bool> K6,
            FPGA.OutputSignal <bool> K5,
            FPGA.OutputSignal <bool> K4,
            FPGA.InputSignal <bool> K3,
            FPGA.InputSignal <bool> K2,
            FPGA.InputSignal <bool> K1,
            FPGA.InputSignal <bool> K0,

            // banks
            FPGA.OutputSignal <bool> Bank1,
            FPGA.OutputSignal <bool> Bank2,

            // WS2812
            FPGA.OutputSignal <bool> DOUT,

            // ADC
            FPGA.OutputSignal <bool> ADC1NCS,
            FPGA.OutputSignal <bool> ADC1SLCK,
            FPGA.OutputSignal <bool> ADC1DIN,
            FPGA.InputSignal <bool> ADC1DOUT,

            // UART
            FPGA.InputSignal <bool> RXD,
            FPGA.OutputSignal <bool> TXD
            )
        {
            QuokkaBoard.OutputBank(Bank1);
            QuokkaBoard.InputBank(Bank2);

            GameControlsState controlsState = new GameControlsState();

            IsAlive.Blink(LED1);

            Peripherals.GameControls(
                ADC1NCS, ADC1SLCK, ADC1DIN, ADC1DOUT,
                K7, K6, K5, K4, K3, K2, K1, K0,
                controlsState);

            SnakeControl(
                controlsState,
                DOUT, TXD);
        }
Пример #2
0
        public static async Task Aggregator(
            // banks
            FPGA.OutputSignal <bool> Bank1,
            FPGA.OutputSignal <bool> Bank2,

            // blinker
            FPGA.OutputSignal <bool> LED1,
            FPGA.OutputSignal <bool> LED2,
            FPGA.OutputSignal <bool> LED3,
            FPGA.OutputSignal <bool> LED4,

            // WS2812
            FPGA.OutputSignal <bool> DOUT,

            // keypad
            FPGA.OutputSignal <bool> K7,
            FPGA.OutputSignal <bool> K6,
            FPGA.OutputSignal <bool> K5,
            FPGA.OutputSignal <bool> K4,
            FPGA.InputSignal <bool> K3,
            FPGA.InputSignal <bool> K2,
            FPGA.InputSignal <bool> K1,
            FPGA.InputSignal <bool> K0,

            // ADC
            FPGA.OutputSignal <bool> ADC1NCS,
            FPGA.OutputSignal <bool> ADC1SLCK,
            FPGA.OutputSignal <bool> ADC1DIN,
            FPGA.InputSignal <bool> ADC1DOUT,

            // UART
            FPGA.InputSignal <bool> RXD,
            FPGA.OutputSignal <bool> TXD

            )
        {
            QuokkaBoard.OutputBank(Bank1);
            QuokkaBoard.InputBank(Bank2);

            GameControlsState controlsState = new GameControlsState();

            IsAlive.Blink(LED1);

            IsAlive.Blink(LED2);
            IsAlive.Blink(LED3);
            IsAlive.Blink(LED4);

            Peripherals.GameControls(
                ADC1NCS, ADC1SLCK, ADC1DIN, ADC1DOUT,
                K7, K6, K5, K4, K3, K2, K1, K0,
                controlsState);

            LEDControl(controlsState.keyCode, DOUT);

            byte       data    = 0;
            Sequential handler = () =>
            {
                UART.Write(115200, data, TXD);
                data++;
            };

            FPGA.Config.OnTimer(TimeSpan.FromSeconds(1), handler);
        }