Exemplo n.º 1
0
        public void TestSetFullAmplitudeScale()
        {
            // Define call to Amplitude Control Register (ACR)
            // We want to set the amplitude manually, so ACR[12]=1
            // and ACR[11]=0, the bits ACR[9:0] define the amplitude
            // scale factor, which we want to set to max (so all 1)
            // the remaining bits ACR[23:13,10] have no effect in manual
            // mode, so we just set them to 0, this results in the call
            // ACR address = 0x06
            // ACR[23:16] = 00000000 = 0x00
            // ACR[15:08] = 00010011 = 0x13
            // ACR[07:00] = 11111111 = 0xFF

            byte[] acrCall = { 0x06, 0x00, 0x13, 0xFF };

            Expect.Once.On(mockMicrocontroller).Method("SendDataToEP2").With(acrCall);

            dds.SetAmplitude(1023);

            mocks.VerifyAllExpectationsHaveBeenMet();
        }