diff options
Diffstat (limited to 'src/jtag/drivers/OpenULINK/include')
-rw-r--r-- | src/jtag/drivers/OpenULINK/include/delay.h | 6 | ||||
-rw-r--r-- | src/jtag/drivers/OpenULINK/include/jtag.h | 30 | ||||
-rw-r--r-- | src/jtag/drivers/OpenULINK/include/protocol.h | 1 | ||||
-rw-r--r-- | src/jtag/drivers/OpenULINK/include/shorttypes.h | 41 | ||||
-rw-r--r-- | src/jtag/drivers/OpenULINK/include/usb.h | 108 |
5 files changed, 72 insertions, 114 deletions
diff --git a/src/jtag/drivers/OpenULINK/include/delay.h b/src/jtag/drivers/OpenULINK/include/delay.h index 3dfaf352..5c36b1d9 100644 --- a/src/jtag/drivers/OpenULINK/include/delay.h +++ b/src/jtag/drivers/OpenULINK/include/delay.h @@ -21,14 +21,14 @@ #ifndef __DELAY_H #define __DELAY_H -#include "shorttypes.h" +#include <stdint.h> #define NOP {__asm nop __endasm;} void delay_5us(void); void delay_1ms(void); -void delay_us(u16 delay); -void delay_ms(u16 delay); +void delay_us(uint16_t delay); +void delay_ms(uint16_t delay); #endif diff --git a/src/jtag/drivers/OpenULINK/include/jtag.h b/src/jtag/drivers/OpenULINK/include/jtag.h index cef5f426..ca866716 100644 --- a/src/jtag/drivers/OpenULINK/include/jtag.h +++ b/src/jtag/drivers/OpenULINK/include/jtag.h @@ -21,28 +21,28 @@ #ifndef __JTAG_H #define __JTAG_H -#include "shorttypes.h" +#include <stdint.h> #define NOP {__asm nop __endasm;} -void jtag_scan_in(u8 out_offset, u8 in_offset); -void jtag_slow_scan_in(u8 out_offset, u8 in_offset); +void jtag_scan_in(uint8_t out_offset, uint8_t in_offset); +void jtag_slow_scan_in(uint8_t out_offset, uint8_t in_offset); -void jtag_scan_out(u8 out_offset); -void jtag_slow_scan_out(u8 out_offset); +void jtag_scan_out(uint8_t out_offset); +void jtag_slow_scan_out(uint8_t out_offset); -void jtag_scan_io(u8 out_offset, u8 in_offset); -void jtag_slow_scan_io(u8 out_offset, u8 in_offset); +void jtag_scan_io(uint8_t out_offset, uint8_t in_offset); +void jtag_slow_scan_io(uint8_t out_offset, uint8_t in_offset); -void jtag_clock_tck(u16 count); -void jtag_slow_clock_tck(u16 count); -void jtag_clock_tms(u8 count, u8 sequence); -void jtag_slow_clock_tms(u8 count, u8 sequence); +void jtag_clock_tck(uint16_t count); +void jtag_slow_clock_tck(uint16_t count); +void jtag_clock_tms(uint8_t count, uint8_t sequence); +void jtag_slow_clock_tms(uint8_t count, uint8_t sequence); -u16 jtag_get_signals(void); -void jtag_set_signals(u8 low, u8 high); +uint16_t jtag_get_signals(void); +void jtag_set_signals(uint8_t low, uint8_t high); -void jtag_configure_tck_delay(u8 scan_in, u8 scan_out, u8 scan_io, u8 tck, - u8 tms); +void jtag_configure_tck_delay(uint8_t scan_in, uint8_t scan_out, + uint8_t scan_io, uint8_t tck, uint8_t tms); #endif diff --git a/src/jtag/drivers/OpenULINK/include/protocol.h b/src/jtag/drivers/OpenULINK/include/protocol.h index 2129fc84..49e881cd 100644 --- a/src/jtag/drivers/OpenULINK/include/protocol.h +++ b/src/jtag/drivers/OpenULINK/include/protocol.h @@ -21,7 +21,6 @@ #ifndef __PROTOCOL_H #define __PROTOCOL_H -#include "shorttypes.h" #include "common.h" #include <stdbool.h> diff --git a/src/jtag/drivers/OpenULINK/include/shorttypes.h b/src/jtag/drivers/OpenULINK/include/shorttypes.h deleted file mode 100644 index 60b37df3..00000000 --- a/src/jtag/drivers/OpenULINK/include/shorttypes.h +++ /dev/null @@ -1,41 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2011 by Martin Schmoelzer * - * <martin.schmoelzer@student.tuwien.ac.at> * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef __SHORTTYPES_H -#define __SHORTTYPES_H - -#include <stdint.h> - -/** - * @file Integer type definitions for shorter code (easier to stay within 80 - * character maximum line length). - */ - -/* Signed integers */ -typedef int8_t s8; -typedef int16_t s16; -typedef int32_t s32; - -/* Unsigned integers */ -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; - -#endif diff --git a/src/jtag/drivers/OpenULINK/include/usb.h b/src/jtag/drivers/OpenULINK/include/usb.h index a507c9e4..811d6bf1 100644 --- a/src/jtag/drivers/OpenULINK/include/usb.h +++ b/src/jtag/drivers/OpenULINK/include/usb.h @@ -21,16 +21,16 @@ #ifndef __USB_H #define __USB_H -#include "shorttypes.h" #include "reg_ezusb.h" +#include <stdint.h> #include <stdbool.h> #define NULL (void*)0; -/* High and Low byte of a word (u16) */ -#define HI8(word) (u8)(((u16)word >> 8) & 0xff) -#define LO8(word) (u8)((u16)word & 0xff) +/* High and Low byte of a word (uint16_t) */ +#define HI8(word) (uint8_t)(((uint16_t)word >> 8) & 0xff) +#define LO8(word) (uint8_t)((uint16_t)word & 0xff) /* Convenience functions */ #define STALL_EP0() EP0CS |= EP0STALL @@ -49,80 +49,80 @@ /** USB Device Descriptor. See USB 1.1 spec, pp. 196 - 198 */ struct usb_device_descriptor { - u8 bLength; ///< Size of this descriptor in bytes. - u8 bDescriptorType; ///< DEVICE Descriptor Type. - u16 bcdUSB; ///< USB specification release number (BCD). - u8 bDeviceClass; ///< Class code. - u8 bDeviceSubClass; ///< Subclass code. - u8 bDeviceProtocol; ///< Protocol code. - u8 bMaxPacketSize0; ///< Maximum packet size for EP0 (8, 16, 32, 64). - u16 idVendor; ///< USB Vendor ID. - u16 idProduct; ///< USB Product ID. - u16 bcdDevice; ///< Device Release Number (BCD). - u8 iManufacturer; ///< Index of manufacturer string descriptor. - u8 iProduct; ///< Index of product string descriptor. - u8 iSerialNumber; ///< Index of string descriptor containing serial #. - u8 bNumConfigurations; ///< Number of possible configurations. + uint8_t bLength; ///< Size of this descriptor in bytes. + uint8_t bDescriptorType; ///< DEVICE Descriptor Type. + uint16_t bcdUSB; ///< USB specification release number (BCD). + uint8_t bDeviceClass; ///< Class code. + uint8_t bDeviceSubClass; ///< Subclass code. + uint8_t bDeviceProtocol; ///< Protocol code. + uint8_t bMaxPacketSize0; ///< Maximum packet size for EP0 (8, 16, 32, 64). + uint16_t idVendor; ///< USB Vendor ID. + uint16_t idProduct; ///< USB Product ID. + uint16_t bcdDevice; ///< Device Release Number (BCD). + uint8_t iManufacturer; ///< Index of manufacturer string descriptor. + uint8_t iProduct; ///< Index of product string descriptor. + uint8_t iSerialNumber; ///< Index of string descriptor containing serial #. + uint8_t bNumConfigurations; ///< Number of possible configurations. }; /** USB Configuration Descriptor. See USB 1.1 spec, pp. 199 - 200 */ struct usb_config_descriptor { - u8 bLength; ///< Size of this descriptor in bytes. - u8 bDescriptorType; ///< CONFIGURATION descriptor type. - u16 wTotalLength; ///< Combined total length of all descriptors. - u8 bNumInterfaces; ///< Number of interfaces in this configuration. - u8 bConfigurationValue; ///< Value used to select this configuration. - u8 iConfiguration; ///< Index of configuration string descriptor. - u8 bmAttributes; ///< Configuration characteristics. - u8 MaxPower; ///< Maximum power consumption in 2 mA units. + uint8_t bLength; ///< Size of this descriptor in bytes. + uint8_t bDescriptorType; ///< CONFIGURATION descriptor type. + uint16_t wTotalLength; ///< Combined total length of all descriptors. + uint8_t bNumInterfaces; ///< Number of interfaces in this configuration. + uint8_t bConfigurationValue;///< Value used to select this configuration. + uint8_t iConfiguration; ///< Index of configuration string descriptor. + uint8_t bmAttributes; ///< Configuration characteristics. + uint8_t MaxPower; ///< Maximum power consumption in 2 mA units. }; /** USB Interface Descriptor. See USB 1.1 spec, pp. 201 - 203 */ struct usb_interface_descriptor { - u8 bLength; ///< Size of this descriptor in bytes. - u8 bDescriptorType; ///< INTERFACE descriptor type. - u8 bInterfaceNumber; ///< Interface number. - u8 bAlternateSetting; ///< Value used to select alternate setting. - u8 bNumEndpoints; ///< Number of endpoints used by this interface. - u8 bInterfaceClass; ///< Class code. - u8 bInterfaceSubclass; ///< Subclass code. - u8 bInterfaceProtocol; ///< Protocol code. - u8 iInterface; ///< Index of interface string descriptor. + uint8_t bLength; ///< Size of this descriptor in bytes. + uint8_t bDescriptorType; ///< INTERFACE descriptor type. + uint8_t bInterfaceNumber; ///< Interface number. + uint8_t bAlternateSetting; ///< Value used to select alternate setting. + uint8_t bNumEndpoints; ///< Number of endpoints used by this interface. + uint8_t bInterfaceClass; ///< Class code. + uint8_t bInterfaceSubclass; ///< Subclass code. + uint8_t bInterfaceProtocol; ///< Protocol code. + uint8_t iInterface; ///< Index of interface string descriptor. }; /** USB Endpoint Descriptor. See USB 1.1 spec, pp. 203 - 204 */ struct usb_endpoint_descriptor { - u8 bLength; ///< Size of this descriptor in bytes. - u8 bDescriptorType; ///< ENDPOINT descriptor type. - u8 bEndpointAddress; ///< Endpoint Address: USB 1.1 spec, table 9-10. - u8 bmAttributes; ///< Endpoint Attributes: USB 1.1 spec, table 9-10. - u16 wMaxPacketSize; ///< Maximum packet size for this endpoint. - u8 bInterval; ///< Polling interval (in ms) for this endpoint. + uint8_t bLength; ///< Size of this descriptor in bytes. + uint8_t bDescriptorType; ///< ENDPOINT descriptor type. + uint8_t bEndpointAddress; ///< Endpoint Address: USB 1.1 spec, table 9-10. + uint8_t bmAttributes; ///< Endpoint Attributes: USB 1.1 spec, table 9-10. + uint16_t wMaxPacketSize; ///< Maximum packet size for this endpoint. + uint8_t bInterval; ///< Polling interval (in ms) for this endpoint. }; /** USB Language Descriptor. See USB 1.1 spec, pp. 204 - 205 */ struct usb_language_descriptor { - u8 bLength; ///< Size of this descriptor in bytes. - u8 bDescriptorType; ///< STRING descriptor type. - u16 wLANGID[]; ///< LANGID codes. + uint8_t bLength; ///< Size of this descriptor in bytes. + uint8_t bDescriptorType; ///< STRING descriptor type. + uint16_t wLANGID[]; ///< LANGID codes. }; /** USB String Descriptor. See USB 1.1 spec, pp. 204 - 205 */ struct usb_string_descriptor { - u8 bLength; ///< Size of this descriptor in bytes. - u8 bDescriptorType; ///< STRING descriptor type. - u16 bString[]; ///< UNICODE encoded string. + uint8_t bLength; ///< Size of this descriptor in bytes. + uint8_t bDescriptorType; ///< STRING descriptor type. + uint16_t bString[]; ///< UNICODE encoded string. }; /********************** USB Control Endpoint 0 related *********************/ /** USB Control Setup Data. See USB 1.1 spec, pp. 183 - 185 */ struct setup_data { - u8 bmRequestType; ///< Characteristics of a request. - u8 bRequest; ///< Specific request. - u16 wValue; ///< Field that varies according to request. - u16 wIndex; ///< Field that varies according to request. - u16 wLength; ///< Number of bytes to transfer in data stage. + uint8_t bmRequestType; ///< Characteristics of a request. + uint8_t bRequest; ///< Specific request. + uint16_t wValue; ///< Field that varies according to request. + uint16_t wIndex; ///< Field that varies according to request. + uint16_t wLength; ///< Number of bytes to transfer in data stage. }; /* External declarations for variables that need to be accessed outside of @@ -252,8 +252,8 @@ enum usb_isr { /*************************** Function Prototypes ***************************/ -__xdata u8* usb_get_endpoint_cs_reg(u8 ep); -void usb_reset_data_toggle(u8 ep); +__xdata uint8_t* usb_get_endpoint_cs_reg(uint8_t ep); +void usb_reset_data_toggle(uint8_t ep); bool usb_handle_get_status(void); bool usb_handle_clear_feature(void); |