2014-04-23 01:21 PM
I received the number from PC but I can't send the signal of buttom from board to PC . HELP ME .
image :http://codientu.org/attachments/imag0416-jpg.12624/project : https://docs.google.com/file/d/0B0dFyiUNuvSQTFIwYmVJUkU3TWs/editsoftware in PC : https://docs.google.com/file/d/0B0dFyiUNuvSQYThfX0FZcWtsZm8/edithttps://docs.google.com/file/d/0B0dFyiUNuvSQTklKczZBelFQeFU/edit2014-04-23 02:10 PM
Isn't there a HID Joystick/Example somewhere?
2014-04-24 07:57 AM
/**
****************************************************************************** * @file usb_endp.c * @author MCD Application Team * @version V4.0.0 * @date 21-January-2013 * @brief Endpoint routines ****************************************************************************** * @attention * * <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the ''License''); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an ''AS IS'' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** *//* Includes ------------------------------------------------------------------*/#include ''hw_config.h''#include ''usb_lib.h''#include ''usb_istr.h''/* Private typedef -----------------------------------------------------------*//* Private define ------------------------------------------------------------*//* Private macro -------------------------------------------------------------*//* Private variables ---------------------------------------------------------*/uint8_t Receive_Buffer[64];extern __IO uint8_t PrevXferComplete;/* Private function prototypes -----------------------------------------------*//* Private functions ---------------------------------------------------------*//******************************************************************************** Function Name : EP1_OUT_Callback.* Description : EP1 OUT Callback Routine.* Input : None.* Output : None.* Return : None.*******************************************************************************/uint8_t kt=0;uint8_t txBuff[64];void EP1_OUT_Callback(void){ //ham nay quyet dinh se lam gi khi nhan duoc du lieu uint8_t i; USB_SIL_Read(EP1_OUT, Receive_Buffer); if(Receive_Buffer[0]) { GPIO_SetBits(GPIOB, GPIO_Pin_8 ); } else { GPIO_ResetBits(GPIOB, GPIO_Pin_8 | GPIO_Pin_9); } //doc du lieu nhan duoc //gui nguoc du lieu quay lai //------------------------------------ if ((PrevXferComplete) && (bDeviceState == CONFIGURED)) { Send_Buffer[0] = 0x05; for(i=0; i<64; ++i) { txBuff[i]=Receive_Buffer[i]; } /* Write the descriptor through the endpoint */ USB_SIL_Write(EP1_IN, (uint8_t*) txBuff, 64); SetEPTxValid(ENDP1); PrevXferComplete = 0; } //------------------------------------ SetEPRxStatus(ENDP1, EP_RX_VALID); }/******************************************************************************** Function Name : EP1_IN_Callback.* Description : EP1 IN Callback Routine.* Input : None.* Output : None.* Return : None.*******************************************************************************/void EP1_IN_Callback(void){ PrevXferComplete = 1;}/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/2014-04-24 08:01 AM
this project in STM32-USB-FS---> project ----> custom_HID --->MDK-ARM----> custom_HID.uvproj
thank you