I changed one line of code in the file with path name: USBDeviceHT/targets/TARGET_Maxim

Fork of USBDeviceHT by Helmut Tschemernjak

Committer:
dev_alexander
Date:
Fri Jun 01 21:43:55 2018 +0000
Revision:
6:c1f162fd7777
Parent:
0:a3ea811f80f2
Fixed Error with code not compiling due to an issue with there not being a (uint32_t) cast of a (void) pointer. Maxim was the only mbed vendor to not have this one (uint32_t) cast in the spot it was added to. Look into public repos for similar cases.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Helmut64 0:a3ea811f80f2 1 /*******************************************************************************
Helmut64 0:a3ea811f80f2 2 * DISCLAIMER
Helmut64 0:a3ea811f80f2 3 * This software is supplied by Renesas Electronics Corporation and is only
Helmut64 0:a3ea811f80f2 4 * intended for use with Renesas products. No other uses are authorized. This
Helmut64 0:a3ea811f80f2 5 * software is owned by Renesas Electronics Corporation and is protected under
Helmut64 0:a3ea811f80f2 6 * all applicable laws, including copyright laws.
Helmut64 0:a3ea811f80f2 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
Helmut64 0:a3ea811f80f2 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
Helmut64 0:a3ea811f80f2 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
Helmut64 0:a3ea811f80f2 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
Helmut64 0:a3ea811f80f2 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
Helmut64 0:a3ea811f80f2 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
Helmut64 0:a3ea811f80f2 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
Helmut64 0:a3ea811f80f2 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
Helmut64 0:a3ea811f80f2 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Helmut64 0:a3ea811f80f2 16 * Renesas reserves the right, without notice, to make changes to this software
Helmut64 0:a3ea811f80f2 17 * and to discontinue the availability of this software. By using this software,
Helmut64 0:a3ea811f80f2 18 * you agree to the additional terms and conditions found by accessing the
Helmut64 0:a3ea811f80f2 19 * following link:
Helmut64 0:a3ea811f80f2 20 * http://www.renesas.com/disclaimer
Helmut64 0:a3ea811f80f2 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
Helmut64 0:a3ea811f80f2 22 *******************************************************************************/
Helmut64 0:a3ea811f80f2 23 /*******************************************************************************
Helmut64 0:a3ea811f80f2 24 * File Name : usb0_function_controlrw.c
Helmut64 0:a3ea811f80f2 25 * $Rev: 1116 $
Helmut64 0:a3ea811f80f2 26 * $Date:: 2014-07-09 16:29:19 +0900#$
Helmut64 0:a3ea811f80f2 27 * Device(s) : RZ/A1H
Helmut64 0:a3ea811f80f2 28 * Tool-Chain :
Helmut64 0:a3ea811f80f2 29 * OS : None
Helmut64 0:a3ea811f80f2 30 * H/W Platform :
Helmut64 0:a3ea811f80f2 31 * Description : RZ/A1H R7S72100 USB Sample Program
Helmut64 0:a3ea811f80f2 32 * Operation :
Helmut64 0:a3ea811f80f2 33 * Limitations :
Helmut64 0:a3ea811f80f2 34 *******************************************************************************/
Helmut64 0:a3ea811f80f2 35
Helmut64 0:a3ea811f80f2 36
Helmut64 0:a3ea811f80f2 37 /*******************************************************************************
Helmut64 0:a3ea811f80f2 38 Includes <System Includes> , "Project Includes"
Helmut64 0:a3ea811f80f2 39 *******************************************************************************/
Helmut64 0:a3ea811f80f2 40 #include "usb0_function.h"
Helmut64 0:a3ea811f80f2 41
Helmut64 0:a3ea811f80f2 42
Helmut64 0:a3ea811f80f2 43 /*******************************************************************************
Helmut64 0:a3ea811f80f2 44 Typedef definitions
Helmut64 0:a3ea811f80f2 45 *******************************************************************************/
Helmut64 0:a3ea811f80f2 46
Helmut64 0:a3ea811f80f2 47
Helmut64 0:a3ea811f80f2 48 /*******************************************************************************
Helmut64 0:a3ea811f80f2 49 Macro definitions
Helmut64 0:a3ea811f80f2 50 *******************************************************************************/
Helmut64 0:a3ea811f80f2 51
Helmut64 0:a3ea811f80f2 52
Helmut64 0:a3ea811f80f2 53 /*******************************************************************************
Helmut64 0:a3ea811f80f2 54 Imported global variables and functions (from other files)
Helmut64 0:a3ea811f80f2 55 *******************************************************************************/
Helmut64 0:a3ea811f80f2 56
Helmut64 0:a3ea811f80f2 57
Helmut64 0:a3ea811f80f2 58 /*******************************************************************************
Helmut64 0:a3ea811f80f2 59 Exported global variables and functions (to be accessed by other files)
Helmut64 0:a3ea811f80f2 60 *******************************************************************************/
Helmut64 0:a3ea811f80f2 61
Helmut64 0:a3ea811f80f2 62
Helmut64 0:a3ea811f80f2 63 /*******************************************************************************
Helmut64 0:a3ea811f80f2 64 Private global variables and functions
Helmut64 0:a3ea811f80f2 65 *******************************************************************************/
Helmut64 0:a3ea811f80f2 66
Helmut64 0:a3ea811f80f2 67
Helmut64 0:a3ea811f80f2 68 /*******************************************************************************
Helmut64 0:a3ea811f80f2 69 * Function Name: usb0_api_function_CtrlReadStart
Helmut64 0:a3ea811f80f2 70 * Description : Executes the USB control read transfer.
Helmut64 0:a3ea811f80f2 71 * : USB host controller <- USB device
Helmut64 0:a3ea811f80f2 72 * Arguments : uint16_t size ; Data Size
Helmut64 0:a3ea811f80f2 73 * : uint8_t *data ; Data Address
Helmut64 0:a3ea811f80f2 74 * Return Value : DEVDRV_USBF_WRITEEND ; End of data write
Helmut64 0:a3ea811f80f2 75 * : DEVDRV_USBF_WRITESHRT ; End of short data write
Helmut64 0:a3ea811f80f2 76 * : DEVDRV_USBF_WRITING ; Continue of data write
Helmut64 0:a3ea811f80f2 77 * : DEVDRV_USBF_FIFOERROR ; FIFO access error
Helmut64 0:a3ea811f80f2 78 *******************************************************************************/
Helmut64 0:a3ea811f80f2 79 uint16_t usb0_api_function_CtrlReadStart (uint32_t size, uint8_t * data)
Helmut64 0:a3ea811f80f2 80 {
Helmut64 0:a3ea811f80f2 81 uint16_t status;
Helmut64 0:a3ea811f80f2 82 uint16_t mbw;
Helmut64 0:a3ea811f80f2 83
Helmut64 0:a3ea811f80f2 84 usb0_function_set_pid_nak(USB_FUNCTION_PIPE0);
Helmut64 0:a3ea811f80f2 85
Helmut64 0:a3ea811f80f2 86 g_usb0_function_data_count[USB_FUNCTION_PIPE0] = size;
Helmut64 0:a3ea811f80f2 87 g_usb0_function_data_pointer[USB_FUNCTION_PIPE0] = data;
Helmut64 0:a3ea811f80f2 88
Helmut64 0:a3ea811f80f2 89 mbw = usb0_function_get_mbw(g_usb0_function_data_count[USB_FUNCTION_PIPE0],
Helmut64 0:a3ea811f80f2 90 (uint32_t)g_usb0_function_data_pointer[USB_FUNCTION_PIPE0]);
Helmut64 0:a3ea811f80f2 91 usb0_function_set_curpipe(USB_FUNCTION_PIPE0, USB_FUNCTION_CUSE, USB_FUNCTION_CFIFO_WRITE, mbw);
Helmut64 0:a3ea811f80f2 92 USB200.CFIFOCTR = USB_FUNCTION_BITBCLR;
Helmut64 0:a3ea811f80f2 93
Helmut64 0:a3ea811f80f2 94 status = usb0_function_write_buffer_c(USB_FUNCTION_PIPE0);
Helmut64 0:a3ea811f80f2 95
Helmut64 0:a3ea811f80f2 96 /* Peripheral Control sequence */
Helmut64 0:a3ea811f80f2 97 switch (status)
Helmut64 0:a3ea811f80f2 98 {
Helmut64 0:a3ea811f80f2 99 case DEVDRV_USBF_WRITESHRT: /* End of data write */
Helmut64 0:a3ea811f80f2 100 case DEVDRV_USBF_WRITEEND: /* End of data write (not null) */
Helmut64 0:a3ea811f80f2 101 case DEVDRV_USBF_WRITING: /* Continue of data write */
Helmut64 0:a3ea811f80f2 102 usb0_function_enable_bemp_int(USB_FUNCTION_PIPE0); /* Enable Empty Interrupt */
Helmut64 0:a3ea811f80f2 103 usb0_function_set_pid_buf(USB_FUNCTION_PIPE0); /* Set BUF */
Helmut64 0:a3ea811f80f2 104 break;
Helmut64 0:a3ea811f80f2 105
Helmut64 0:a3ea811f80f2 106 case DEVDRV_USBF_FIFOERROR: /* FIFO access error */
Helmut64 0:a3ea811f80f2 107 break;
Helmut64 0:a3ea811f80f2 108
Helmut64 0:a3ea811f80f2 109 default:
Helmut64 0:a3ea811f80f2 110 break;
Helmut64 0:a3ea811f80f2 111 }
Helmut64 0:a3ea811f80f2 112
Helmut64 0:a3ea811f80f2 113 return status; /* End or Err or Continue */
Helmut64 0:a3ea811f80f2 114 }
Helmut64 0:a3ea811f80f2 115
Helmut64 0:a3ea811f80f2 116 /*******************************************************************************
Helmut64 0:a3ea811f80f2 117 * Function Name: usb0_api_function_CtrlWriteStart
Helmut64 0:a3ea811f80f2 118 * Description : Executes the USB control write transfer.
Helmut64 0:a3ea811f80f2 119 * : USB host controller -> USB device
Helmut64 0:a3ea811f80f2 120 * Arguments : uint16_t size ; Data Size
Helmut64 0:a3ea811f80f2 121 * : uint8_t *data ; Data Address
Helmut64 0:a3ea811f80f2 122 * Return Value : none
Helmut64 0:a3ea811f80f2 123 *******************************************************************************/
Helmut64 0:a3ea811f80f2 124 void usb0_api_function_CtrlWriteStart (uint32_t size, uint8_t * data)
Helmut64 0:a3ea811f80f2 125 {
Helmut64 0:a3ea811f80f2 126 uint16_t mbw;
Helmut64 0:a3ea811f80f2 127
Helmut64 0:a3ea811f80f2 128 usb0_function_set_pid_nak(USB_FUNCTION_PIPE0);
Helmut64 0:a3ea811f80f2 129
Helmut64 0:a3ea811f80f2 130 g_usb0_function_data_count[USB_FUNCTION_PIPE0] = size;
Helmut64 0:a3ea811f80f2 131 g_usb0_function_data_pointer[USB_FUNCTION_PIPE0] = data;
Helmut64 0:a3ea811f80f2 132
Helmut64 0:a3ea811f80f2 133 mbw = usb0_function_get_mbw(g_usb0_function_data_count[USB_FUNCTION_PIPE0],
Helmut64 0:a3ea811f80f2 134 (uint32_t)g_usb0_function_data_pointer[USB_FUNCTION_PIPE0]);
Helmut64 0:a3ea811f80f2 135 usb0_function_set_curpipe(USB_FUNCTION_PIPE0, USB_FUNCTION_CUSE, USB_FUNCTION_CFIFO_WRITE, mbw);
Helmut64 0:a3ea811f80f2 136 USB200.CFIFOCTR = USB_FUNCTION_BITBCLR;
Helmut64 0:a3ea811f80f2 137
Helmut64 0:a3ea811f80f2 138 usb0_function_enable_brdy_int(USB_FUNCTION_PIPE0);
Helmut64 0:a3ea811f80f2 139 usb0_function_set_pid_buf(USB_FUNCTION_PIPE0);
Helmut64 0:a3ea811f80f2 140 }
Helmut64 0:a3ea811f80f2 141
Helmut64 0:a3ea811f80f2 142 /* End of File */