MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / asm-nios2nommu / spi.h
blob6efb82ce2807428f22f63a03d5aa3fc059955129
1 #ifndef _ASM_SPI_H_
2 #define _ASM_SPI_H_ 1
4 /*--------------------------------------------------------------------
6 * include/asm-nios2nommu/spi.h
8 * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al
10 * Copyright (C) 2004 Microtronix Datacom Ltd
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
23 * Jan/20/2004 dgt NiosII
25 ---------------------------------------------------------------------*/
28 #include <asm/nios.h>
30 int register_NIOS_SPI( void );
31 void unregister_NIOS_SPI( void );
33 #if defined(MODULE)
34 void cleanup_module( void );
35 int init_module( void );
36 #endif
38 #if defined(__KERNEL__)
39 int spi_reset ( void );
40 #endif
43 #define clockCS 0x01
44 #define temperatureCS 0x02
46 #define clock_read_base 0x00
47 #define clock_write_base 0x80
48 #define clock_read_control 0x0F
49 #define clock_read_trickle 0x11
51 #define clock_read_sec 0x00
52 #define clock_read_min 0x01
53 #define clock_read_hour 0x02
54 #define clock_read_day 0x03
55 #define clock_read_date 0x04
56 #define clock_read_month 0x05
57 #define clock_read_year 0x06
59 #define clock_write_control 0x8F
60 #define clock_write_trickle 0x91
61 #define clock_write_sec 0x80
62 #define clock_write_min 0x81
63 #define clock_write_hour 0x82
64 #define clock_write_day 0x83
65 #define clock_write_date 0x84
66 #define clock_write_month 0x85
67 #define clock_write_year 0x86
69 #define clock_write_ram_start 0xA0
70 #define clock_write_ram_end 0x100
71 #define clock_read_ram_start 0x20
72 #define clock_read_ram_end 0x80
75 #define clock_sec_def 0x11
76 #define clock_min_def 0x59
77 #define clock_hour_def 0x71
78 #define clock_day_def 0x00
79 #define clock_date_def 0x20
80 #define clock_month_def 0x12
81 #define clock_year_def 0x34
83 #define temp_read_base 0x00
84 #define temp_write_base 0x80
85 #define temp_read_control 0x00
86 #define temp_write_control 0x80
87 #define temp_read_msb 0x02
88 #define temp_read_lsb 0x01
90 #define MAX_TEMP_VAR 10
92 #endif /*_ASM_SPI_H_*/