2016-04-16 22:13:47 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
The MIT License (MIT)
|
|
|
|
|
|
|
|
Copyright (c) 2016 Hubert Denkmair
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2016-04-08 10:52:20 +02:00
|
|
|
#pragma once
|
|
|
|
|
2016-04-09 22:31:38 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <usbd_def.h>
|
|
|
|
#include <queue.h>
|
2016-04-15 13:56:37 +02:00
|
|
|
#include <led.h>
|
2016-04-20 22:18:23 +02:00
|
|
|
#include <can.h>
|
2016-05-04 21:14:33 +02:00
|
|
|
#include <gs_usb.h>
|
2016-04-08 10:52:40 +02:00
|
|
|
|
2016-04-08 22:57:28 +02:00
|
|
|
extern USBD_ClassTypeDef USBD_GS_CAN;
|
|
|
|
|
2016-04-15 13:56:37 +02:00
|
|
|
uint8_t USBD_GS_CAN_Init(USBD_HandleTypeDef *pdev, queue_t *q_frame_pool, queue_t *q_from_host, led_data_t *leds);
|
2016-04-20 22:18:23 +02:00
|
|
|
void USBD_GS_CAN_SetChannel(USBD_HandleTypeDef *pdev, uint8_t channel, can_data_t* handle);
|
2016-04-09 22:31:38 +02:00
|
|
|
bool USBD_GS_CAN_TxReady(USBD_HandleTypeDef *pdev);
|
2016-04-14 21:12:18 +02:00
|
|
|
uint8_t USBD_GS_CAN_PrepareReceive(USBD_HandleTypeDef *pdev);
|
2016-04-17 17:00:38 +02:00
|
|
|
bool USBD_GS_CAN_CustomDeviceRequest(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
|
2016-04-17 22:24:28 +02:00
|
|
|
bool USBD_GS_CAN_CustomInterfaceRequest(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
|
2016-04-22 11:47:25 +02:00
|
|
|
|
|
|
|
bool USBD_GS_CAN_DfuDetachRequested(USBD_HandleTypeDef *pdev);
|
2016-05-04 21:14:33 +02:00
|
|
|
uint8_t USBD_GS_CAN_SendFrame(USBD_HandleTypeDef *pdev, struct gs_host_frame *frame);
|
2016-05-13 21:59:31 +02:00
|
|
|
uint8_t USBD_GS_CAN_Transmit(USBD_HandleTypeDef *pdev, uint8_t *buf, uint16_t len);
|
|
|
|
uint8_t USBD_GS_CAN_GetProtocolVersion(USBD_HandleTypeDef *pdev);
|