Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2136 - 1
/*****************************************************************************
2
 *   Copyright (C) 2008 Thomas Kaiser, thomas@ft-fanpage.de                  *
3
 *   Copyright (C) 2009 Peter "woggle" Mack, mac@denich.net                  *
4
 *   Copyright (C) 2011 Christian "Cebra" Brandtner, brandtner@brandtner.net *
5
 *   Copyright (C) 2011 Harald Bongartz                                      *
6
 *                                                                           *
7
 *   This program is free software; you can redistribute it and/or modify    *
8
 *   it under the terms of the GNU General Public License as published by    *
9
 *   the Free Software Foundation; either version 2 of the License.          *
10
 *                                                                           *
11
 *   This program is distributed in the hope that it will be useful,         *
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
14
 *   GNU General Public License for more details.                            *
15
 *                                                                           *
16
 *   You should have received a copy of the GNU General Public License       *
17
 *   along with this program; if not, write to the                           *
18
 *   Free Software Foundation, Inc.,                                         *
19
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.               *
20
 *                                                                           *
21
 *                                                                           *
22
 *   Credits to:                                                             *
23
 *   Holger Buss & Ingo Busker from mikrokopter.de for the MK project + SVN  *
24
 *                          http://www.mikrokopter.de                        *
25
 *   Gregor "killagreg" Stobrawa for his version of the MK code              *
26
 *   Thomas Kaiser "thkais" for the original project. See                    *
27
 *                          http://www.ft-fanpage.de/mikrokopter/            *
28
 *                          http://forum.mikrokopter.de/topic-4061-1.html    *
29
 *   Claas Anders "CaScAdE" Rathje for providing the font and his C-OSD code *
30
 *                          http://www.mylifesucks.de/oss/c-osd/             *
31
 *   Harald Bongartz "HaraldB" for providing his Ideas and Code for usibility*
32
 *****************************************************************************/
33
 
34
//############################################################################
35
//# HISTORY  Wi232.h
36
//#
37
//# 10.06.2014 OG
38
//# - add: Wi232_Initalize()
39
//# - add: Wi232_ConfigPC()
40
//# - del: InitWi232()
41
//#
42
//# 08.06.2014 OG
43
//# - chg: InitWi232() - Parameteraenderung
44
//# - del: Wi232_New_Baudrate
45
//# - add: Source-Historie ergaenzt
46
//############################################################################
47
 
48
#ifndef WI232_H_
49
#define WI232_H_
50
 
51
 
52
// Non-volatile Registers
53
//      Name            Address Description Default
54
#define regNVTXCHANNEL  0x00    // Transmit channel setting         ## 0 ##
55
#define regNVRXCHANNEL  0x01    // Receive channel setting          ## 0 ##
56
#define regNVPWRMODE    0x02    // Operating mode settings          ## +13 dBm widebandmode ##
57
#define regNVDATARATE   0x03    // UART data rate                   ## 2400bps ##
58
#define regNVNETMODE    0x04    // Network mode (Normal/Slave)      ## Normal ##
59
#define regNVTXTO       0x05    // Transmit wait timeout            ## ~16ms ##
60
#define regNVNETGRP     0x06    // Network group ID                 ## 0x00 ##
61
#define regNVUSECRC     0x08    // Enable/Disable CRC               ## Enabled ##
62
#define regNVUARTMTU    0x09    // Minimum transmission unit.       ## 64 bytes ##
63
#define regNVSHOWVER    0x0A    // Enable/Disable start-up message  ## Enabled ##
64
#define regNVCSMAMODE   0x0B    // Enable/Disable CSMA              ## Enabled ##
65
#define regNVSLPMODE    0x0D    // Power state of module            ## Awake ##
66
#define regNVACKONWAKE  0x0E    // Send ACK character to host on wake
67
 
68
 
69
// Non-volatile Read Only Registers
70
//      Name            Address Description
71
#define regMAC0         0x22    // These registers form the unique 48-bit MAC address.
72
#define regMAC1         0x23    // MAC
73
#define regMAC2         0x24    // MAC
74
#define regOUI0         0x25    // MAC
75
#define regOUI1         0x26    // MAC
76
#define regOUI2         0x27    // MAC
77
 
78
#define regDiscover     0x78    // Versionsregister
79
 
80
 
81
// Volatile Read/Write Registers
82
//      Name            Address Description
83
#define regTXCHANNEL    0x4B    // Transmit channel setting
84
#define regRXCHANNEL    0x4C    // Receive channel setting
85
#define regPWRMODE      0x4D    // Operating mode settings
86
#define regDATARATE     0x4E    // UART data rate
87
#define regNETMODE      0x4F    // Network mode (Normal or Slave)
88
#define regTXTO         0x50    // Transmit wait timeout
89
#define regNETGRP       0x51    // Network group ID
90
#define regUSECRC       0x53    // Enable/Disable CRC
91
#define regUARTMTU      0x54    // Minimum transmission unit.
92
#define regSHOWVER      0x55    // Enable/Disable start-up message
93
#define regCSMAMODE     0x56    // Enable/disable CSMA
94
#define regSLPMODE      0x58    // Power state of module
95
#define regACKONWAKE    0x59    // Send ACK character to host on wake
96
 
