⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f326_usb0_mouse.lst

📁 HID Mouse source code 屬於Silabs C8051F326/F327,可以做一個USB 鼠標
💻 LST
📖 第 1 页 / 共 2 页
字号:
 178   1      
 179   1        // Sets Mouse Vector
 180   1         MOUSE_VECTOR = (1 * ((Mouse_MovementMultiplier >> 5)+1)) * Mouse_Direction;
 181   1      
 182   1      
 183   1         TF1 = 0;                              // Clear Timer2 interrupt flag
*** ERROR C202 IN LINE 183 OF F326_USB0_MOUSE.C: 'TF1': undefined identifier
 184   1      }
 185          
 186          
 187          
 188          //-----------------------------------------------------------------------------
 189          // Initialization Routines
 190          //-----------------------------------------------------------------------------
 191          
 192          //-----------------------------------------------------------------------------
 193          // USB0_Init
 194          //-----------------------------------------------------------------------------
 195          //
 196          // Return Value - None
 197          // Parameters - None
 198          //
 199          // - Initialize USB0
 200          // - Enable USB0 interrupts
 201          // - Enable USB0 transceiver
 202          // - Enable USB0 with suspend detection
 203          //
 204          // ----------------------------------------------------------------------------
 205          void USB0_Init(void)
 206          {
 207   1      
 208   1         POLL_WRITE_BYTE(POWER,  0x08);      // Force Asynchronous USB Reset
*** ERROR C202 IN LINE 208 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 208 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 208 OF F326_USB0_MOUSE.C: 'USB0DAT': undefined identifier
 209   1         POLL_WRITE_BYTE(IN1IE,  0x03);      // Enable Endpoint 0-1 in interrupts
*** ERROR C202 IN LINE 209 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 209 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 209 OF F326_USB0_MOUSE.C: 'USB0DAT': undefined identifier
 210   1         POLL_WRITE_BYTE(OUT1IE, 0x02);      // Enable Endpoint 0-1 out interrupts
*** ERROR C202 IN LINE 210 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 210 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 210 OF F326_USB0_MOUSE.C: 'USB0DAT': undefined identifier
 211   1         POLL_WRITE_BYTE(CMIE,   0x07);      // Enable Reset, Resume, and Suspend
*** ERROR C202 IN LINE 211 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 211 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 211 OF F326_USB0_MOUSE.C: 'USB0DAT': undefined identifier
 212   1                                             // interrupts
 213   1         USB0XCN = 0xE0;                     // Enable transceiver; select full speed
*** ERROR C202 IN LINE 213 OF F326_USB0_MOUSE.C: 'USB0XCN': undefined identifier
 214   1         POLL_WRITE_BYTE(CLKREC, 0x80);      // Enable clock recovery, single-step
*** ERROR C202 IN LINE 214 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 214 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 214 OF F326_USB0_MOUSE.C: 'USB0DAT': undefined identifier
 215   1                                             // mode disabled
 216   1      
 217   1         EIE1 |= 0x02;                       // Enable USB0 Interrupts
*** ERROR C202 IN LINE 217 OF F326_USB0_MOUSE.C: 'EIE1': undefined identifier
 218   1         EA = 1;                             // Global Interrupt enable
*** ERROR C202 IN LINE 218 OF F326_USB0_MOUSE.C: 'EA': undefined identifier
 219   1                                             // Enable USB0 by clearing the USB
C51 COMPILER V7.50   F326_USB0_MOUSE                                                       06/22/2006 17:45:53 PAGE 5   

 220   1         POLL_WRITE_BYTE(POWER,  0x01);      // Inhibit Bit and enable suspend
*** ERROR C202 IN LINE 220 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 220 OF F326_USB0_MOUSE.C: 'USB0ADR': undefined identifier
*** ERROR C202 IN LINE 220 OF F326_USB0_MOUSE.C: 'USB0DAT': undefined identifier
 221   1                                             // detection
 222   1      
 223   1      }
 224          
 225          //-----------------------------------------------------------------------------
 226          // System_Init(void)
 227          //-----------------------------------------------------------------------------
 228          //
 229          // Return Value - None
 230          // Parameters - None
 231          //
 232          // This top-level initialization routine calls all support routine.
 233          //
 234          // ----------------------------------------------------------------------------
 235          void System_Init(void)
 236          {
 237   1         Sysclk_Init();
 238   1         Port_Init();
 239   1         Timer_Init();
 240   1      }
 241          
 242          //-----------------------------------------------------------------------------
 243          // Sysclk_Init
 244          //-----------------------------------------------------------------------------
 245          //
 246          // Return Value - None
 247          // Parameters - None
 248          //
 249          // Initialize system clock to maximum frequency.
 250          //
 251          // ----------------------------------------------------------------------------
 252          void Sysclk_Init(void)
 253          {
 254   1      
 255   1         OSCICN |= 0x82;
*** ERROR C202 IN LINE 255 OF F326_USB0_MOUSE.C: 'OSCICN': undefined identifier
 256   1         CLKMUL  = 0x00;
*** ERROR C202 IN LINE 256 OF F326_USB0_MOUSE.C: 'CLKMUL': undefined identifier
 257   1         CLKMUL |= 0x80;                     // Enable clock multiplier
*** ERROR C202 IN LINE 257 OF F326_USB0_MOUSE.C: 'CLKMUL': undefined identifier
 258   1      
 259   1         Delay();
 260   1      
 261   1         CLKMUL |= 0xC0;                     // Initialize the clock multiplier
*** ERROR C202 IN LINE 261 OF F326_USB0_MOUSE.C: 'CLKMUL': undefined identifier
 262   1      
 263   1         while(!(CLKMUL & 0x20));            // Wait for multiplier to lock
*** ERROR C202 IN LINE 263 OF F326_USB0_MOUSE.C: 'CLKMUL': undefined identifier
 264   1      
 265   1         CLKSEL = 0x02;                      // Use Clock Multiplier/2 as system clock
*** ERROR C202 IN LINE 265 OF F326_USB0_MOUSE.C: 'CLKSEL': undefined identifier
 266   1      
 267   1      }
 268          
 269          //-----------------------------------------------------------------------------
 270          // Port_Init
 271          //-----------------------------------------------------------------------------
 272          //
