firmware  v0.1.2
Chromation Spectrometer Dev-Kit
Usb-HardwareFake.h
1 #ifndef _USB_HARDWAREFAKE_H
2 #define _USB_HARDWAREFAKE_H
3 #include <stdint.h>
4 #include "Usb.h"
5 // ---Fake hardware registers as PC memory for unit tests---
6 static uint8_t volatile fake_FtCtrl_port;
7 static uint8_t volatile fake_FtCtrl_pin;
8 static uint8_t volatile fake_FtData_pin;
9 static uint8_t volatile fake_FtData_ddr;
10 static uint8_t volatile fake_FtData_port;
11 // ---Registers---
12 // control lines
13 usb_reg FtCtrl_port = &fake_FtCtrl_port;
14 usb_reg FtCtrl_pin = &fake_FtCtrl_pin;
15 // bi-directional data lines (driven by both master and slave)
16 usb_reg FtData_pin = &fake_FtData_pin;
17 usb_reg FtData_ddr = &fake_FtData_ddr;
18 usb_reg FtData_port = &fake_FtData_port;
19 // ---Pins---
20 // control lines
21 usb_pin FtMiso = 2; // input: !RxbufferEmpty signal
22 usb_pin FtChipSelect = 0; // output: activate interface
23 usb_pin FtClock = 1; // output: clock edges signal drive/sample data on bus
24 // bi-directional data lines (driven by both master and slave)
25 usb_pin FtMiosio0 = 0; // data bus bit 0
26 #endif // _USB_HARDWAREFAKE_H
27 
28 
usb-bridge communicates over USB via FTDI USB Bridge IC FT221X