house keeping
This commit is contained in:
		| @@ -59,6 +59,7 @@ void board_init(void) | ||||
|   scu_pinmux(0x2, 3, MD_PUP | MD_EZI, FUNC7);		// USB0 VBus Power | ||||
|    | ||||
|   // USB1 Power: EA4357 channel A U20 is enabled by SJ5 connected to pad 1-2, no more action required | ||||
|   // TODO Remove R170, R171, solder a pair of 15K to USB1 D+/D- to test with USB1 Host | ||||
|  | ||||
|   // TODO Device only USB0 | ||||
|   // 1.5Kohm pull-up resistor is needed on the USB DP data signal. GPIO28 (base), P9_5 (LPC4357) controls | ||||
| @@ -66,18 +67,11 @@ void board_init(void) | ||||
| //  GPIO_SetDir(5, BIT_(18), 1); // output | ||||
| //  GPIO_ClearValue(5, BIT_(18)); | ||||
|  | ||||
|  | ||||
|   //------------- I2C (required by LED) -------------// | ||||
|   // init I2C and set up MIC2555 to have 15k pull-down on USB1 D+ & D- | ||||
|   //------------- LED -------------// | ||||
|   I2C_Init(LPC_I2C0, 100000); | ||||
|   I2C_Cmd(LPC_I2C0, ENABLE); | ||||
|  | ||||
|   //------------- LED -------------// | ||||
|   pca9532_init(); | ||||
|  | ||||
| //  ASSERT_INT(0x058d, mic255_get_vendorid(), (void) 0); // verify vendor id | ||||
| //  ASSERT( mic255_regs_write(6, BIN8(1100)), (void) 0); // pull down D+/D- for host | ||||
|  | ||||
| #if CFG_UART_ENABLE | ||||
|   //------------- UART -------------// | ||||
|   scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_TX, MD_PDN, FUNC1); | ||||
| @@ -162,59 +156,4 @@ uint8_t  board_uart_getchar(void) | ||||
| //	ADC_ChannelCmd(LPC_ADC0, ADC_CH_TRIMPOT, ENABLE); | ||||
| //} | ||||
|  | ||||
| //------------- MIC2555 external OTG transceiver on USB1 -------------// | ||||
|  | ||||
| // MIC2555 1YML = 0101111, 0YML = 0101101 | ||||
| //#define MIC255_ADDR BIN8(0101111) | ||||
|  | ||||
| //static uint8_t mic255_regs_read(uint8_t regs_addr) | ||||
| //{ | ||||
| //  uint8_t value; | ||||
| // | ||||
| //  ASSERT( SUCCESS == I2C_MasterTransferData( | ||||
| //      LPC_I2C0, | ||||
| //      & (I2C_M_SETUP_Type) | ||||
| //      { | ||||
| //        .sl_addr7bit         = MIC255_ADDR, | ||||
| //        .retransmissions_max = 3, | ||||
| // | ||||
| //        .tx_data             = ®s_addr, | ||||
| //        .tx_length           = 1, | ||||
| // | ||||
| //        .rx_data             = &value, | ||||
| //        .rx_length           = 1 | ||||
| //      }, | ||||
| //      I2C_TRANSFER_POLLING), 0xFF); | ||||
| // | ||||
| //  return value; | ||||
| //} | ||||
|  | ||||
| //static bool mic255_regs_write(uint8_t regs_addr, uint8_t data) | ||||
| //{ | ||||
| //  uint8_t xfer_data[2] = { regs_addr, data} ; | ||||
| // | ||||
| //  ASSERT( SUCCESS == I2C_MasterTransferData( | ||||
| //      LPC_I2C0, | ||||
| //      & (I2C_M_SETUP_Type) | ||||
| //      { | ||||
| //        .sl_addr7bit         = MIC255_ADDR, | ||||
| //        .retransmissions_max = 3, | ||||
| // | ||||
| //        .tx_data             = xfer_data, | ||||
| //        .tx_length           = 2, | ||||
| //      }, | ||||
| //      I2C_TRANSFER_POLLING), false); | ||||
| // | ||||
| //  return true; | ||||
| //} | ||||
|  | ||||
|  | ||||
| //static uint16_t mic255_get_vendorid(void) | ||||
| //{ | ||||
| //  uint8_t vendor_low  = mic255_regs_read(0); | ||||
| //  uint8_t vendor_high = mic255_regs_read(1); | ||||
| // | ||||
| //  return (vendor_high << 8) | vendor_low; | ||||
| //} | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -106,6 +106,7 @@ int __sys_readc (void) | ||||
| #if CFG_PRINTF_TARGET == PRINTF_TARGET_UART | ||||
|   #define retarget_putc(c)    board_uart_send( (uint8_t*) &c, 1); | ||||
| #elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO | ||||
|   volatile int32_t ITM_RxBuffer; | ||||
| 	#define retarget_putc(c)    ITM_SendChar(c) | ||||
| #endif | ||||
|  | ||||
|   | ||||
| @@ -135,7 +135,7 @@ | ||||
|         <SetRegEntry> | ||||
|           <Number>0</Number> | ||||
|           <Key>DLGUARM</Key> | ||||
|           <Name></Name> | ||||
|           <Name>(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)</Name> | ||||
|         </SetRegEntry> | ||||
|         <SetRegEntry> | ||||
|           <Number>0</Number> | ||||
| @@ -158,24 +158,7 @@ | ||||
|           <Name>-O975 -S0 -C0 -FO7 -FD10000000 -FC800 -FN2 -FF0LPC18xx43xx_512_BA -FS01A000000 -FL080000 -FF1LPC18xx43xx_512_BB -FS11B000000 -FL180000)</Name> | ||||
|         </SetRegEntry> | ||||
|       </TargetDriverDllRegistry> | ||||
|       <Breakpoint> | ||||
|         <Bp> | ||||
|           <Number>0</Number> | ||||
|           <Type>0</Type> | ||||
|           <LineNumber>353</LineNumber> | ||||
|           <EnabledFlag>1</EnabledFlag> | ||||
|           <Address>0</Address> | ||||
|           <ByteObject>0</ByteObject> | ||||
|           <HtxType>0</HtxType> | ||||
|           <ManyObjects>0</ManyObjects> | ||||
|           <SizeOfObject>0</SizeOfObject> | ||||
|           <BreakByAccess>0</BreakByAccess> | ||||
|           <BreakIfRCount>0</BreakIfRCount> | ||||
|           <Filename>C:\Users\hathach\Dropbox\tinyusb\workspace\tinyusb\demos\host\src\cli.c</Filename> | ||||
|           <ExecCommand></ExecCommand> | ||||
|           <Expression></Expression> | ||||
|         </Bp> | ||||
|       </Breakpoint> | ||||
|       <Breakpoint/> | ||||
|       <WatchWindow1> | ||||
|         <Ww> | ||||
|           <count>0</count> | ||||
| @@ -387,24 +370,7 @@ | ||||
|           <Name>-O975 -S0 -C0 -FO7 -FD10000000 -FC800 -FN2 -FF0LPC18xx43xx_512_BA -FS01A000000 -FL080000 -FF1LPC18xx43xx_512_BB -FS11B000000 -FL180000)</Name> | ||||
|         </SetRegEntry> | ||||
|       </TargetDriverDllRegistry> | ||||
|       <Breakpoint> | ||||
|         <Bp> | ||||
|           <Number>0</Number> | ||||
|           <Type>0</Type> | ||||
|           <LineNumber>353</LineNumber> | ||||
|           <EnabledFlag>1</EnabledFlag> | ||||
|           <Address>0</Address> | ||||
|           <ByteObject>0</ByteObject> | ||||
|           <HtxType>0</HtxType> | ||||
|           <ManyObjects>0</ManyObjects> | ||||
|           <SizeOfObject>0</SizeOfObject> | ||||
|           <BreakByAccess>0</BreakByAccess> | ||||
|           <BreakIfRCount>0</BreakIfRCount> | ||||
|           <Filename>C:\Users\hathach\Dropbox\tinyusb\workspace\tinyusb\demos\host\src\cli.c</Filename> | ||||
|           <ExecCommand></ExecCommand> | ||||
|           <Expression></Expression> | ||||
|         </Bp> | ||||
|       </Breakpoint> | ||||
|       <Breakpoint/> | ||||
|       <WatchWindow1> | ||||
|         <Ww> | ||||
|           <count>0</count> | ||||
| @@ -458,10 +424,10 @@ | ||||
|       <FileType>1</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <ColumnNumber>17</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>1</TopLine> | ||||
|       <CurrentLine>1</CurrentLine> | ||||
|       <TopLine>94</TopLine> | ||||
|       <CurrentLine>111</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\src\main.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>main.c</FilenameWithoutPath> | ||||
| @@ -476,7 +442,7 @@ | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>125</TopLine> | ||||
|       <TopLine>92</TopLine> | ||||
|       <CurrentLine>145</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\src\cdc_serial_app.c</PathWithFileName> | ||||
| @@ -492,8 +458,8 @@ | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>167</TopLine> | ||||
|       <CurrentLine>180</CurrentLine> | ||||
|       <TopLine>111</TopLine> | ||||
|       <CurrentLine>123</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\src\keyboard_app.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>keyboard_app.c</FilenameWithoutPath> | ||||
| @@ -508,7 +474,7 @@ | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>44</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>124</TopLine> | ||||
|       <TopLine>118</TopLine> | ||||
|       <CurrentLine>127</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\src\mouse_app.c</PathWithFileName> | ||||
| @@ -538,10 +504,10 @@ | ||||
|       <FileType>1</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>27</ColumnNumber> | ||||
|       <ColumnNumber>1</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>1</TopLine> | ||||
|       <CurrentLine>8</CurrentLine> | ||||
|       <TopLine>121</TopLine> | ||||
|       <CurrentLine>150</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\src\msc_app.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>msc_app.c</FilenameWithoutPath> | ||||
| @@ -556,7 +522,7 @@ | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>18</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>4</TopLine> | ||||
|       <TopLine>8</TopLine> | ||||
|       <CurrentLine>11</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\src\cli.c</PathWithFileName> | ||||
| @@ -594,10 +560,10 @@ | ||||
|       <FileType>1</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <ColumnNumber>78</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>141</TopLine> | ||||
|       <CurrentLine>142</CurrentLine> | ||||
|       <TopLine>27</TopLine> | ||||
|       <CurrentLine>31</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\bsp\boards\embedded_artists\board_ea4357.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>board_ea4357.c</FilenameWithoutPath> | ||||
| @@ -612,7 +578,7 @@ | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>6</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>126</TopLine> | ||||
|       <TopLine>93</TopLine> | ||||
|       <CurrentLine>135</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\bsp\boards\printf_retarget.c</PathWithFileName> | ||||
| @@ -746,10 +712,10 @@ | ||||
|       <FileType>1</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <ColumnNumber>64</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>56</TopLine> | ||||
|       <CurrentLine>76</CurrentLine> | ||||
|       <TopLine>23</TopLine> | ||||
|       <CurrentLine>33</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\..\tinyusb\tusb.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>tusb.c</FilenameWithoutPath> | ||||
| @@ -810,10 +776,10 @@ | ||||
|       <FileType>1</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <ColumnNumber>61</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>494</TopLine> | ||||
|       <CurrentLine>501</CurrentLine> | ||||
|       <TopLine>430</TopLine> | ||||
|       <CurrentLine>518</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\..\tinyusb\host\usbh.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>usbh.c</FilenameWithoutPath> | ||||
| @@ -826,10 +792,10 @@ | ||||
|       <FileType>1</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>38</ColumnNumber> | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>482</TopLine> | ||||
|       <CurrentLine>484</CurrentLine> | ||||
|       <TopLine>1</TopLine> | ||||
|       <CurrentLine>5</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\..\tinyusb\host\ehci\ehci.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>ehci.c</FilenameWithoutPath> | ||||
| @@ -973,7 +939,7 @@ | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>1</TopLine> | ||||
|       <CurrentLine>1</CurrentLine> | ||||
|       <CurrentLine>12</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\..\tinyusb\class\hid_host.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>hid_host.c</FilenameWithoutPath> | ||||
| @@ -986,10 +952,10 @@ | ||||
|       <FileType>1</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>1</ColumnNumber> | ||||
|       <ColumnNumber>22</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>113</TopLine> | ||||
|       <CurrentLine>118</CurrentLine> | ||||
|       <TopLine>59</TopLine> | ||||
|       <CurrentLine>64</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\..\tinyusb\class\msc_host.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>msc_host.c</FilenameWithoutPath> | ||||
| @@ -1090,10 +1056,10 @@ | ||||
|       <FileType>1</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <ColumnNumber>7</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>0</TopLine> | ||||
|       <CurrentLine>0</CurrentLine> | ||||
|       <TopLine>777</TopLine> | ||||
|       <CurrentLine>782</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_i2c.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>lpc43xx_i2c.c</FilenameWithoutPath> | ||||
| @@ -1114,10 +1080,10 @@ | ||||
|       <FileType>2</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>22</ColumnNumber> | ||||
|       <ColumnNumber>54</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>148</TopLine> | ||||
|       <CurrentLine>151</CurrentLine> | ||||
|       <TopLine>139</TopLine> | ||||
|       <CurrentLine>148</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s</PathWithFileName> | ||||
|       <FilenameWithoutPath>startup_LPC43xx.s</FilenameWithoutPath> | ||||
| @@ -1138,10 +1104,10 @@ | ||||
|       <FileType>1</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <Focus>0</Focus> | ||||
|       <ColumnNumber>0</ColumnNumber> | ||||
|       <ColumnNumber>20</ColumnNumber> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <TopLine>1</TopLine> | ||||
|       <CurrentLine>1</CurrentLine> | ||||
|       <TopLine>49</TopLine> | ||||
|       <CurrentLine>62</CurrentLine> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>..\..\..\vendor\fatfs\diskio.c</PathWithFileName> | ||||
|       <FilenameWithoutPath>diskio.c</FilenameWithoutPath> | ||||
|   | ||||
| @@ -161,6 +161,7 @@ void cli_init(void) | ||||
| { | ||||
|   memclr_(cli_buffer, CLI_MAX_BUFFER); | ||||
|   f_getlabel(NULL, volume_label, NULL); | ||||
|   cli_command_prompt(); | ||||
| } | ||||
|  | ||||
| void cli_poll(char ch) | ||||
|   | ||||
| @@ -116,7 +116,6 @@ void os_none_start_scheduler(void) | ||||
|   } | ||||
| } | ||||
| #endif | ||||
| volatile int32_t ITM_RxBuffer; | ||||
|  | ||||
| int main(void) | ||||
| { | ||||
|   | ||||
| @@ -106,7 +106,6 @@ void tusbh_msc_mounted_cb(uint8_t dev_addr) | ||||
|     f_chdir("/"); // root as current dir | ||||
|  | ||||
|     cli_init(); | ||||
|     cli_command_prompt(); | ||||
|   } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -73,8 +73,8 @@ | ||||
|  | ||||
| //------------- CLASS -------------// | ||||
| #define TUSB_CFG_HOST_HUB           0 | ||||
| #define TUSB_CFG_HOST_HID_KEYBOARD  0 | ||||
| #define TUSB_CFG_HOST_HID_MOUSE     0 | ||||
| #define TUSB_CFG_HOST_HID_KEYBOARD  1 | ||||
| #define TUSB_CFG_HOST_HID_MOUSE     1 | ||||
| #define TUSB_CFG_HOST_HID_GENERIC   0 | ||||
| #define TUSB_CFG_HOST_MSC           1 | ||||
| #define TUSB_CFG_HOST_CDC           0 | ||||
| @@ -96,7 +96,7 @@ | ||||
| // COMMON CONFIGURATION | ||||
| //--------------------------------------------------------------------+ | ||||
|  | ||||
| #define TUSB_CFG_DEBUG                2 | ||||
| #define TUSB_CFG_DEBUG                3 | ||||
|  | ||||
| //#define TUSB_CFG_OS                   TUSB_OS_NONE // defined using eclipse build | ||||
| //#define TUSB_CFG_OS_TASK_PRIO | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach