Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PHASE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PHASE
Commits
fe8cf1f5
Commit
fe8cf1f5
authored
Apr 11, 2011
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handy to trace code
parent
12c11384
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
lm32-base.cpp
src/components/lm32/lm32-base.cpp
+14
-0
No files found.
src/components/lm32/lm32-base.cpp
View file @
fe8cf1f5
...
...
@@ -2,6 +2,8 @@
#include "lm32-base.h"
// #define DEBUG_LM32_JTAG 1
LM32Base
::
LM32Base
(
Interconnect
*
ic
)
:
Component
(
ic
),
lm32_write
(
*
addSlavePort
(
"lm32_write"
,
Pinout
(
"LM32"
,
11
))),
...
...
@@ -23,6 +25,9 @@ void LM32Base::send_keyval(unsigned int key, uint8_t b) {
Bits
x
(
val
);
x
.
resize
(
11
);
lm32_write
(
x
);
#ifdef DEBUG_LM32_JTAG
std
::
cerr
<<
"LM32 W: "
<<
std
::
hex
<<
key
<<
", "
<<
std
::
hex
<<
(
int
)
b
<<
std
::
endl
;
#endif
}
void
LM32Base
::
sendrecv_keyval
(
unsigned
int
key
,
uint8_t
b
)
{
...
...
@@ -32,11 +37,17 @@ void LM32Base::sendrecv_keyval(unsigned int key, uint8_t b) {
Bits
x
(
val
);
x
.
resize
(
11
);
lm32_read_write
(
x
);
#ifdef DEBUG_LM32_JTAG
std
::
cerr
<<
"LM32 RW: "
<<
std
::
hex
<<
key
<<
", "
<<
std
::
hex
<<
(
int
)
b
<<
std
::
endl
;
#endif
}
void
LM32Base
::
read_byte
()
{
Bits
x
(
11
,
false
);
lm32_read_write
(
x
);
#ifdef DEBUG_LM32_JTAG
std
::
cerr
<<
"LM32 RW: 0, 0"
<<
std
::
endl
;
#endif
}
void
LM32Base
::
recv
(
RecvQueue
::
const_iterator
i
,
RecvQueue
::
const_iterator
end
)
{
...
...
@@ -44,6 +55,9 @@ void LM32Base::recv(RecvQueue::const_iterator i, RecvQueue::const_iterator end)
Bits
c
(
i
->
bits
);
c
.
resize
(
16
);
uint16_t
v
=
static_cast
<
uint16_t
>
(
c
);
#ifdef DEBUG_LM32_JTAG
std
::
cerr
<<
"LM32 R: "
<<
std
::
hex
<<
(
v
&
0x7
)
<<
", "
<<
std
::
hex
<<
(
int
)(
v
>>
3
)
<<
" IN "
<<
std
::
endl
;
#endif
recv
(
v
&
0x7
,
v
>>
3
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment