Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stm32_libraries
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
tools
stm32_libraries
Merge requests
!13
Can devel
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Can devel
can_devel
into
master
Overview
0
Commits
3
Pipelines
0
Changes
3
Merged
Sergi Martínez Sánchez
requested to merge
can_devel
into
master
4 years ago
Overview
0
Commits
3
Pipelines
0
Changes
3
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
099671b6
3 commits,
4 years ago
3 files
+
595
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
f1/can/include/can.h
0 → 100644
+
104
−
0
Options
#ifndef CAN_F1_H
#define CAN_F1_H
#include
"stm32f1xx_hal.h"
#include
"comm.h"
typedef
struct
{
unsigned
char
irq_priority
;
unsigned
char
irq_subpriority
;
}
TCAN_IRQ_Priorities
;
typedef
enum
{
CAN_10KBPS
,
CAN_20KBPS
,
CAN_50KBPS
,
CAN_83K3BPS
,
CAN_100KBPS
,
CAN_125KBPS
,
CAN_250KBPS
,
CAN_500KBPS
,
CAN_1000KBPS
}
CAN_SPEED
;
typedef
enum
{
VERSION_1
,
VERSION_2
,
VERSION_NULL
}
DynamixelVersion
;
typedef
struct
TDynamixelMessage
{
unsigned
char
received_bytes
;
/**
* \brief
*
*/
unsigned
char
rx_buffer
[
MAX_DYN_SLAVE_RX_BUFFER_LEN
];
/**
* \brief
*
*/
unsigned
char
Len_L
;
/**
* \brief
*
*/
unsigned
char
Len_H
;
/**
* \brief
*
*/
unsigned
int
length
;
/**
* \brief
*
*/
DynamixelVersion
version
;
/**
* \brief
*
*/
unsigned
char
packet_init
;
/**
* \brief
*
*/
unsigned
char
packet_incomplete
;
/**
* \brief
*
*/
unsigned
char
send_packet
;
/**
* \brief
*
*/
unsigned
char
iterations
;
/**
* \brief
*
*/
}
TDynamixelMessage
;
/* public functions */
void
can_init
(
TComm
*
comm_dev
,
CAN_InitTypeDef
*
conf
,
TCAN_IRQ_Priorities
*
priorities
);
void
can_config
(
TComm
*
comm_dev
,
CAN_InitTypeDef
*
conf
);
void
can_set_priorities
(
TComm
*
comm_dev
,
TCAN_IRQ_Priorities
*
priorities
);
void
can_set_bitrate
(
TComm
*
comm_dev
,
CAN_SPEED
bitrate
);
void
can_set_filter
(
TComm
*
comm_dev
,
CAN_FilterConfTypeDef
*
filter
);
void
can_set_can_id
(
TComm
*
comm_dev
,
unsigned
char
id
);
/* IRQ functions */
unsigned
char
can_send_irq
(
unsigned
char
first_byte
);
unsigned
char
can_enable_tx_irq
(
void
);
unsigned
char
can_receive_irq
(
void
);
unsigned
char
can_cancel_receive_irq
(
void
);
/* DMA functions */
unsigned
char
can_send_dma
(
unsigned
char
*
data
,
unsigned
short
int
length
);
unsigned
char
can_receive_dma
(
unsigned
char
*
data
,
unsigned
short
int
length
);
unsigned
char
can_cancel_receive_dma
(
void
);
#endif
Loading