/* Initialize the ACC module. 
Where the input parameter  */
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)
/* Initialize the ACC module. 
Where the input parameter  */
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)
{
	Assert(p_acc);
	p_acc->ACC_CR |= ACC_CR_SWRST;
	p_acc->ACC_MR = (((ul_select_plus) & ACC_MR_SELPLUS_Msk) | 
			((ul_select_minus) & ACC_MR_SELMINUS_Msk) | 
			((ul_edge_type) & ACC_MR_EDGETYP_Msk) | 
			((ul_invert) & ACC_MR_INV)) | ACC_MR_ACEN_EN;
	p_acc->ACC_ACR = (ACC_ACR_ISEL_HISP |
			ACC_ACR_HYST(ACC_ACR_HYST_50mv_max));
	while (p_acc->ACC_ISR & (uint32_t) ACC_ISR_MASK);
}