Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
bldc_uart_comm_stm32f4_discovery
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
João Lino
bldc_uart_comm_stm32f4_discovery
Commits
fb0dba44
Commit
fb0dba44
authored
Apr 16, 2017
by
service-config
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nunchuck over uart
parent
85914615
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
2 deletions
+28
-2
bldc_interface.cpp
bldc_interface.cpp
+16
-1
bldc_interface.h
bldc_interface.h
+1
-0
comm_uart_arduino.cpp
comm_uart_arduino.cpp
+1
-1
datatypes.h
datatypes.h
+10
-0
No files found.
bldc_interface.cpp
View file @
fb0dba44
...
@@ -659,7 +659,22 @@ void bldc_interface_set_servo_pos(float pos) {
...
@@ -659,7 +659,22 @@ void bldc_interface_set_servo_pos(float pos) {
buffer_append_float16(send_buffer, pos, 1000.0, &send_index);
buffer_append_float16(send_buffer, pos, 1000.0, &send_index);
send_packet_no_fwd(send_buffer, send_index);
send_packet_no_fwd(send_buffer, send_index);
}
}
*/
void
bldc_interface_set_uartchuck_data
(
const
chuck_data
*
chuck_d_remote
)
{
uint8_t
send_buffer
[
13
];
int
send_index
=
0
;
fwd_can_append
(
send_buffer
,
&
send_index
);
send_buffer
[
send_index
++
]
=
COMM_CUSTOM_APP_DATA
;
send_buffer
[
send_index
++
]
=
(
uint8_t
)
chuck_d_remote
->
js_x
;
send_buffer
[
send_index
++
]
=
(
uint8_t
)
chuck_d_remote
->
js_y
;
send_buffer
[
send_index
++
]
=
(
uint8_t
)
chuck_d_remote
->
bt_c
;
send_buffer
[
send_index
++
]
=
(
uint8_t
)
chuck_d_remote
->
bt_z
;
buffer_append_int16
(
send_buffer
,
chuck_d_remote
->
acc_x
,
&
send_index
);
buffer_append_int16
(
send_buffer
,
chuck_d_remote
->
acc_y
,
&
send_index
);
buffer_append_int16
(
send_buffer
,
chuck_d_remote
->
acc_z
,
&
send_index
);
send_packet_no_fwd
(
send_buffer
,
send_index
);
}
/*
void bldc_interface_set_mcconf(const mc_configuration *mcconf) {
void bldc_interface_set_mcconf(const mc_configuration *mcconf) {
int send_index = 0;
int send_index = 0;
fwd_can_append(send_buffer, &send_index);
fwd_can_append(send_buffer, &send_index);
...
...
bldc_interface.h
View file @
fb0dba44
...
@@ -52,6 +52,7 @@ void bldc_interface_set_current_brake(float current);
...
@@ -52,6 +52,7 @@ void bldc_interface_set_current_brake(float current);
void
bldc_interface_set_rpm
(
int
rpm
);
void
bldc_interface_set_rpm
(
int
rpm
);
void
bldc_interface_set_pos
(
float
pos
);
void
bldc_interface_set_pos
(
float
pos
);
void
bldc_interface_set_servo_pos
(
float
pos
);
void
bldc_interface_set_servo_pos
(
float
pos
);
void
bldc_interface_set_uartchuck_data
(
const
chuck_data
*
chuck_d_remote
);
// JL
void
bldc_interface_set_mcconf
(
const
mc_configuration
*
mcconf
);
void
bldc_interface_set_mcconf
(
const
mc_configuration
*
mcconf
);
void
bldc_interface_set_appconf
(
const
app_configuration
*
appconf
);
void
bldc_interface_set_appconf
(
const
app_configuration
*
appconf
);
...
...
comm_uart_arduino.cpp
View file @
fb0dba44
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
// Settings
// Settings
#define __CUA_UART_BAUDRATE
9600 //1152
00
#define __CUA_UART_BAUDRATE
115200 // 96
00
// Private functions
// Private functions
static
void
send_packet
(
unsigned
char
*
data
,
int
len
);
static
void
send_packet
(
unsigned
char
*
data
,
int
len
);
...
...
datatypes.h
View file @
fb0dba44
...
@@ -268,6 +268,16 @@ typedef struct {
...
@@ -268,6 +268,16 @@ typedef struct {
float
tc_max_diff
;
float
tc_max_diff
;
}
chuk_config
;
}
chuk_config
;
typedef
struct
{
int
js_x
;
int
js_y
;
int
acc_x
;
int
acc_y
;
int
acc_z
;
bool
bt_c
;
bool
bt_z
;
}
chuck_data
;
// NRF Datatypes
// NRF Datatypes
typedef
enum
{
typedef
enum
{
NRF_SPEED_250K
=
0
,
NRF_SPEED_250K
=
0
,
...
...
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