C51 COMPILER V7.50   F326_USB0_MOUSE                                                       06/22/2006 17:45:53 PAGE 6   

 273          // Return Value - None
 274          // Parameters - None
 275          //
 276          // - Configure the Crossbar and GPIO ports.
 277          //
 278          // ----------------------------------------------------------------------------
 279          void Port_Init(void)
 280          {
 281   1      
 282   1         P2MDOUT |= 0x0C;                    // enable LEDs as a push-pull outputs
*** ERROR C202 IN LINE 282 OF F326_USB0_MOUSE.C: 'P2MDOUT': undefined identifier
 283   1      
 284   1      }
 285          
 286          
 287          
 288          //-----------------------------------------------------------------------------
 289          // Timer_Init
 290          //-----------------------------------------------------------------------------
 291          //
 292          // Return Value - None
 293          // Parameters - None
 294          //
 295          // - Timer 2 reload, used to check if switch pressed on overflow and
 296          // used for ADC continuous conversion
 297          //
 298          // ----------------------------------------------------------------------------
 299          void Timer_Init(void)
 300          {
 301   1      
 302   1         TCON      = 0x40;
*** ERROR C202 IN LINE 302 OF F326_USB0_MOUSE.C: 'TCON': undefined identifier
 303   1         TMOD      = 0x20;
*** ERROR C202 IN LINE 303 OF F326_USB0_MOUSE.C: 'TMOD': undefined identifier
 304   1         CKCON     = 0x02;
*** ERROR C202 IN LINE 304 OF F326_USB0_MOUSE.C: 'CKCON': undefined identifier
 305   1      
 306   1         TH1       = 0x00;                   // set reload value
*** ERROR C202 IN LINE 306 OF F326_USB0_MOUSE.C: 'TH1': undefined identifier
 307   1         IE        = 0x08;                   // enable timer interrupt
*** ERROR C202 IN LINE 307 OF F326_USB0_MOUSE.C: 'IE': undefined identifier
 308   1      
 309   1      }
 310          
 311          
 312          
 313          //-----------------------------------------------------------------------------
 314          // Delay
 315          //-----------------------------------------------------------------------------
 316          //
 317          // Return Value - None
 318          // Parameters - None
 319          //
 320          // Used for a small pause, approximately 80 us in Full Speed,
 321          // and 1 ms when clock is configured for Low Speed
 322          //
 323          // ----------------------------------------------------------------------------
 324          void Delay(void)
 325          {
 326   1         int x;
 327   1         for(x = 0;x < 500;x)
 328   1            x++;
C51 COMPILER V7.50   F326_USB0_MOUSE                                                       06/22/2006 17:45:53 PAGE 7   

 329   1      }

C51 COMPILATION COMPLETE.  1 WARNING(S),  36 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -