Mike Moore / Mbed 2 deprecated USB_device_project

Dependencies:   C12832_lcd USBDevice mbed-rtos mbed mmSPI

Committer:
gatedClock
Date:
Sun Sep 01 02:53:39 2013 +0000
Revision:
3:659ffc90b59e
Child:
7:d1aca9ccbab8
add the project RTL files.  the tab-formatting needs to be redone.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gatedClock 3:659ffc90b59e 1 /*----------------------------------copyright---------------------------------*/
gatedClock 3:659ffc90b59e 2 // licensed for personal and academic use.
gatedClock 3:659ffc90b59e 3 // commercial use must be approved by the account-holder of
gatedClock 3:659ffc90b59e 4 // gated.clock@gmail.com
gatedClock 3:659ffc90b59e 5 /*-----------------------------------module-----------------------------------*/
gatedClock 3:659ffc90b59e 6 module scan_16 // shadow register.
gatedClock 3:659ffc90b59e 7 (
gatedClock 3:659ffc90b59e 8 oParallel, // parallel-output data.
gatedClock 3:659ffc90b59e 9 iParallel, // parallel-input data.
gatedClock 3:659ffc90b59e 10 oSerial, // serial-output data.
gatedClock 3:659ffc90b59e 11 iSerial, // serial-input data.
gatedClock 3:659ffc90b59e 12 iLoadEnable, // parallel-load-enable.
gatedClock 3:659ffc90b59e 13 iShiftEnable, // serial-shift-enable.
gatedClock 3:659ffc90b59e 14 iResetN, // synchronous reset*.
gatedClock 3:659ffc90b59e 15 iClk // module clock.
gatedClock 3:659ffc90b59e 16 );
gatedClock 3:659ffc90b59e 17 /*--------------------------------description-----------------------------------
gatedClock 3:659ffc90b59e 18 a 16-bit parallel shift-register.
gatedClock 3:659ffc90b59e 19 -------------------------------------notes--------------------------------------
gatedClock 3:659ffc90b59e 20 shifting is LSB->MSB.
gatedClock 3:659ffc90b59e 21 ------------------------------------defines-----------------------------------*/
gatedClock 3:659ffc90b59e 22 /*-----------------------------------ports------------------------------------*/
gatedClock 3:659ffc90b59e 23 output [15:0] oParallel; // parallel-output data.
gatedClock 3:659ffc90b59e 24 input [15:0] iParallel; // parallel-input data.
gatedClock 3:659ffc90b59e 25 output oSerial; // serial-output data.
gatedClock 3:659ffc90b59e 26 input iSerial; // serial-input data.
gatedClock 3:659ffc90b59e 27 input iLoadEnable; // parallel-load-enable.
gatedClock 3:659ffc90b59e 28 input iShiftEnable; // serial-shift-enable.
gatedClock 3:659ffc90b59e 29 input iResetN; // synchronous reset*.
gatedClock 3:659ffc90b59e 30 input iClk; // module clock.
gatedClock 3:659ffc90b59e 31 /*-----------------------------------wires------------------------------------*/
gatedClock 3:659ffc90b59e 32 wire [15:0] oParallel; // parallel-output data.
gatedClock 3:659ffc90b59e 33 wire [15:0] iParallel; // parallel-input data.
gatedClock 3:659ffc90b59e 34 wire [15:0] wParallelIn; // select the parallel input.
gatedClock 3:659ffc90b59e 35 wire oSerial; // serial-output data.
gatedClock 3:659ffc90b59e 36 wire iSerial; // serial-input data.
gatedClock 3:659ffc90b59e 37 wire iLoadEnable; // parallel-load-enable.
gatedClock 3:659ffc90b59e 38 wire iShiftEnable; // serial-shift-enable.
gatedClock 3:659ffc90b59e 39 wire iResetN; // synchronous reset*.
gatedClock 3:659ffc90b59e 40 wire iClk; // module clock.
gatedClock 3:659ffc90b59e 41 /*---------------------------------registers----------------------------------*/
gatedClock 3:659ffc90b59e 42 reg [15:0] rRegister; // the register.
gatedClock 3:659ffc90b59e 43 /*---------------------------------variables----------------------------------*/
gatedClock 3:659ffc90b59e 44 /*---------------------------------parameters---------------------------------*/
gatedClock 3:659ffc90b59e 45 /*-----------------------------------clocks-----------------------------------*/
gatedClock 3:659ffc90b59e 46 /*---------------------------------instances----------------------------------*/
gatedClock 3:659ffc90b59e 47 /*-----------------------------------logic------------------------------------*/
gatedClock 3:659ffc90b59e 48 always @ (posedge iClk or negedge iResetN)
gatedClock 3:659ffc90b59e 49 begin
gatedClock 3:659ffc90b59e 50 if (!iResetN) rRegister[15:0] <= 16'h0000;
gatedClock 3:659ffc90b59e 51 else if (iLoadEnable) rRegister[15:0] <= iParallel[15:0];
gatedClock 3:659ffc90b59e 52 else if (iShiftEnable) rRegister[15:0] <= {rRegister[14:0], iSerial};
gatedClock 3:659ffc90b59e 53 else rRegister[15:0] <= rRegister[15:0];
gatedClock 3:659ffc90b59e 54 end
gatedClock 3:659ffc90b59e 55
gatedClock 3:659ffc90b59e 56 assign oParallel[15:0] = rRegister[15:0]; // propagate parallel-out.
gatedClock 3:659ffc90b59e 57 assign oSerial = rRegister[15]; // propagate serial-out.
gatedClock 3:659ffc90b59e 58 /*-------------------------------*/endmodule/*--------------------------------*/
gatedClock 3:659ffc90b59e 59
gatedClock 3:659ffc90b59e 60
gatedClock 3:659ffc90b59e 61
gatedClock 3:659ffc90b59e 62
gatedClock 3:659ffc90b59e 63
gatedClock 3:659ffc90b59e 64
gatedClock 3:659ffc90b59e 65
gatedClock 3:659ffc90b59e 66
gatedClock 3:659ffc90b59e 67
gatedClock 3:659ffc90b59e 68
gatedClock 3:659ffc90b59e 69
gatedClock 3:659ffc90b59e 70
gatedClock 3:659ffc90b59e 71
gatedClock 3:659ffc90b59e 72
gatedClock 3:659ffc90b59e 73
gatedClock 3:659ffc90b59e 74