Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
darwin_stm32_fw
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
humanoides
darwin
darwin_stm32_fw
Commits
2b6ce8d6
Commit
2b6ce8d6
authored
9 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Added a second dynamixel bus using some of the analog ports.
Added the registers for the smart battery module.
parent
677c875f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/darwin_registers.h
+44
-1
44 additions, 1 deletion
include/darwin_registers.h
src/motion_manager.c
+7
-1
7 additions, 1 deletion
src/motion_manager.c
with
51 additions
and
2 deletions
include/darwin_registers.h
+
44
−
1
View file @
2b6ce8d6
...
...
@@ -539,7 +539,50 @@ typedef enum {
DARWIN_HEAD_MIN_TILT_L
=
0x0243
,
// angle in fixed point format 9|7
DARWIN_HEAD_MIN_TILT_H
=
0x0244
,
DARWIN_HEAD_TILT_TARGET_L
=
0x0245
,
// angle in fixed point format 9|7
DARWIN_HEAD_TILT_TARGET_H
=
0x0246
DARWIN_HEAD_TILT_TARGET_H
=
0x0246
,
DARWIN_BATT_CHARGER_STATUS
=
0x0247
,
DARWIN_BATT_INPUT_CURRENT_L
=
0x0248
,
DARWIN_BATT_INPUT_CURRENT_H
=
0x0249
,
DARWIN_BATT_CHARGE_CURRENT_L
=
0x024A
,
DARWIN_BATT_CHARGE_CURRENT_H
=
0x024B
,
DARWIN_BATT_CHARGE_VOLTAGE_L
=
0x024C
,
DARWIN_BATT_CHARGE_VOLTAGE_H
=
0x024D
,
DARWIN_BATT_LIMIT_CURRENT_L
=
0x024E
,
DARWIN_BATT_LIMIT_CURRENT_H
=
0x024F
,
DARWIN_BATT_TEMPERATURE_L
=
0x0250
,
DARWIN_BATT_TEMPERATURE_H
=
0x0251
,
DARWIN_BATT_VOLTAGE_L
=
0x0252
,
DARWIN_BATT_VOLTAGE_H
=
0x0253
,
DARWIN_BATT_CURRENT_L
=
0x0254
,
DARWIN_BATT_CURRENT_H
=
0x0255
,
DARWIN_BATT_AVG_CURRENT_L
=
0x0256
,
DARWIN_BATT_AVG_CURRENT_H
=
0x0257
,
DARWIN_BATT_RELATIVE_SOC
=
0x0258
,
DARWIN_BATT_ABSOLUTE_SOC
=
0x0259
,
DARWIN_BATT_REMAINING_CAP_L
=
0x025A
,
DARWIN_BATT_REMAINING_CAP_H
=
0x025B
,
DARWIN_BATT_FULL_CHARGE_CAP_L
=
0x025C
,
DARWIN_BATT_FULL_CHARGE_CAP_H
=
0x025D
,
DARWIN_BATT_RUN_TIME_EMPTY_L
=
0x025E
,
DARWIN_BATT_RUN_TIME_EMPTY_H
=
0x025F
,
DARWIN_BATT_AVG_TIME_EMPTY_L
=
0x0260
,
DARWIN_BATT_AVG_TIME_EMPTY_H
=
0x0261
,
DARWIN_BATT_AVG_TIME_FULL_L
=
0x0262
,
DARWIN_BATT_AVG_TIME_FULL_H
=
0x0263
,
DARWIN_BATT_STATUS_L
=
0x0264
,
DARWIN_BATT_STATUS_H
=
0x0265
,
DARWIN_BATT_DESIGN_CAP_L
=
0x0266
,
DARWIN_BATT_DESIGN_CAP_H
=
0x0267
,
DARWIN_BATT_DESIGN_VOLTAGE_L
=
0x0268
,
DARWIN_BATT_DESIGN_VOLTAGE_H
=
0x0269
,
DARWIN_BATT_CELL1_VOLTAGE_L
=
0x026A
,
DARWIN_BATT_CELL1_VOLTAGE_H
=
0x026B
,
DARWIN_BATT_CELL2_VOLTAGE_L
=
0x026C
,
DARWIN_BATT_CELL2_VOLTAGE_H
=
0x026D
,
DARWIN_BATT_CELL3_VOLTAGE_L
=
0x026E
,
DARWIN_BATT_CELL3_VOLTAGE_H
=
0x026F
,
DARWIN_BATT_CELL4_VOLTAGE_L
=
0x0270
,
DARWIN_BATT_CELL4_VOLTAGE_H
=
0x0271
}
darwin_registers
;
#define GPIO_BASE_ADDRESS 0x0100
...
...
This diff is collapsed.
Click to expand it.
src/motion_manager.c
+
7
−
1
View file @
2b6ce8d6
#include
"darwin_dyn_master.h"
#include
"darwin_dyn_master_v2.h"
#include
"motion_manager.h"
#include
"dyn_servos.h"
#include
"ram.h"
...
...
@@ -179,12 +180,13 @@ void manager_init(uint16_t period_us)
/* initialize the dynamixel master module for the servos */
darwin_dyn_master_init
();
darwin_dyn_master_v2_init
();
ram_data
[
DARWIN_MM_CNTRL
]
|=
MANAGER_SCANNING
;
// enable power to the servos
darwin_dyn_master_enable_power
();
HAL_Delay
(
1000
);
// detect the servos connected
// detect the servos connected
on the v1 bus
dyn_master_scan
(
&
darwin_dyn_master
,
&
num
,
servo_ids
);
ram_data
[
DARWIN_MM_NUM_SERVOS
]
=
num
;
manager_num_servos
=
0
;
...
...
@@ -299,6 +301,10 @@ void manager_init(uint16_t period_us)
ram_data
[
DARWIN_MM_PRESENT_SERVOS3
]
=
((
present_servos
&
0x00FF0000
)
>>
16
);
ram_data
[
DARWIN_MM_PRESENT_SERVOS4
]
=
((
present_servos
&
0xFF000000
)
>>
24
);
darwin_dyn_master_disable_power
();
// detect the servos connected on the v2 bus
dyn_master_scan
(
&
darwin_dyn_master_v2
,
&
num
,
servo_ids
);
ram_data
[
DARWIN_MM_CNTRL
]
&=
(
~
MANAGER_SCANNING
);
/* configure timer */
...
...
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