#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "libusb.h"
#include "commands.h"
Defines | |
#define | OSBDM_VID (0x15A2) |
OSBDM Vendor ID. | |
#define | OSBDM_PID (0x0021) |
OSBDM Product ID. | |
#define | TBDML_VID (0x0425) |
TBDML Vendor ID. | |
#define | TBDML_PID (0x1000) |
TBDML Product ID. | |
#define | EP_OUT (0x02) |
#define | EP_IN (0x82) |
#define | TIMEOUT (500) |
Timeouts for BDM communications. | |
#define | BUF_SIZE (5) |
Typedefs | |
typedef unsigned char | U8 |
typedef unsigned short | U16 |
typedef unsigned int | U32 |
Functions | |
usb_dev_handle * | open_dev (void) |
unsigned char | bdm_usb_recv_ep0 (usb_dev_handle *usb_devh, U8 *data) |
unsigned char | bdm_usb_send_ep0 (usb_dev_handle *usb_devh, U8 *data) |
usb_dev_handle * | OSBDMConnect (void) |
int | OSBDMReportVersion (usb_dev_handle *usb_devh) |
int | OSBDMSetBoot (usb_dev_handle *usb_devh) |
int | main (void) |
Variables | |
usb_dev_handle * | dev |
USB device handle. |
#define BUF_SIZE (5) |
#define EP_IN (0x82) |
#define EP_OUT (0x02) |
#define OSBDM_PID (0x0021) |
OSBDM Product ID.
#define OSBDM_VID (0x15A2) |
OSBDM Vendor ID.
#define TBDML_PID (0x1000) |
TBDML Product ID.
#define TBDML_VID (0x0425) |
TBDML Vendor ID.
#define TIMEOUT (500) |
Timeouts for BDM communications.
typedef unsigned short U16 |
typedef unsigned int U32 |
typedef unsigned char U8 |
unsigned char bdm_usb_recv_ep0 | ( | usb_dev_handle * | usb_devh, | |
U8 * | data | |||
) |
Sends a message of up to 5 bytes to the TBDML/OSBDM device over EP0. An immediate response is expected
usb_devh | - device handle previous obtained from open_dev() | |
data | - in/out buffer for transfer |
Exit:
unsigned char bdm_usb_send_ep0 | ( | usb_dev_handle * | usb_devh, | |
U8 * | data | |||
) |
Sends a message of up to 5 bytes to the TBDML/OSBDM device over EP0. An immediate response is expected
usb_devh | - device handle previous obtained from open_dev() | |
data | - buffer for transfer |
int main | ( | void | ) |
usb_dev_handle* open_dev | ( | void | ) |
Opens a BDM device
usb_dev_handle* OSBDMConnect | ( | void | ) |
Connect to the BDM device
int OSBDMReportVersion | ( | usb_dev_handle * | usb_devh | ) |
Check & Report Firmware/Hardware version numbers
2. August 08 release (JB16 only)
Version response [6 bytes]
3. September 08 release (JB16 & JMxx)
Version response [5 bytes]
int OSBDMSetBoot | ( | usb_dev_handle * | usb_devh | ) |
Set for flash load on next reboot
USB device handle.