aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2018-06-24 16:23:16 +1000
committerGitHub <noreply@github.com>2018-06-24 16:23:16 +1000
commit8e590e6cb3013ab3e317e219031b326df16fb6dc (patch)
tree870a7846aef63fc80aecce175e35bab08f812f5b /LUFA/Drivers
parentfc371d0d0e3a60b06dec862e37612375860c41d5 (diff)
parentded673ec02a92906c5402d5f749518e55beff9fc (diff)
downloadlufa-8e590e6cb3013ab3e317e219031b326df16fb6dc.tar.gz
lufa-8e590e6cb3013ab3e317e219031b326df16fb6dc.tar.bz2
lufa-8e590e6cb3013ab3e317e219031b326df16fb6dc.zip
Merge pull request #126 from kidbomb/feature-ccid
CCID: Multiple Low level and Class driver changes.
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r--LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c51
-rw-r--r--LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h39
2 files changed, 37 insertions, 53 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c
index edc125779..11c20f0b3 100644
--- a/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c
+++ b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.c
@@ -228,57 +228,6 @@ void CCID_Device_USBTask(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo)
break;
}
- case CCID_PC_to_RDR_XfrBlock:
- {
- uint8_t Bwi = Endpoint_Read_8();
- uint16_t LevelParameter = Endpoint_Read_16_LE();
- uint8_t ReceivedBuffer[0x4];
-
- (void)Bwi;
- (void)LevelParameter;
-
- Endpoint_Read_Stream_LE(ReceivedBuffer, sizeof(ReceivedBuffer), NULL);
-
- uint8_t SendBuffer[0x2] = {0x90, 0x00};
- uint8_t SendLength = sizeof(SendBuffer);
-
- USB_CCID_RDR_to_PC_DataBlock_t* ResponseBlock = (USB_CCID_RDR_to_PC_DataBlock_t*)&BlockBuffer;
- ResponseBlock->CCIDHeader.MessageType = CCID_RDR_to_PC_DataBlock;
- ResponseBlock->CCIDHeader.Slot = CCIDHeader.Slot;
- ResponseBlock->CCIDHeader.Seq = CCIDHeader.Seq;
-
- ResponseBlock->ChainParam = 0;
-
- //TODO: Callback
- Status = CCID_COMMANDSTATUS_PROCESSEDWITHOUTERROR | CCID_ICCSTATUS_PRESENTANDACTIVE;
-
- if (CCID_CheckStatusNoError(Status) && !CCIDInterfaceInfo->State.Aborted)
- {
- ResponseBlock->CCIDHeader.Length = SendLength;
- memcpy(&ResponseBlock->Data, SendBuffer, SendLength);
- }
- else if(CCIDInterfaceInfo->State.Aborted)
- {
- Status = CCID_COMMANDSTATUS_FAILED | CCID_ICCSTATUS_PRESENTANDACTIVE;
- Error = CCID_ERROR_CMD_ABORTED;
- SendLength = 0;
- }
- else
- {
- SendLength = 0;
- }
-
- ResponseBlock->Status = Status;
- ResponseBlock->Error = Error;
-
- Endpoint_ClearOUT();
-
- Endpoint_SelectEndpoint(CCIDInterfaceInfo->Config.DataINEndpoint.Address);
- Endpoint_Write_Stream_LE(ResponseBlock, sizeof(USB_CCID_RDR_to_PC_DataBlock_t) + SendLength, NULL);
- Endpoint_ClearIN();
- break;
- }
-
case CCID_PC_to_RDR_Abort:
{
USB_CCID_RDR_to_PC_SlotStatus_t* ResponseAbort = (USB_CCID_RDR_to_PC_SlotStatus_t*)&BlockBuffer;
diff --git a/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h
index 29a79f02d..5acc33af5 100644
--- a/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h
+++ b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h
@@ -111,14 +111,49 @@
*/
void CCID_Device_USBTask(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
+ /** CCID class driver callback for PC_TO_RDR_IccPowerOn CCID message
+ * When the ICC is inserted into a slot of a CCID, the CCID can activate the ICC, and the ICC will respond with an ATR
+ * (answer to reset)
+ *
+ * \param[in] slot The slot currently being powered on
+ * \param[in, out] atr Pointer to an array where the ATR being sent to the device when the Icc is powered on is.
+ * \param[out] atrSize The size of the ATR being sent. Maximum size is 15
+ * \param[out] error The result of the operation, or error
+ *
+ * \return uint8_t The command result
+ */
uint8_t CALLBACK_CCID_IccPowerOn(uint8_t slot, uint8_t* atr, uint8_t* atrSize, uint8_t* error);
+ /** CCID class driver callback for PC_TO_RDR_IccPowerOff CCID message
+ * Turns off the ICC
+ *
+ * \param[in] slot The slot currently being powered off
+ * \param[out] error The result of the operation, or error
+ *
+ * \return uint8_t The command result
+ */
uint8_t CALLBACK_CCID_IccPowerOff(uint8_t slot, uint8_t* error);
+ /** CCID class driver callback for PC_TO_RDR_GetSlotStatus CCID message
+ * Retrieves the current status of a given slot
+ *
+ * \param[in] slot The slot from which we want to retrieve the status
+ * \param[out] error The result of the operation, or error
+ *
+ * \return uint8_t The command result
+ */
uint8_t CALLBACK_CCID_GetSlotStatus(uint8_t slot, uint8_t* error);
- uint8_t CALLBACK_CCID_XfrBlock(uint8_t slot, uint8_t* error, uint8_t* receivedBuffer, uint8_t receivedBufferSize, uint8_t* sendBuffer, uint8_t* sentBufferSize);
-
+ /** CCID class driver callback for CCID_PC_to_RDR_Abort CCID message
+ * Aborts a BULK out message previously sent to a slot
+ *
+ * \param[in] slot The slot to where the message being aborted was sent to
+ * \param[in] seq The current sequence number for this message. Must be checked against to the current
+ * abort massage being sent at the control pipe
+ * \param[out] error The result of the operation, or error
+ *
+ * \return uint8_t The command result
+ */
uint8_t CALLBACK_CCID_Abort(uint8_t slot, uint8_t seq, uint8_t* error);