?? main.lst
字號:
ARM COMPILER V0.20, main 15/12/04 08:44:45 PAGE 1
ARM COMPILER V0.20, COMPILATION OF MODULE main
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe main.c THUMB BROWSE DEBUG TABS(4)
stmt level source
1 /******************************************************************************/
2 /* This file is part of the uVision/ARM development tools */
3 /* Copyright KEIL ELEKTRONIK GmbH 2002-2004 */
4 /******************************************************************************/
5 /* */
6 /* HELLO.C: Hello World Example */
7 /* */
8 /******************************************************************************/
9
10 #include <stdio.h> /* I/O Functions */
11 #include <LPC22XX.H> /* LPC22XX Peripheral Registers */
12
13 unsigned Send_byte (unsigned Data);
14 void wait(void);
15 unsigned read_byte (void);
16
17 #define CS_HIGH IOSET0 = 0x400
18 #define CS_LOW IOCLR0 = 0x400
19
20 unsigned result= 0;
21 unsigned result2 = 0;
22
23 int main (void)
24 {
25 1
26 1 PINSEL0 = 0x5500; //Select SPI pins and enable SSEL0
27 1 IODIR0 = 0x400; //Configure GPIO pin to control the CS on the SPI eeprom
28 1 CS_HIGH; //Set the pin High
29 1 VPBDIV = 0x04; //Set the Clock VBP clock to 60 Mhz
30 1
31 1 S0SPCCR = 0x000000C8; //Set SPI bit rate at 300Khz
32 1 S0SPCR = 0x00000020; //set control register
33 1
34 1 wait();
35 1
36 1 CS_LOW;
37 1 result = Send_byte(0x55);
38 1
39 1
40 1 wait();
41 1
42 1
43 1 result = Send_byte(0x01);
44 1 result = read_byte;
*** WARNING C10 IN LINE 44 OF MAIN.C: conversion: 'pointer' to 'unsigned int'
45 1
46 1
47 1 wait();
48 1
49 1
50 1 result = Send_byte(0x05);
51 1
52 1 while(1)
53 1 {
54 2 ;
55 2 }
56 1
57 1 }
58
ARM COMPILER V0.20, main 15/12/04 08:44:45 PAGE 2
59 unsigned Send_byte (unsigned Data)
60 {
61 1 unsigned int result;
62 1 result = S0SPSR;
63 1 S0SPDR = Data;
64 1 while(S0SPSR == 0)
65 1 {
66 2 ;
67 2 }
68 1 return S0SPSR;
69 1 }
70
71 unsigned read_byte (void)
72 {
73 1 while(S0SPSR == 0)
74 1 {
75 2 ;
76 2 }
77 1 return S0SPDR;
78 1 }
79
80 void wait(void)
81 {
82 1 unsigned delay;
83 1 for(delay = 0;delay<0x10000;delay++) //a bit of setteling time
84 1 {
85 2 ;
86 2 }
87 1 }
88
ARM COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -