Function acc_init()

Initialize the ACC module.

void acc_init(
		Acc * p_acc,
		uint32_t ul_select_plus,
		uint32_t ul_select_minus,
		uint32_t ul_edge_type,
		uint32_t ul_invert)

Note: This function performs a software reset on the ACC module prior to its initialization.
Table 1. Parameters
Data direction Parameter name Description

[in, out]

p_acc

Module hardware register base address pointer

[in]

ul_select_plus

Selection for the plus comparator input (inp)

[in]

ul_select_minus

Selection for the minus comparator input (inn)

[in]

ul_edge_type

Comparison flag triggering mode

[in]

ul_invert

Invert the comparator output mode

Where the input parameter ul_select_plus is one of the following:

Parameter Value

Description

ACC_MR_SELPLUS_AD0

Select AD0 as the plus input

ACC_MR_SELPLUS_AD1

Select AD1 as the plus input

ACC_MR_SELPLUS_AD2

Select AD2 as the plus input

ACC_MR_SELPLUS_AD3

Select AD3 as the plus input

ACC_MR_SELPLUS_AD4

Select AD4 as the plus input

ACC_MR_SELPLUS_AD5

Select AD5 as the plus input

ACC_MR_SELPLUS_AD6

Select AD6 as the plus input

ACC_MR_SELPLUS_AD7

Select AD7 as the plus input

Where the input parameter ul_select_minus is one of the following:

Parameter Value

Description

ACC_MR_SELMINUS_TS

Select TS as the minus input

ACC_MR_SELMINUS_ADVREF

Select ADVREF as the minus input

ACC_MR_SELMINUS_DAC0

Select DAC0 as the minus input

ACC_MR_SELMINUS_DAC1

Select DAC1 as the minus input

ACC_MR_SELMINUS_AD0

Select AD0 as the minus input

ACC_MR_SELMINUS_AD1

Select AD1 as the minus input

ACC_MR_SELMINUS_AD2

Select AD2 as the minus input

ACC_MR_SELMINUS_AD3

Select AD3 as the minus input

Where the input parameter ul_edge_type is one of the following:

Parameter Value

Description

ACC_MR_EDGETYP_RISING

Rising edge of comparator output

ACC_MR_EDGETYP_FALLING

Falling edge of comparator output

ACC_MR_EDGETYP_ANY

Any edge of comparator output

Where the input parameter ul_invert is one of the following:

Parameter Value

Description

ACC_MR_INV_DIS

Comparator output is directly processed

ACC_MR_INV_EN

Comparator output is inverted prior to being processed