Added attiny13a adc expectations.
This commit is contained in:
		
							parent
							
								
									39ce0af7fb
								
							
						
					
					
						commit
						9228d0703f
					
				
					 1 changed files with 29 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -15,7 +15,7 @@
 | 
			
		|||
 | 
			
		||||
extern "C" 
 | 
			
		||||
{
 | 
			
		||||
#include <iotn404.h> //ATtiny404 header fille.
 | 
			
		||||
#include <iotn13a.h> //ATtiny13A header file.
 | 
			
		||||
#include "ADC.h"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -40,6 +40,34 @@ TEST(test_ADC, FirstTest)
 | 
			
		|||
 | 
			
		||||
TEST(test_ADC, ADC_SetupSetsRegisters)
 | 
			
		||||
{
 | 
			
		||||
    /*
 | 
			
		||||
     * ADC Channel Selection(MUX1, MUX0):
 | 
			
		||||
     * 00 == ADC0/PB5
 | 
			
		||||
     * 01 == ADC1/PB2
 | 
			
		||||
     * 10 == ADC2/PB4
 | 
			
		||||
     * 11 == ADC3/PB3
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    /*Set the ADC Channel 0 using ADMUX reg*/
 | 
			
		||||
    mock().expectOneCall("RegEdit_SetNum")
 | 
			
		||||
        .withPointerParameter("reg", (void *) &ADMUX)
 | 
			
		||||
        .withUnsignedIntParameter("num", 0x00);
 | 
			
		||||
 | 
			
		||||
    /*Set the voltage reference to VCC.*/
 | 
			
		||||
    mock().expectOneCall("RegEdit_ClearBit")
 | 
			
		||||
        .withPointerParameter("reg", (void *) &ADMUX)
 | 
			
		||||
        .withUnsignedIntParameter("bit_num", 6);
 | 
			
		||||
 | 
			
		||||
    /*Set ADC Left adjust result setting to off.*/
 | 
			
		||||
    mock().expectOneCall("RegEdit_ClearBit")
 | 
			
		||||
        .withPointerParameter("reg", (void *) &ADMUX)
 | 
			
		||||
        .withUnsignedIntParameter("bit_num", 5);
 | 
			
		||||
 | 
			
		||||
    /*Set the Prescaler for samping frequency.*/
 | 
			
		||||
 | 
			
		||||
    /*Set the ADC Enable bit ADEN in ADCSCR*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    //Clears control register A for ADC0
 | 
			
		||||
    mock().expectOneCall("RegEdit_SetNum")
 | 
			
		||||
        .withPointerParameter("reg", (void *) &ADC0.CTRLA)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue