Added ADC_PoweOn() test
+checks for the regedit of the power on bit in the register.
This commit is contained in:
parent
6a7e10b4fb
commit
3aa33779df
1 changed files with 32 additions and 0 deletions
|
@ -33,9 +33,41 @@ TEST(test_ADC, FirstTest)
|
||||||
CHECK(true);
|
CHECK(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(test_ADC, ADC_PowerOnTest)
|
||||||
|
{
|
||||||
|
// The ADCON bit should be high in the ADC_CTRL2 register.
|
||||||
|
mock().expectOneCall("RegEdit_SetBit")
|
||||||
|
.withPointerParameter("reg", (void *) &ADC1->CTLR2)
|
||||||
|
.withUnsignedIntParameter("bit_num", ADC_ADON);
|
||||||
|
|
||||||
|
ADC_PowerOn();
|
||||||
|
}
|
||||||
|
|
||||||
TEST(test_ADC, ADC_SetupSetsRegisters)
|
TEST(test_ADC, ADC_SetupSetsRegisters)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//R32_GPIOD_CFGLR --> 0x40011400
|
||||||
|
//DESC: PD port configuration register low
|
||||||
|
//RESET VALUE--> 0x44444444
|
||||||
|
|
||||||
|
//R32_GPIOD_INDR --> 0x40011408
|
||||||
|
//DESC: PD port input data register
|
||||||
|
|
||||||
|
//R32_GPIOD_BSHR --> 0x40011410
|
||||||
|
//DESC: PD port set/reset register
|
||||||
|
|
||||||
|
//R32_GPIOD_BCR --> 0x40011414
|
||||||
|
//DESC: PD port reset register
|
||||||
|
|
||||||
|
//R32_GPIOD_LCKR --> 0x40011418
|
||||||
|
//DESC: PD port configuration lock register
|
||||||
|
|
||||||
|
//Setup the ADC clock and divider. The internal HSI-XC is 24MHz.
|
||||||
|
|
||||||
|
|
||||||
|
//Setup PORTD pin(s) as analog input.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//Clears control register A for ADC0
|
//Clears control register A for ADC0
|
||||||
|
|
Loading…
Add table
Reference in a new issue