97
 
98
// Wideband Channels
99
// regNVTXCHAN (0x00) regTXCHAN (0x4B)
100
//      Channel         Number  Frequency
101
#define wChan0          0x00    // 868.300 MHz
102
#define wChan1          0x01    // 868.95 MHz   ## MK ##
103
 
104
// Narrowband Channels
105
// regNVRXCHAN (0x01) regRXCHAN (0x4C)
106
//      Channel         Number  Frequency
107
#define nChan0          0x00    // 868.225 MHz
108
#define nChan1          0x01    // 868.375 MHz   ## MK ##
109
#define nChan2          0x02    // 868.850 MHz
110
#define nChan3          0x03    // 869.050 MHz
111
#define nChan4          0x04    // 869.525 MHz
112
#define nChan5          0x05    // 869.850 MHz
113
 
114
// Power Mode
115
// regNVPWRMODE (0x02) regPWRMODE (0x4D)
116
//                               PM1 PM1 PM0 Mode
117
#define NbModeN0        0x00    // 0   0   0    Narrowband Mode       0dBm power setting (typical)
118
#define WbModeP5        0x01    // 0   0   1    Wideband Mode        +5dBm power setting (typical)
119
#define WbModeP10       0x02    // 0   1   0    Wideband Mode       +10dBm power setting (typical)
120
#define WbModeP15       0x03    // 0   1   1    Wideband Mode       +15dBm power setting (typical)   ## MK ##
121
#define WbModeN0        0x04    // 1   0   0    Wideband Mode         0dBm power setting (typical)
122
#define NbModeP5        0x05    // 1   0   1    Narrowband Mode      +5dBm power setting (typical)
123
#define NbModeP10       0x06    // 1   1   0    Narrowband Mode     +10dBm power setting (typical)
124
#define NbModeP15       0x07    // 1   1   1    Narrowband Mode     +15dBm power setting (typical)
125
 
126
// Wi232 UART Baudrate
127
// regNVDATARATE (0x03) regDATARATE (0x4E)
128
//          Baud Rate           BR2 BR1 BR0
129
#define Wi232_2400      Baud_2400   // 0 0 0* (default 2400)
130
#define Wi232_9600      Baud_9600   // 0 0 1
131
#define Wi232_19200     Baud_19200  // 0 1 0
132
#define Wi232_38400     Baud_38400  // 0 1 1
133
#define Wi232_57600     Baud_57600  // 1 0 0   ## MK ##
134
#define Wi232_115200            Baud_115200 // 1 0 1
135
#define Wi232_10400     0x06    // 1 1 0
136
#define Wi232_31250     0x07    // 1 1 1
137
 
138
// NetworkMode
139
// regNVNETMODE (0x04) regNETMODE (0x4F)
140
#define NetMode_Slave   0x00    // Slavemode
141
#define NetMode_Normal  0x01    // Normalmode (default)
142
 
143
// Transmit Wait Timeout
144
// regNVTXTO (0x05) regTXTO (0x50)
145
#define TWaitTimeFull   0x00    // full Buffer required
146
#define TWaitTime16     0x10    // 16 ms Delay (default)
147
 
148
// Network Group
149
// regNVNETGRP (0x06) regNETGRP (0x51)
150
#define NetWorkGroup    66      // default = 0, valid 0-127   ## MK = 66 ##
151
 
152
// CRC Control
153
// regNVUSECRC (0x08) regUSECRC (0x53)
154
#define CRC_Disable     0x00    // no CRC check
155
#define CRC_Enable      0x01    // CRC check (default)
156
 
157
// UART minimum transmission unit
158
// regNVUARTMTU (0x09) regUARTMTU (0x54)
159
#define UartMTU64       64      // default=64, valid 1-144
160
 
161
// Verbose mode
162
// regNVSHOWVER (0x0A)
163
#define ShowVers_Dis    0x00    // do not show Startupmessage   ## MK = 66 ##
164
#define ShowVers_En     0x01    // show Startupmessage (default)
165
 
166
// CSMA enable
167
// regNVCSMAMODE (0x0B) regCSMAMODE (0x56)
168
#define CSMA_Dis        0x00    // disable CSMA Carrier-sense multiple access
169
#define CSMA_En         0x01    // enable  CSMA (default)
170
 
171
// Sleep control
172
// regNVSLPMODE (0x0D) regSLPMODE (0x58)
173
#define Sleep_Awake     0x00    // Sleepmode = Awake (default)
174
#define Sleep           0x01    // Sleepmode = Sleep
175
#define Sleep_Stby      0x02    // Sleepmode = Standby
176
 
177
// ACK on Wake
178
// regNVACKONWAKE (0x0D) regACKONWAKE (0x59)
179
#define ACKwake_Dis     0x00    // disable ACK on Wake
180
#define ACKwake_En      0x01    // enable  ACK on Wake (default)
181
 
182
 
183
 
184
//----------------------------------
185
// EXPORT
186
//----------------------------------
187
void Wi232_Initalize( void );
188
void Wi232_ConfigPC( void );
189
 
190
 
191
 
192
#endif // WI232_H_