📄 simple_mac.lst
字号:
ANSI-C/cC++ Compiler for HC08 V-5.0.19 (beta 0) Build 4210, Jul 29 2004
1: /**************************************************************
2: * This is the SMAC C source media (i.e. MAC) layer file for the HC(S)08 MCU
3: * and MC13192 transceiver.
4: * The SMAC MAC is the highest layer of C code for the SMAC.
5: **************************************************************/
6:
7:
8: /**************************************************************
9: * Includes
10: **************************************************************/
11: #include "pub_def.h"
12: #include "drivers.h"
13: #include "simple_phy.h"
14: #include "simple_mac.h"
15:
16: /**************************************************************
17: * Externals
18: **************************************************************/
19: extern rx_packet_t *drv_rx_packet;
20: extern byte rtx_mode;
21:
22: /**************************************************************
23: * Version string to put in NVM. Note! size limits
24: **************************************************************/
25:
26: // Normally it shoud be enough to change the version numbers.
27: #define Database_Label_Version "1.00"
28: #define MAC_Version "1.00"
29: #define MAC_Label "SMAC "
30:
31: #pragma MESSAGE DISABLE C3303 // Warning C3303: Implicit concatenation of strings
32: #pragma MESSAGE DISABLE C4200 // Warning C4200: Other segment than in previous declaration
33:
34: #pragma CONST_SEG BOOTLOADER_MAC_NV_DATA0
35:
36: // DO NOT CHANGE OR REMOVE
37:
38: // These strings will be located in the NV RAM0 section.
39: // Note!!Check that items are location in the same sequence as specified.
40: const unsigned char Freescale_Copyright[54] = "(c) Copyright 2004 Freescale Inc. All rights reserved";
41: const unsigned char Firmware_Database_Label[40] = "DB Label: XXXXXXXXXXXXXXXXXXXX Ver " Database_Label_Version;
42: const unsigned char SMAC_Version[47] = "MAC " MAC_Label " Ver " MAC_Version " Build: "__DATE__" "__TIME__;
43:
44: #pragma CONST_SEG DEFAULT
45:
46:
47: /**************************************************************
48: * Function: Transmit data packet
49: * Parameters: packet pointer
50: * Return: status
51: **************************************************************/
52: int MCPS_data_request(tx_packet_t *packet)
53: {
Function: MCPS_data_request
Source : D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\Sources\simple_mac.c
Options : -Cs08 -DAXM_0308 -Env"GENPATH=*D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac;D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\target\include;*C:\Program Files\Metrowerks\CW08 V3.1" -Env"LIBPATH=*C:\Program Files\Metrowerks\CW08 V3.1" -Env"OBJPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Env"TEXTPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Lasm=%n.lst -Ms -ObjN="D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\smac_Data\GB60_(EVB_-_rev_A-B-C)\ObjectCode\simple_mac.c.o" -WmsgSd1106 -WmsgSd1420 -WmsgSd1801 -WmsgSd2705 -WmsgSd3303 -WmsgSd4200
54: __uint8__ status;
55: /* Send it to the phy for processing */
56: status = pd_data_request(packet);
0000 cd0000 JSR pd_data_request
57: return status;
0003 8c CLRH
58: }
0004 81 RTS
59:
60: /**************************************************************
61: * MCPS_data_indication
62: * Function: Receive data packet indication
63: * Parameters: data packet pointer
64: * Notes: This function return should be located in the application
65: **************************************************************/
66:
67: /**************************************************************
68: * Function: Hibernate the MC13192 (very low current, no CLKO)
69: * Parameters: none
70: * Return: status
71: **************************************************************/
72: int MLME_hibernate_request(void)
73: {
Function: MLME_hibernate_request
Source : D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\Sources\simple_mac.c
Options : -Cs08 -DAXM_0308 -Env"GENPATH=*D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac;D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\target\include;*C:\Program Files\Metrowerks\CW08 V3.1" -Env"LIBPATH=*C:\Program Files\Metrowerks\CW08 V3.1" -Env"OBJPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Env"TEXTPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Lasm=%n.lst -Ms -ObjN="D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\smac_Data\GB60_(EVB_-_rev_A-B-C)\ObjectCode\simple_mac.c.o" -WmsgSd1106 -WmsgSd1420 -WmsgSd1801 -WmsgSd2705 -WmsgSd3303 -WmsgSd4200
74: __uint8__ status = 0;
75: status = PLME_hibernate_request();
0000 cd0000 JSR PLME_hibernate_request
76: return status;
0003 8c CLRH
77: }
0004 81 RTS
78:
79: /**************************************************************
80: * Function: Doze the MC13192 (Low current, CLKO <= 1MHz)
81: * Parameters: none
82: * Return: status
83: **************************************************************/
84: int MLME_doze_request(void)
85: {
Function: MLME_doze_request
Source : D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\Sources\simple_mac.c
Options : -Cs08 -DAXM_0308 -Env"GENPATH=*D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac;D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\target\include;*C:\Program Files\Metrowerks\CW08 V3.1" -Env"LIBPATH=*C:\Program Files\Metrowerks\CW08 V3.1" -Env"OBJPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Env"TEXTPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Lasm=%n.lst -Ms -ObjN="D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\smac_Data\GB60_(EVB_-_rev_A-B-C)\ObjectCode\simple_mac.c.o" -WmsgSd1106 -WmsgSd1420 -WmsgSd1801 -WmsgSd2705 -WmsgSd3303 -WmsgSd4200
86: __uint8__ status = 0;
87: status = PLME_doze_request();
0000 cd0000 JSR PLME_doze_request
88: return status;
0003 8c CLRH
89: }
0004 81 RTS
90:
91: /**************************************************************
92: * Function: Wake the MC13192 from Hibernate or Doze
93: * Parameters: none
94: * Return: status
95: **************************************************************/
96: int MLME_wake_request(void)
97: {
Function: MLME_wake_request
Source : D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\Sources\simple_mac.c
Options : -Cs08 -DAXM_0308 -Env"GENPATH=*D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac;D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\target\include;*C:\Program Files\Metrowerks\CW08 V3.1" -Env"LIBPATH=*C:\Program Files\Metrowerks\CW08 V3.1" -Env"OBJPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Env"TEXTPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Lasm=%n.lst -Ms -ObjN="D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\smac_Data\GB60_(EVB_-_rev_A-B-C)\ObjectCode\simple_mac.c.o" -WmsgSd1106 -WmsgSd1420 -WmsgSd1801 -WmsgSd2705 -WmsgSd3303 -WmsgSd4200
98: __uint8__ status = 0;
99: status = PLME_wake_request();
0000 cd0000 JSR PLME_wake_request
100: return status;
0003 8c CLRH
101: }
0004 81 RTS
102:
103: /**************************************************************
104: * Function: Set the MC13192 operating channel
105: * Parameters: channel number (0-15)
106: * Channel frequencies:
107: * 0: 2.405GHz
108: * 1: 2.410GHz
109: * 2: 2.415GHz
110: * 3: 2.420GHz
111: * 4: 2.425GHz
112: * 5: 2.430GHz
113: * 6: 2.435GHz
114: * 7: 2.440GHz
115: * 8: 2.445GHz
116: * 9: 2.450GHz
117: * 10: 2.455GHz
118: * 11: 2.460GHz
119: * 12: 2.465GHz
120: * 13: 2.470GHz
121: * 14: 2.475GHz
122: * 15: 2.480GHz
123: * Return: status
124: **************************************************************/
125: int MLME_set_channel_request(__uint8__ ch)
126: {
Function: MLME_set_channel_request
Source : D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\Sources\simple_mac.c
Options : -Cs08 -DAXM_0308 -Env"GENPATH=*D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac;D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\target\include;*C:\Program Files\Metrowerks\CW08 V3.1" -Env"LIBPATH=*C:\Program Files\Metrowerks\CW08 V3.1" -Env"OBJPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Env"TEXTPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Lasm=%n.lst -Ms -ObjN="D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\smac_Data\GB60_(EVB_-_rev_A-B-C)\ObjectCode\simple_mac.c.o" -WmsgSd1106 -WmsgSd1420 -WmsgSd1801 -WmsgSd2705 -WmsgSd3303 -WmsgSd4200
127: __uint8__ status = 0;
128: status = PLME_set_channel_request(ch);
0000 cd0000 JSR PLME_set_channel_request
129: return status;
0003 8c CLRH
130: }
0004 81 RTS
131:
132: /**************************************************************
133: * Function: Set the MC13192 receiver ON (with optional timeout)
134: * Parameters: packet pointer for received data and timeout
135: * Return: status
136: * Notes: Timeout of 0 disables the timeout.
137: * The actual timeout period is the timeout value times
138: * the MC13192 timer rate from MLME_set_MC13192_tmr_prescale.
139: **************************************************************/
140: int MLME_RX_enable_request(rx_packet_t *rx_packet, __uint32__ timeout)
141: {
Function: MLME_RX_enable_request
Source : D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\Sources\simple_mac.c
Options : -Cs08 -DAXM_0308 -Env"GENPATH=*D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac;D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\target\include;*C:\Program Files\Metrowerks\CW08 V3.1" -Env"LIBPATH=*C:\Program Files\Metrowerks\CW08 V3.1" -Env"OBJPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Env"TEXTPATH=D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\bin" -Lasm=%n.lst -Ms -ObjN="D:\Profiles\flr005\My Documents\Bluetooth Exchange Folder\smac 4_0\CW_IDE_3p1\smac\smac_Data\GB60_(EVB_-_rev_A-B-C)\ObjectCode\simple_mac.c.o" -WmsgSd1106 -WmsgSd1420 -WmsgSd1801 -WmsgSd2705 -WmsgSd3303 -WmsgSd4200
0000 a7fb AIS #-5
142: __uint8__ status = 0;
143: __uint32__ current_time;
144: drv_rx_packet = rx_packet; /* Assign the rx_packet to SMAC global. */
0002 9efe0c LDHX 12,SP
0005 960000 STHX drv_rx_packet
145: if (timeout == 0) /* Timeout disabled */
0008 95 TSX
0009 e60a LDA 10,X
000b ea09 ORA 9,X
000d ea08 ORA 8,X
000f ea07 ORA 7,X
0011 2604 BNE L17 ;abs = 0017
146: {
147: status = PLME_set_trx_state_request(RX_MODE); /* Just enable the receiver */
0013 a602 LDA #2
148: }
0015 2021 BRA L38 ;abs = 0038
0017 L17:
149: else /* Timeout requested. Get the current time and add the timeout value. */
150: {
151: current_time = PLME_get_time_request();
0017 cd0000 JSR PLME_get_time_request
152: current_time += timeout;
001a 95 TSX
001b 89 PSHX
001c 8b PSHH
001d af07 AIX #7
001f cd0000 JSR _LADD
0022 aff9 AIX #-7
0024 cd0000 JSR _POP32
153: status = PLME_enable_MC13192_timer1(current_time); /* Set the timeout in TC1 */
0027 9efe03 LDHX 3,SP
002a 89 PSHX
002b 8b PSHH
002c 9efe03 LDHX 3,SP
002f 89 PSHX
0030 8b PSHH
0031 cd0000 JSR PLME_enable_MC13192_timer1
0034 a704 AIS #4
154: status = PLME_set_trx_state_request(RX_MODE_WTO);
0036 a680 LDA #-128
0038 L38:
0038 cd0000 JSR PLME_set_trx_state_request
003b 9eef05 STX 5,SP
155: }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -