Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dw1000_driver_freertos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Colin Wulf
dw1000_driver_freertos
Commits
645a9f12
Commit
645a9f12
authored
9 years ago
by
Colin Wulf
Browse files
Options
Downloads
Patches
Plain Diff
dw1000: removed some todos, otpreads and debug printfs from the dw1000.c
parent
a2041ec6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Src/dw1000.c
+3
-33
3 additions, 33 deletions
Src/dw1000.c
with
3 additions
and
33 deletions
Src/dw1000.c
+
3
−
33
View file @
645a9f12
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
#include
"deca_regs.h"
#include
"deca_regs.h"
#include
"Trace.h"
#include
"Trace.h"
//DECA:OTP addresses definitions
#define LDOTUNE_ADDRESS (0x04)
#define LDOTUNE_ADDRESS (0x04)
#define PARTID_ADDRESS (0x06)
#define PARTID_ADDRESS (0x06)
#define LOTID_ADDRESS (0x07)
#define LOTID_ADDRESS (0x07)
...
@@ -35,16 +34,13 @@ int dw1000_init(uint16_t config, BaseType_t (*sendCallback)(),
...
@@ -35,16 +34,13 @@ int dw1000_init(uint16_t config, BaseType_t (*sendCallback)(),
// Set allowed interrupts
// Set allowed interrupts
// TODO:
Wieso werden ebenfalls andere Interrupts gesetzt? Vielleicht nur gesetzt, aber nicht getriggert?
// TODO:
MLDEDONE
uint32_t
sys_mask
=
0
;
uint32_t
sys_mask
=
0
;
dw1000Hal_readRegister
(
SYS_MASK_ID
,
(
uint8_t
*
)
&
sys_mask
,
SYS_MASK_LEN
);
dw1000Hal_readRegister
(
SYS_MASK_ID
,
(
uint8_t
*
)
&
sys_mask
,
SYS_MASK_LEN
);
trace_printf
(
"SYS_MASK: %x
\n
"
,
sys_mask
);
trace_printf
(
"SYS_MASK: %x
\n
"
,
sys_mask
);
sys_mask
|=
(
SYS_MASK_MTXFRS
|
SYS_MASK_MRXDFR
|
SYS_MASK_MRXFCG
sys_mask
|=
(
SYS_MASK_MTXFRS
|
SYS_MASK_MRXDFR
|
SYS_MASK_MRXFCG
// | SYS_MASK_MLDEDONE
|
SYS_MASK_MLDEDONE
|
SYS_MASK_MRXSFDD
);
);
// sys_mask |= SYS_MASK_MRXPRD;
sys_mask
|=
SYS_MASK_MRXSFDTO
;
trace_printf
(
"SYS_MASK: %x
\n
"
,
sys_mask
);
trace_printf
(
"SYS_MASK: %x
\n
"
,
sys_mask
);
dw1000Hal_writeRegister
(
SYS_MASK_ID
,
(
uint8_t
*
)
&
sys_mask
,
SYS_MASK_LEN
);
dw1000Hal_writeRegister
(
SYS_MASK_ID
,
(
uint8_t
*
)
&
sys_mask
,
SYS_MASK_LEN
);
...
@@ -71,7 +67,6 @@ int dw1000_init(uint16_t config, BaseType_t (*sendCallback)(),
...
@@ -71,7 +67,6 @@ int dw1000_init(uint16_t config, BaseType_t (*sendCallback)(),
//DECA: set system clock to XTI - this is necessary to make sure the values read by _dwt_otpread are reliable
//DECA: set system clock to XTI - this is necessary to make sure the values read by _dwt_otpread are reliable
dw1000Util_enableclocks
(
FORCE_SYS_XTI
);
dw1000Util_enableclocks
(
FORCE_SYS_XTI
);
// TODO: LDO Notwendig? Irgendwas mit Spannung?
if
(
config
&
DWT_LOADLDOTUNE
)
if
(
config
&
DWT_LOADLDOTUNE
)
{
{
dw1000local
.
ldoTune
=
dw1000Util_otpread
(
LDOTUNE_ADDRESS
);
dw1000local
.
ldoTune
=
dw1000Util_otpread
(
LDOTUNE_ADDRESS
);
...
@@ -91,31 +86,7 @@ int dw1000_init(uint16_t config, BaseType_t (*sendCallback)(),
...
@@ -91,31 +86,7 @@ int dw1000_init(uint16_t config, BaseType_t (*sendCallback)(),
dw1000local.partID = _dwt_otpread(PARTID_ADDRESS);
dw1000local.partID = _dwt_otpread(PARTID_ADDRESS);
dw1000local.lotID = _dwt_otpread(LOTID_ADDRESS);
dw1000local.lotID = _dwt_otpread(LOTID_ADDRESS);
*/
*/
// TODO
if
(
config
&
DWT_LOADANTDLY
)
{
dw1000local
.
antennaDly
=
dw1000Util_otpread
(
ANTDLY_ADDRESS
);
}
else
{
dw1000local
.
antennaDly
=
0
;
}
if
(
config
&
DWT_LOADXTALTRIM
)
{
dw1000local
.
xtrim
=
dw1000Util_otpread
(
XTRIM_ADDRESS
)
&
0x1F
;
if
(
!
dw1000local
.
xtrim
)
{
dw1000local
.
xtrim
=
pll2calcfg
&
0x1F
;
//DECA: set to mid-range if no calibration value inside
}
}
else
{
dw1000local
.
xtrim
=
pll2calcfg
&
0x1F
;
// DECA:set to mid-range default as described in UM 8.1.1 Calibration Method
}
// // No custom config stored inside ROM -> no reading necessary
// if (config & DWT_LOADTXCONFIG) {
// for (uint8_t i = 0; i < 12; i++) {
// dw1000local.txPowCfg[i] = dw1000Util_otpread(TXCFG_ADDRESS + i);
// }
// } else {
// for (uint8_t i = 0; i < 12; i++) {
// dw1000local.txPowCfg[i] = 0;
// }
// }
// load leading edge detect code
// load leading edge detect code
if
(
config
&
DWT_LOADUCODE
)
{
if
(
config
&
DWT_LOADUCODE
)
{
...
@@ -417,8 +388,7 @@ void dw1000_extiCallback(void) {
...
@@ -417,8 +388,7 @@ void dw1000_extiCallback(void) {
int
dw_1000_receiveFrameFromIsr
(
uint8_t
*
buffer
,
uint32_t
length
)
{
int
dw_1000_receiveFrameFromIsr
(
uint8_t
*
buffer
,
uint32_t
length
)
{
dw1000Hal_readRegisterFromIsr
(
RX_BUFFER_ID
,
buffer
,
length
);
//FromIsr important!
dw1000Hal_readRegisterFromIsr
(
RX_BUFFER_ID
,
buffer
,
length
);
//FromIsr important!
trace_printf
(
"First byte: %d
\n
"
,
buffer
[
0
]);
trace_printf
(
"%d
\n
"
,
buffer
[
0
]);
//trace_printf("Last byte: %d\n", buffer[length - 3]);
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment