TMC32_QJB/VSP/VSP_request.c

76 lines
2.3 KiB
C
Raw Normal View History

2026-04-30 08:23:12 +00:00
/********************************************************************************
* Copyright (c) 2016, Beijing Tongfang Microelectroics Co., Ltd.
* All rights reserved.
* Module: VSP class response
* Author: Yang Song
* Version: V1.0
* History:
* 2016-09-22 Original version
********************************************************************************/
#include "global.h"
u8 g_bVspLineCoding[7];
/***************************************************************************
* Function: vspClassRequest
* Description:VSP Data processing
* Input: req <EFBFBD><EFBFBD><EFBFBD><EFBFBD>atָ<EFBFBD><EFBFBD>
* Return: NULL
* Other: NULL
**************************************************************************/
void vspClassRequest(u8 req)
{
switch(req)
{
case SET_LINE_CODING : vspSetLineCoding(); break;//0x20
case GET_LINE_CODING : vspGetLineCoding(); break;//0x21
case SET_CONTROL_LINE_STATE : vspSetCtrlLineState(); break;//0x22
default : break;
}
}
/***************************************************************************
* Function: vspGetLineCoding
* Description:VSP Data processing
* Input: NULL
* Return: NULL
* Other: NULL
**************************************************************************/
void vspGetLineCoding(void)
{
memcpy(g_abUsbEp0Buf, (u8*)g_bVspLineCoding, 7);
usbEpnTx(0,g_abUsbEp0Buf,7);
}
/***************************************************************************
* Function: vspSetLineCoding
* Description:VSP Data processing
* Input: NULL
* Return: NULL
* Other: NULL
**************************************************************************/
void vspSetLineCoding(void)
{
while(!EP0STSCXDPKT); //<2F><><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>жϴ<D0B6>λ
memcpy(g_bVspLineCoding, g_abUsbEp0Buf, 7);
}
/***************************************************************************
* Function: vspSetCtrlLineState
* Description:VSP Data processing
* Input: NULL
* Return: NULL
* Other: NULL
**************************************************************************/
void vspSetCtrlLineState(void)
{
}
/***************************************************************************
* Function: vspCommOpenCloseDetect
* Description:VSP <EFBFBD>˿<EFBFBD>״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* Input: NULL
* Return: NULL
* Other: NULL
**************************************************************************/
void vspCommOpenCloseDetect(void)
{
}