Mercurial > lcfOS
comparison python/stlink.py @ 138:14e739ed03ab
Added halt stub
author | Windel Bouwman |
---|---|
date | Sat, 26 Jan 2013 10:04:32 +0100 |
parents | 205578c96a79 |
children | 1cc59ac80950 |
comparison
equal
deleted
inserted
replaced
137:0a540ce31cd5 | 138:14e739ed03ab |
---|---|
136 implementer_id = (u32 >> 24) & 0x7f | 136 implementer_id = (u32 >> 24) & 0x7f |
137 variant = (u32 >> 20) & 0xf | 137 variant = (u32 >> 20) & 0xf |
138 part = (u32 >> 4) & 0xfff | 138 part = (u32 >> 4) & 0xfff |
139 revision = u32 & 0xf | 139 revision = u32 & 0xf |
140 return implementer_id, variant, part, revision | 140 return implementer_id, variant, part, revision |
141 | |
142 def getStatus(self): | 141 def getStatus(self): |
143 cmd = bytearray(16) | 142 cmd = bytearray(16) |
144 cmd[0:2] = DEBUG_COMMAND, DEBUG_GETSTATUS | 143 cmd[0:2] = DEBUG_COMMAND, DEBUG_GETSTATUS |
145 reply = self.send_recv(cmd, 2) | 144 reply = self.send_recv(cmd, 2) |
146 return reply[0] | 145 return reply[0] |
165 self.send_recv(cmd, 2) | 164 self.send_recv(cmd, 2) |
166 def run(self): | 165 def run(self): |
167 cmd = bytearray(16) | 166 cmd = bytearray(16) |
168 cmd[0:2] = DEBUG_COMMAND, DEBUG_RUNCORE | 167 cmd[0:2] = DEBUG_COMMAND, DEBUG_RUNCORE |
169 self.send_recv(cmd, 2) | 168 self.send_recv(cmd, 2) |
169 def halt(self): | |
170 pass | |
170 | 171 |
171 # Helper 1 functions: | 172 # Helper 1 functions: |
172 def write_debug32(self, address, value): | 173 def write_debug32(self, address, value): |
173 cmd = bytearray(16) | 174 cmd = bytearray(16) |
174 cmd[0:2] = DEBUG_COMMAND, JTAG_WRITEDEBUG_32BIT | 175 cmd[0:2] = DEBUG_COMMAND, JTAG_WRITEDEBUG_32BIT |