BYTE mTouchCapAPI_SetUpChannelSlider4Ch(Slider4Ch *Slider, BYTE Slider_Channel1_Number,BYTE Slider_Channel2_Number, BYTE Slider_Channel3_Number,BYTE Slider_Channel4_Number,WORD Trip_Value, BYTE Decode_Method, BYTE Filter_Method) { BYTE SetUpStatus = TRUE; Slider->Channel_Num[0] = Slider_Channel1_Number; // Stores first Channel Number of the 4-channel slider Slider->Channel_Num[1] = Slider_Channel2_Number; // Stores Second Channel Number of the 4-channel slider Slider->Channel_Num[2] = Slider_Channel3_Number; // Stores third Channel Number of the 4-channel slider Slider->Channel_Num[3] = Slider_Channel4_Number; // Stores fourth Channel Number of the 4-channel slider Slider->FilterType = Filter_Method; //Store the Filter type which will be common for all the channels in the 4 channel slider chFilterType [Slider_Channel1_Number] = Filter_Method; chFilterType [Slider_Channel2_Number] = Filter_Method; chFilterType [Slider_Channel3_Number] = Filter_Method; chFilterType [Slider_Channel4_Number] = Filter_Method; Slider->DecodeMethod = Decode_Method; //Store the Decode method which will be common for all the channels in the 4 channel slider //store the channels numbers in the global array which are associated with the 4-channel slider //Store the Channel 1,Channel 2,Channel 3 and Channel4 numbers of the 4-channel slider in the global array which will be used by the ISR // for reading the ADC value associated LoadChannelNumber(Slider_Channel1_Number); LoadChannelNumber(Slider_Channel2_Number); LoadChannelNumber(Slider_Channel3_Number); LoadChannelNumber(Slider_Channel4_Number); return SetUpStatus; }
BYTE mTouchCapAPI_SetUpChannelMatrixKey(MatrixKey *Button,BYTE Row_Channel_Number,BYTE Col_Channel_Number, WORD Trip_Value, WORD Decode_Method, WORD Filter_Method) { BYTE SetUpStatus = TRUE; Button->Channel_Num[0] = Row_Channel_Number; // Stores Channel Number of the Row asscoiated with the Matrix key Button->Channel_Num[1] = Col_Channel_Number; // Stores Channel Number of the Column asscoiated with the Matrix key Button->FilterType = Filter_Method; //Store the Filter type which will be common for both the multiplexed channel(Row and col) chFilterType [Row_Channel_Number] = Filter_Method; chFilterType [Col_Channel_Number] = Filter_Method; Button->DecodeMethod = Decode_Method; //Store the Decode method which will be common for both the multiplexed channel(Row and col) //store the channels numbers in the global array for all the Matrix Key channels //Store the Row and column channel numbers in the global array which will be used by the ISR // for reading the ADC value associated with the channels which are multiplxed to form a single key LoadChannelNumber(Row_Channel_Number); LoadChannelNumber(Col_Channel_Number); return SetUpStatus; }
void mTouchCapAPI_SetUpChannelDirectKey(DIRECTKEY *Button, BYTE Channel_number, WORD Trip_Value, WORD Decode_Method, WORD Filter_Method) { Button->Channel_Num = Channel_number; // Stores Channel Number Button->FilterType = Filter_Method; chFilterType[Channel_number] = Filter_Method; Button->DecodeMethod = Decode_Method; LoadChannelNumber(Channel_number); }
/******************************************************************** Function : CHAR mTouchCapAPI_SetUpChannelDirectKey(DirectKey *Button,CHAR Channel_number, WORD Trip_Value, WORD Decode_Method, WORD Filter_Method) PreCondition : None Input : Button : Object of the Direct key structure Channel number : channel number of the object Button associated with corresponding direct key. Trip Value: Default Trip value for the channel specified by the channel number. Filter_Method: The filter method associated with the Direct Key. FILTER_METHOD_SLOWAVERAGE=0, FILTER_METHOD_GATEDAVERAGE, FILTER_METHOD_FASTAVERAGE Decode_Method : The Decode method associated with the Direct Key. DECODE_METHOD_MOST_PRESSED, DECODE_METHOD_MULTIPLE_PRESS, DECODE_METHOD_PRESS_AND_RELEASE, DECODE_METHOD_PRESS_ASSERT Output : SetUpStatus - Status of the Direct key(TRUE or FALSE). Side Effects : None Overview : This API will setup the channel associated with the Direct key . The channel number, filter type and decode method are stored in the structure associated with the Direct Key. *******************************************************************/ BYTE mTouchCapAPI_SetUpChannelDirectKey(DirectKey *Button,BYTE Channel_number, WORD Trip_Value, WORD Decode_Method, WORD Filter_Method) { CHAR SetUpStatus = TRUE; Button->Channel_Num = Channel_number; // Stores Channel Number Button->FilterType = Filter_Method; chFilterType [Channel_number] = Filter_Method; Button->DecodeMethod = Decode_Method; //NK_DIRKEY LoadChannelNumber(Channel_number); return SetUpStatus; }