This package contains a simple test of tests for various elements of the SmartBoard hardware, which is a simple baseboard designed for easy embedding. It is able to run both a semi-automatic test suite as well as allow interactive testing.
Dependencies: EthernetNetIf NTPClient_NetServices mbed
This program is most of what you need to test your SmartBoard baseboard hardware. It provides a means to test the following:
- Two channels of CAN (with a loopback cable)
- RS-232 Ports
- Analog inputs
- PWM outputs
- Ethernet port
- Real time clock
- micro SD
- USB Host port
USBHostLite/usbhost_ms.h@5:42b456ce6f71, 2011-04-04 (annotated)
- Committer:
- WiredHome
- Date:
- Mon Apr 04 11:33:23 2011 +0000
- Revision:
- 5:42b456ce6f71
- Parent:
- 4:ca93a8d4874d
Several minor updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WiredHome | 4:ca93a8d4874d | 1 | /* |
WiredHome | 4:ca93a8d4874d | 2 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 3 | * NXP USB Host Stack |
WiredHome | 4:ca93a8d4874d | 4 | * |
WiredHome | 4:ca93a8d4874d | 5 | * (c) Copyright 2008, NXP SemiConductors |
WiredHome | 4:ca93a8d4874d | 6 | * (c) Copyright 2008, OnChip Technologies LLC |
WiredHome | 4:ca93a8d4874d | 7 | * All Rights Reserved |
WiredHome | 4:ca93a8d4874d | 8 | * |
WiredHome | 4:ca93a8d4874d | 9 | * www.nxp.com |
WiredHome | 4:ca93a8d4874d | 10 | * www.onchiptech.com |
WiredHome | 4:ca93a8d4874d | 11 | * |
WiredHome | 4:ca93a8d4874d | 12 | * File : usbhost_ms.h |
WiredHome | 4:ca93a8d4874d | 13 | * Programmer(s) : Ravikanth.P |
WiredHome | 4:ca93a8d4874d | 14 | * Version : |
WiredHome | 4:ca93a8d4874d | 15 | * |
WiredHome | 4:ca93a8d4874d | 16 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 17 | */ |
WiredHome | 4:ca93a8d4874d | 18 | |
WiredHome | 4:ca93a8d4874d | 19 | #ifndef USBHOST_MS_H |
WiredHome | 4:ca93a8d4874d | 20 | #define USBHOST_MS_H |
WiredHome | 4:ca93a8d4874d | 21 | |
WiredHome | 4:ca93a8d4874d | 22 | /* |
WiredHome | 4:ca93a8d4874d | 23 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 24 | * INCLUDE HEADER FILES |
WiredHome | 4:ca93a8d4874d | 25 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 26 | */ |
WiredHome | 4:ca93a8d4874d | 27 | |
WiredHome | 4:ca93a8d4874d | 28 | #include "usbhost_inc.h" |
WiredHome | 4:ca93a8d4874d | 29 | |
WiredHome | 4:ca93a8d4874d | 30 | /* |
WiredHome | 4:ca93a8d4874d | 31 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 32 | * MASS STORAGE SPECIFIC DEFINITIONS |
WiredHome | 4:ca93a8d4874d | 33 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 34 | */ |
WiredHome | 4:ca93a8d4874d | 35 | |
WiredHome | 4:ca93a8d4874d | 36 | #define MS_GET_MAX_LUN_REQ 0xFE |
WiredHome | 4:ca93a8d4874d | 37 | #define MASS_STORAGE_CLASS 0x08 |
WiredHome | 4:ca93a8d4874d | 38 | #define MASS_STORAGE_SUBCLASS_SCSI 0x06 |
WiredHome | 4:ca93a8d4874d | 39 | #define MASS_STORAGE_PROTOCOL_BO 0x50 |
WiredHome | 4:ca93a8d4874d | 40 | |
WiredHome | 4:ca93a8d4874d | 41 | #define INQUIRY_LENGTH 36 |
WiredHome | 4:ca93a8d4874d | 42 | /* |
WiredHome | 4:ca93a8d4874d | 43 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 44 | * SCSI SPECIFIC DEFINITIONS |
WiredHome | 4:ca93a8d4874d | 45 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 46 | */ |
WiredHome | 4:ca93a8d4874d | 47 | |
WiredHome | 4:ca93a8d4874d | 48 | #define CBW_SIGNATURE 0x43425355 |
WiredHome | 4:ca93a8d4874d | 49 | #define CSW_SIGNATURE 0x53425355 |
WiredHome | 4:ca93a8d4874d | 50 | #define CBW_SIZE 31 |
WiredHome | 4:ca93a8d4874d | 51 | #define CSW_SIZE 13 |
WiredHome | 4:ca93a8d4874d | 52 | #define CSW_CMD_PASSED 0x00 |
WiredHome | 4:ca93a8d4874d | 53 | #define SCSI_CMD_REQUEST_SENSE 0x03 |
WiredHome | 4:ca93a8d4874d | 54 | #define SCSI_CMD_TEST_UNIT_READY 0x00 |
WiredHome | 4:ca93a8d4874d | 55 | #define SCSI_CMD_INQUIRY 0x12 |
WiredHome | 4:ca93a8d4874d | 56 | #define SCSI_CMD_READ_10 0x28 |
WiredHome | 4:ca93a8d4874d | 57 | #define SCSI_CMD_READ_CAPACITY 0x25 |
WiredHome | 4:ca93a8d4874d | 58 | #define SCSI_CMD_WRITE_10 0x2A |
WiredHome | 4:ca93a8d4874d | 59 | |
WiredHome | 4:ca93a8d4874d | 60 | /* |
WiredHome | 4:ca93a8d4874d | 61 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 62 | * TYPE DEFINITIONS |
WiredHome | 4:ca93a8d4874d | 63 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 64 | */ |
WiredHome | 4:ca93a8d4874d | 65 | |
WiredHome | 4:ca93a8d4874d | 66 | typedef enum ms_data_dir { |
WiredHome | 4:ca93a8d4874d | 67 | |
WiredHome | 4:ca93a8d4874d | 68 | MS_DATA_DIR_IN = 0x80, |
WiredHome | 4:ca93a8d4874d | 69 | MS_DATA_DIR_OUT = 0x00, |
WiredHome | 4:ca93a8d4874d | 70 | MS_DATA_DIR_NONE = 0x01 |
WiredHome | 4:ca93a8d4874d | 71 | |
WiredHome | 4:ca93a8d4874d | 72 | } MS_DATA_DIR; |
WiredHome | 4:ca93a8d4874d | 73 | |
WiredHome | 4:ca93a8d4874d | 74 | /* |
WiredHome | 4:ca93a8d4874d | 75 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 76 | * FUNCTION PROTOTYPES |
WiredHome | 4:ca93a8d4874d | 77 | ************************************************************************************************************** |
WiredHome | 4:ca93a8d4874d | 78 | */ |
WiredHome | 4:ca93a8d4874d | 79 | |
WiredHome | 4:ca93a8d4874d | 80 | USB_INT32S MS_BulkRecv ( USB_INT32U block_number, |
WiredHome | 4:ca93a8d4874d | 81 | USB_INT16U num_blocks, |
WiredHome | 4:ca93a8d4874d | 82 | volatile USB_INT08U *user_buffer); |
WiredHome | 4:ca93a8d4874d | 83 | |
WiredHome | 4:ca93a8d4874d | 84 | USB_INT32S MS_BulkSend ( USB_INT32U block_number, |
WiredHome | 4:ca93a8d4874d | 85 | USB_INT16U num_blocks, |
WiredHome | 4:ca93a8d4874d | 86 | volatile USB_INT08U *user_buffer); |
WiredHome | 4:ca93a8d4874d | 87 | USB_INT32S MS_ParseConfiguration(void); |
WiredHome | 4:ca93a8d4874d | 88 | USB_INT32S MS_TestUnitReady (void); |
WiredHome | 4:ca93a8d4874d | 89 | USB_INT32S MS_ReadCapacity (USB_INT32U *numBlks, USB_INT32U *blkSize); |
WiredHome | 4:ca93a8d4874d | 90 | USB_INT32S MS_GetMaxLUN (void); |
WiredHome | 4:ca93a8d4874d | 91 | USB_INT32S MS_GetSenseInfo (void); |
WiredHome | 4:ca93a8d4874d | 92 | USB_INT32S MS_Init (USB_INT32U *blkSize, USB_INT32U *numBlks, USB_INT08U *inquiryResult); |
WiredHome | 4:ca93a8d4874d | 93 | USB_INT32S MS_Inquire (USB_INT08U *response); |
WiredHome | 4:ca93a8d4874d | 94 | |
WiredHome | 4:ca93a8d4874d | 95 | void Fill_MSCommand ( USB_INT32U block_number, |
WiredHome | 4:ca93a8d4874d | 96 | USB_INT32U block_size, |
WiredHome | 4:ca93a8d4874d | 97 | USB_INT16U num_blocks, |
WiredHome | 4:ca93a8d4874d | 98 | MS_DATA_DIR direction, |
WiredHome | 4:ca93a8d4874d | 99 | USB_INT08U scsi_cmd, |
WiredHome | 4:ca93a8d4874d | 100 | USB_INT08U scsi_cmd_len); |
WiredHome | 4:ca93a8d4874d | 101 | #endif |