Other Parts Discussed in Thread: HALCOGEN
Hello,
For most device partitions the RM48 safety manual (spnu577d) lists the following 2 "safety features":
ADC8 : Periodic Software Readback of Static Configuration Registers
ADC9 : Software Readback of Written Configuration
However I do not understand the clear difference between them (except one being periodic).
Using HALCoGen I think the following piece of code should cover this.
Is this understanding correct?
void doADC9(void) {
adc_config_reg_t intial, current;
adc1GetConfigValue(&initial, InitialValue);
adc1GetConfigValue(¤t, CurrentValue);
if (memcmp(&initial, ¤t, sizeof(adc_config_reg_t))) {
/* Error */
}
return;
}
void doADC8(void) {
adc_config_reg_t intial, current;
adc1GetConfigValue(&initial, InitialValue);
adc1GetConfigValue(¤t, CurrentValue);
if (memcmp(&initial, ¤t, sizeof(adc_config_reg_t))) {
/* Error */
}
return;
}
int main() {
adcInit();
doADC9();
while(1) {
// application...
doADC8();
}
}