From ed4e3a7759456a3c96260bf8e3746607764fce9b Mon Sep 17 00:00:00 2001 From: Tyler Gamvrelis Date: Sun, 5 Aug 2018 15:28:44 -0400 Subject: [PATCH] Update documentation Added @brief for all data structures --- Robot/Doc/html/_a_x12_a_8h_source.html | 2 +- Robot/Doc/html/_communication_8h_source.html | 4 +- .../html/_dynamixel___handle_type_def_8h.html | 27 +-- ...dynamixel___handle_type_def_8h_source.html | 8 +- .../_dynamixel_protocol_v1_8h_source.html | 4 +- Robot/Doc/html/_m_p_u6050_8c.html | 2 +- Robot/Doc/html/_m_p_u6050_8h.html | 3 +- Robot/Doc/html/_m_p_u6050_8h_source.html | 20 +- Robot/Doc/html/_m_p_u_filter_8h_source.html | 2 +- Robot/Doc/html/_m_x28_8h_source.html | 2 +- Robot/Doc/html/_u_a_r_t___handler_8c.html | 4 +- Robot/Doc/html/_u_a_r_t___handler_8c.js | 2 +- Robot/Doc/html/_u_a_r_t___handler_8h.html | 4 + .../html/_u_a_r_t___handler_8h_source.html | 32 +-- Robot/Doc/html/annotated.html | 12 +- Robot/Doc/html/freertos_8c.html | 214 +++++++++--------- Robot/Doc/html/freertos_8c.js | 64 +++--- Robot/Doc/html/globals_func.html | 30 +-- Robot/Doc/html/globals_r.html | 6 +- Robot/Doc/html/globals_s.html | 15 ++ Robot/Doc/html/globals_t.html | 4 + Robot/Doc/html/globals_u.html | 23 +- Robot/Doc/html/globals_vars.html | 42 ++-- .../html/group___a_x12_a___interfaces.html | 4 +- Robot/Doc/html/group___a_x12_a___setters.html | 8 +- Robot/Doc/html/group___a_x12_a_header.html | 12 +- Robot/Doc/html/group___accelerometer.html | 4 +- ...col_v1___public___functions___getters.html | 16 +- ..._v1___public___functions___interfaces.html | 4 +- ..._public___functions___l_l___t_x___r_x.html | 4 +- ...tocol_v1___public___functions___other.html | 6 +- ...col_v1___public___functions___setters.html | 36 +-- ...tocol_v1___public___functions___setup.html | 4 +- .../group___dynamixel_protocol_v1_header.html | 70 +++--- Robot/Doc/html/group___free_r_t_o_s.html | 12 - Robot/Doc/html/group___gyroscope.html | 4 +- ...__i_m_u___filter___public___functions.html | 2 +- Robot/Doc/html/group___init.html | 10 +- .../Doc/html/group___m_x28___interfaces.html | 2 +- Robot/Doc/html/group___m_x28___setters.html | 12 +- Robot/Doc/html/group___m_x28_header.html | 14 +- Robot/Doc/html/group___register___r_w.html | 8 +- Robot/Doc/html/group___threads.html | 60 ++--- Robot/Doc/html/group___threads.js | 10 +- Robot/Doc/html/group___u_a_r_t___handler.html | 10 +- Robot/Doc/html/group___u_a_r_t___handler.js | 2 +- .../group___u_a_r_t___handler_header.html | 14 +- Robot/Doc/html/menudata.js | 1 - Robot/Doc/html/navtreeindex1.js | 52 ++--- Robot/Doc/html/navtreeindex3.js | 66 +++--- Robot/Doc/html/robot_goal_8h.html | 23 +- Robot/Doc/html/robot_goal_8h_source.html | 8 +- Robot/Doc/html/robot_state_8h.html | 21 +- Robot/Doc/html/robot_state_8h_source.html | 4 +- Robot/Doc/html/search/all_10.js | 2 +- Robot/Doc/html/search/all_11.js | 5 + Robot/Doc/html/search/all_12.js | 1 + Robot/Doc/html/search/all_13.js | 6 - Robot/Doc/html/search/functions_5.js | 5 + Robot/Doc/html/search/functions_6.js | 5 - Robot/Doc/html/search/searchdata.js | 2 +- Robot/Doc/html/search/variables_c.js | 1 + Robot/Doc/html/search/variables_d.js | 5 +- .../struct_dynamixel___handle_type_def.html | 5 +- .../struct_m_p_u6050___handle_type_def.html | 9 +- Robot/Doc/html/struct_t_x_data__t.html | 6 +- Robot/Doc/html/struct_u_a_r_tcmd__t.html | 7 +- .../struct_u_a_r_tcmd__t__coll__graph.map | 2 +- .../struct_u_a_r_tcmd__t__coll__graph.md5 | 2 +- Robot/Doc/html/structrobot__goal.html | 5 +- Robot/Doc/html/structrobot__state.html | 5 +- Robot/Drivers/Communication/robotGoal.h | 3 +- Robot/Drivers/Communication/robotState.h | 2 +- .../Dynamixel/Dynamixel_HandleTypeDef.h | 6 +- Robot/Drivers/MPU6050/MPU6050.h | 4 + Robot/Inc/UART_Handler.h | 36 +-- 76 files changed, 578 insertions(+), 575 deletions(-) diff --git a/Robot/Doc/html/_a_x12_a_8h_source.html b/Robot/Doc/html/_a_x12_a_8h_source.html index dc9aa232..ace1069d 100644 --- a/Robot/Doc/html/_a_x12_a_8h_source.html +++ b/Robot/Doc/html/_a_x12_a_8h_source.html @@ -90,7 +90,7 @@
AX12A.h
-Go to the documentation of this file.
1 
17 /******************** Define to prevent recursive inclusion ******************/
18 #ifndef __AX12A__
19 #define __AX12A__
20 
21 
22 
23 
24 /********************************* Includes **********************************/
25 #include "../Dynamixel_HandleTypeDef.h"
26 
27 
28 
29 
30 /********************************** Macros ***********************************/
31 /* Value limit definitions */
32 #define AX12A_MAX_VELOCITY 114
34 /* Register addresses */
35 #define AX12A_REG_CW_COMPLIANCE_MARGIN 0x1A
36 #define AX12A_REG_CCW_COMPLIANCE_MARGIN 0x1B
37 #define AX12A_REG_CW_COMPLIANCE_SLOPE 0x1C
38 #define AX12A_REG_CCW_COMPLIANCE_SLOPE 0x1D
40 /* Default register values */
41 #define AX12A_DEFAULT_BAUD_RATE 0x01
42 #define AX12A_DEFAULT_CCW_ANGLE_LIMIT 0x03FF
43 #define AX12A_DEFAULT_HIGHEST_VOLTAGE_LIMIT 0xBE
44 #define AX12A_DEFAULT_CW_COMPLIANCE_MARGIN 0x01
45 #define AX12A_DEFAULT_CCW_COMPLIANCE_MARGIN 0x01
46 #define AX12A_DEFAULT_CW_COMPLIANCE_SLOPE 0x20
47 #define AX12A_DEFAULT_CCW_COMPLIANCE_SLOPE 0x20
48 #define AX12A_DEFAULT_PUNCH 0x0020
53 /***************************** Function prototypes ***************************/
54 void AX12A_SetCWComplianceMargin(Dynamixel_HandleTypeDef* hdynamixel, uint8_t CWcomplianceMargin); // (RAM)
55 void AX12A_SetCCWComplianceMargin(Dynamixel_HandleTypeDef* hdynamixel, uint8_t CCWcomplianceMargin); // (RAM)
56 void AX12A_SetCWComplianceSlope(Dynamixel_HandleTypeDef* hdynamixel, uint8_t CWcomplianceSlope); // (RAM)
57 void AX12A_SetCCWComplianceSlope(Dynamixel_HandleTypeDef* hdynamixel, uint8_t CCWcomplianceSlope); // (RAM)
58 
59 // Interfaces for previously-defined functions
60 void AX12A_SetComplianceSlope(Dynamixel_HandleTypeDef* hdynamixel, uint8_t complianceSlope);
61 void AX12A_SetComplianceMargin(Dynamixel_HandleTypeDef* hdynamixel, uint8_t complianceSlope);
62 
66 /* end AX12AHeader */
67 
68 #endif /* __DYNAMIXEL_AX-12A_H__ */
Definition: Dynamixel_HandleTypeDef.h:39
+Go to the documentation of this file.
1 
17 /******************** Define to prevent recursive inclusion ******************/
18 #ifndef __AX12A__
19 #define __AX12A__
20 
21 
22 
23 
24 /********************************* Includes **********************************/
25 #include "../Dynamixel_HandleTypeDef.h"
26 
27 
28 
29 
30 /********************************** Macros ***********************************/
31 /* Value limit definitions */
32 #define AX12A_MAX_VELOCITY 114
34 /* Register addresses */
35 #define AX12A_REG_CW_COMPLIANCE_MARGIN 0x1A
36 #define AX12A_REG_CCW_COMPLIANCE_MARGIN 0x1B
37 #define AX12A_REG_CW_COMPLIANCE_SLOPE 0x1C
38 #define AX12A_REG_CCW_COMPLIANCE_SLOPE 0x1D
40 /* Default register values */
41 #define AX12A_DEFAULT_BAUD_RATE 0x01
42 #define AX12A_DEFAULT_CCW_ANGLE_LIMIT 0x03FF
43 #define AX12A_DEFAULT_HIGHEST_VOLTAGE_LIMIT 0xBE
44 #define AX12A_DEFAULT_CW_COMPLIANCE_MARGIN 0x01
45 #define AX12A_DEFAULT_CCW_COMPLIANCE_MARGIN 0x01
46 #define AX12A_DEFAULT_CW_COMPLIANCE_SLOPE 0x20
47 #define AX12A_DEFAULT_CCW_COMPLIANCE_SLOPE 0x20
48 #define AX12A_DEFAULT_PUNCH 0x0020
53 /***************************** Function prototypes ***************************/
54 void AX12A_SetCWComplianceMargin(Dynamixel_HandleTypeDef* hdynamixel, uint8_t CWcomplianceMargin); // (RAM)
55 void AX12A_SetCCWComplianceMargin(Dynamixel_HandleTypeDef* hdynamixel, uint8_t CCWcomplianceMargin); // (RAM)
56 void AX12A_SetCWComplianceSlope(Dynamixel_HandleTypeDef* hdynamixel, uint8_t CWcomplianceSlope); // (RAM)
57 void AX12A_SetCCWComplianceSlope(Dynamixel_HandleTypeDef* hdynamixel, uint8_t CCWcomplianceSlope); // (RAM)
58 
59 // Interfaces for previously-defined functions
60 void AX12A_SetComplianceSlope(Dynamixel_HandleTypeDef* hdynamixel, uint8_t complianceSlope);
61 void AX12A_SetComplianceMargin(Dynamixel_HandleTypeDef* hdynamixel, uint8_t complianceSlope);
62 
66 /* end AX12AHeader */
67 
68 #endif /* __DYNAMIXEL_AX-12A_H__ */
Organizes all the information relevant to a motor.
Definition: Dynamixel_HandleTypeDef.h:39
void AX12A_SetCWComplianceSlope(Dynamixel_HandleTypeDef *hdynamixel, uint8_t CWcomplianceSlope)
Sets the clockwise compliance slope for the current motor.
Definition: AX12A.c:124
void AX12A_SetCCWComplianceSlope(Dynamixel_HandleTypeDef *hdynamixel, uint8_t CCWcomplianceSlope)
Sets the counter-clockwise compliance slope for the current motor.
Definition: AX12A.c:160
void AX12A_SetComplianceSlope(Dynamixel_HandleTypeDef *hdynamixel, uint8_t complianceSlope)
Sets both the CW and CCW compliance slope.
Definition: AX12A.c:222
diff --git a/Robot/Doc/html/_communication_8h_source.html b/Robot/Doc/html/_communication_8h_source.html index 9fcce60b..12d3025b 100644 --- a/Robot/Doc/html/_communication_8h_source.html +++ b/Robot/Doc/html/_communication_8h_source.html @@ -92,8 +92,8 @@
Go to the documentation of this file.
1 
18 /******************** Define to prevent recursive inclusion *******************/
19 #ifndef __COMMUNICATION_H__
20 #define __COMMUNICATION_H__
21 
22 
23 
24 
25 /********************************** Includes **********************************/
26 #include <stdint.h>
27 #include <string.h>
28 #include "cmsis_os.h"
29 #include "usart.h"
30 #include "robotState.h"
31 #include "robotGoal.h"
32 
33 
34 
35 
36 /******************************* Public Variables ******************************/
39 
43 /* end CommunicationHeader */
44 
45 #endif /* __COMMUNICATION_H__ */
Defines the RobotState data structure used in communication with the high-level software. RobotState is the data structure sent from the MCU to the PC; it contains sensor data.
RobotGoal robotGoal
Definition: Communication.c:30
-
Definition: robotGoal.h:17
-
Definition: robotState.h:15
+
Data structure sent from the PC to the MCU. Contains "goal" motor positions.
Definition: robotGoal.h:18
+
Data structure sent from the MCU to the PC. Contains sensor data.
Definition: robotState.h:15
Defines the RobotGoal data structure used in communication with the high-level software. RobotGoal is the data structure sent from the PC to the MCU; it contains motor trajectories.
RobotState robotState
Definition: Communication.c:38
diff --git a/Robot/Doc/html/_dynamixel___handle_type_def_8h.html b/Robot/Doc/html/_dynamixel___handle_type_def_8h.html index 44598bc2..2c37766b 100644 --- a/Robot/Doc/html/_dynamixel___handle_type_def_8h.html +++ b/Robot/Doc/html/_dynamixel___handle_type_def_8h.html @@ -131,11 +131,14 @@

Data Structures

struct  Dynamixel_HandleTypeDef + Organizes all the information relevant to a motor. More...
  - + +

Typedefs

typedef enum motorTypes_e motorTypes_t
+typedef enum motorTypes_e motorTypes_t
 Enumerates the types of Dynamixel actuators the library supports.
 
+

@@ -143,28 +146,13 @@

enum  motorTypes_e { AX12ATYPE, MX28TYPE }
 Enumerates the types of Dynamixel actuators the library supports. More...
 

Detailed Description

This file defines the data structure used by all Dynamixel actuators, as well as user-defined types it uses.

Author
Tyler
-

Typedef Documentation

- -

◆ motorTypes_t

- -
-
- - - - -
typedef enum motorTypes_e motorTypes_t
-
-

Enumerates the types of Dynamixel actuators the library supports

- -
-
-

Enumeration Type Documentation

+

Enumeration Type Documentation

◆ motorTypes_e

@@ -176,7 +164,8 @@

-

Enumerates the types of Dynamixel actuators the library supports

+ +

Enumerates the types of Dynamixel actuators the library supports.

diff --git a/Robot/Doc/html/_dynamixel___handle_type_def_8h_source.html b/Robot/Doc/html/_dynamixel___handle_type_def_8h_source.html index adcf41d2..86c9fe46 100644 --- a/Robot/Doc/html/_dynamixel___handle_type_def_8h_source.html +++ b/Robot/Doc/html/_dynamixel___handle_type_def_8h_source.html @@ -90,8 +90,8 @@
Dynamixel_HandleTypeDef.h
-Go to the documentation of this file.
1 
15 /******************** Define to prevent recursive inclusion ******************/
16 #ifndef __DYNAMIXEL_HANDLE_TYPE_DEF_H__
17 #define __DYNAMIXEL_HANDLE_TYPE_DEF_H__
18 
19 
20 
21 
22 /********************************* Includes **********************************/
23 #include <stdint.h>
24 #include <stdbool.h>
25 #include "gpio.h"
26 
27 
28 
29 
30 /********************************** Types ************************************/
32 typedef enum motorTypes_e{
36 
37 // TODO: Should also have a resolution divider field for MX28
39 typedef struct{
41  uint8_t _ID;
44  float _lastPosition;
45  float _lastVelocity;
46  float _lastLoad;
48  bool _isJointMode;
49  UART_HandleTypeDef* _UART_Handle;
50  GPIO_TypeDef* _dataDirPort;
51 uint16_t _dataDirPinNum;
53 
54 #endif /* __DYNAMIXEL_HANDLE_TYPE_DEF_H__ */
UART_HandleTypeDef * _UART_Handle
Definition: Dynamixel_HandleTypeDef.h:49
-
Definition: Dynamixel_HandleTypeDef.h:39
+Go to the documentation of this file.
1 
15 /******************** Define to prevent recursive inclusion ******************/
16 #ifndef __DYNAMIXEL_HANDLE_TYPE_DEF_H__
17 #define __DYNAMIXEL_HANDLE_TYPE_DEF_H__
18 
19 
20 
21 
22 /********************************* Includes **********************************/
23 #include <stdint.h>
24 #include <stdbool.h>
25 #include "gpio.h"
26 
27 
28 
29 
30 /********************************** Types ************************************/
32 typedef enum motorTypes_e{
36 
37 // TODO: Should also have a resolution divider field for MX28
39 typedef struct{
41  uint8_t _ID;
44  float _lastPosition;
45  float _lastVelocity;
46  float _lastLoad;
48  bool _isJointMode;
49  UART_HandleTypeDef* _UART_Handle;
50  GPIO_TypeDef* _dataDirPort;
51  uint16_t _dataDirPinNum;
53 
54 #endif /* __DYNAMIXEL_HANDLE_TYPE_DEF_H__ */
UART_HandleTypeDef * _UART_Handle
Definition: Dynamixel_HandleTypeDef.h:49
+
Organizes all the information relevant to a motor.
Definition: Dynamixel_HandleTypeDef.h:39
bool _lastReadIsValid
Definition: Dynamixel_HandleTypeDef.h:42
Definition: Dynamixel_HandleTypeDef.h:33
float _lastVelocity
Definition: Dynamixel_HandleTypeDef.h:45
@@ -102,9 +102,9 @@
float _lastPosition
Definition: Dynamixel_HandleTypeDef.h:44
float _lastLoad
Definition: Dynamixel_HandleTypeDef.h:46
motorTypes_t _motorType
Definition: Dynamixel_HandleTypeDef.h:40
-
motorTypes_e
Definition: Dynamixel_HandleTypeDef.h:32
+
motorTypes_e
Enumerates the types of Dynamixel actuators the library supports.
Definition: Dynamixel_HandleTypeDef.h:32
uint16_t _dataDirPinNum
Definition: Dynamixel_HandleTypeDef.h:51
-
enum motorTypes_e motorTypes_t
+
enum motorTypes_e motorTypes_t
Enumerates the types of Dynamixel actuators the library supports.
uint8_t _ID
Definition: Dynamixel_HandleTypeDef.h:41
diff --git a/Robot/Doc/html/_dynamixel_protocol_v1_8h_source.html b/Robot/Doc/html/_dynamixel_protocol_v1_8h_source.html index cbd65013..adb579e5 100644 --- a/Robot/Doc/html/_dynamixel_protocol_v1_8h_source.html +++ b/Robot/Doc/html/_dynamixel_protocol_v1_8h_source.html @@ -100,7 +100,7 @@
bool Dynamixel_IsRegistered(Dynamixel_HandleTypeDef *hdynamixel)
Used to tell if a command sent was written to motor registers.
Definition: DynamixelProtocolV1.c:995
bool Dynamixel_IsMoving(Dynamixel_HandleTypeDef *hdynamixel)
Indicates whether the motor is in motion.
Definition: DynamixelProtocolV1.c:1007
void Dynamixel_LEDEnable(Dynamixel_HandleTypeDef *hdynamixel, uint8_t isEnabled)
Toggles the motor LED.
Definition: DynamixelProtocolV1.c:607
-
Definition: Dynamixel_HandleTypeDef.h:39
+
Organizes all the information relevant to a motor.
Definition: Dynamixel_HandleTypeDef.h:39
const float MIN_VELOCITY
Definition: DynamixelProtocolV1.c:94
const uint8_t DEFAULT_TORQUE_ENABLE
Definition: DynamixelProtocolV1.c:89
void Dynamixel_TorqueEnable(Dynamixel_HandleTypeDef *hdynamixel, uint8_t isEnabled)
Enables or disables torque for current motor.
Definition: DynamixelProtocolV1.c:584
@@ -142,7 +142,7 @@
float Dynamixel_GetVoltage(Dynamixel_HandleTypeDef *hdynamixel)
Reads the motor supply voltage.
Definition: DynamixelProtocolV1.c:959
void Dynamixel_SetGoalVelocity(Dynamixel_HandleTypeDef *hdynamixel, float goalVelocity)
Sets the goal velocity of the motor in RAM.
Definition: DynamixelProtocolV1.c:682
const uint8_t DEFAULT_STATUS_RETURN_LEVEL
Definition: DynamixelProtocolV1.c:86
-
motorTypes_e
Definition: Dynamixel_HandleTypeDef.h:32
+
motorTypes_e
Enumerates the types of Dynamixel actuators the library supports.
Definition: Dynamixel_HandleTypeDef.h:32
void Dynamixel_SetAlarmLED(Dynamixel_HandleTypeDef *hdynamixel, uint8_t alarm_LED_data)
Sets the conditions under which the motor LED will light up.
Definition: DynamixelProtocolV1.c:533
void Dynamixel_SetID(Dynamixel_HandleTypeDef *hdynamixel, uint8_t ID)
Sets the ID (identification number) for the current motor.
Definition: DynamixelProtocolV1.c:199
const float MIN_ANGLE
Definition: DynamixelProtocolV1.c:96
diff --git a/Robot/Doc/html/_m_p_u6050_8c.html b/Robot/Doc/html/_m_p_u6050_8c.html index a9e5b035..5ea5795c 100644 --- a/Robot/Doc/html/_m_p_u6050_8c.html +++ b/Robot/Doc/html/_m_p_u6050_8c.html @@ -116,7 +116,7 @@ - + diff --git a/Robot/Doc/html/_m_p_u6050_8h.html b/Robot/Doc/html/_m_p_u6050_8h.html index 9d078063..2fdb09ef 100644 --- a/Robot/Doc/html/_m_p_u6050_8h.html +++ b/Robot/Doc/html/_m_p_u6050_8h.html @@ -135,6 +135,7 @@ +
Enumerator
AX12ATYPE 

AX12A actuator

Functions

void MPU6050_init (MPU6050_HandleTypeDef *sMPU6050)
 This function is used as the first step of initialization of an MPU6050_HandleTypeDef struct. More...
 This function is used as the first step of initialization of an MPU6050_HandleTypeDef struct. More...
 
void MPU6050_manually_set_offsets (MPU6050_HandleTypeDef *sMPU6050)
 This function is used to manually set the offsets of the accelerometer and gyroscope based on empirical measurements taken for this specific sensor. In the future, this could be updated to allow for various MPU6050 devices, each with their own specific offsets. More...

Data Structures

struct  MPU6050_HandleTypeDef
 Data structure to organize MPU6050 configuration details and sensor readings. More...
 
- + diff --git a/Robot/Doc/html/_m_p_u6050_8h_source.html b/Robot/Doc/html/_m_p_u6050_8h_source.html index 2dd8ba6e..ad61aa68 100644 --- a/Robot/Doc/html/_m_p_u6050_8h_source.html +++ b/Robot/Doc/html/_m_p_u6050_8h_source.html @@ -90,15 +90,15 @@
MPU6050.h
-Go to the documentation of this file.
1 
12 #ifndef MPU_REGS_H_
13 #define MPU_REGS_H_
14 
15 #include "i2c.h"
16 #include "cmsis_os.h"
17 #include "usart.h"
18 #include "gpio.h"
19 #include <stdio.h>
20 #include <stdlib.h>
21 
22 #include "sharedMacros.h"
23 
24 uint16_t TOTAL_COUNT;
25 uint8_t Acc_X, Acc_Y, Acc_Z;
26 float acc_X;
27 int Gyro_X, Gyro_Y, Gyro_Z;
28 int Rem_X_Accel,Rem_Y_Accel,Rem_Z_Accel;
29 int Rem_X_Gyro,Rem_Y_Gyro,Rem_Z_Gyro;
30 char Sign_X_Accel, Sign_Y_Accel, Sign_Z_Accel;
31 char Sign_X_Gyro, Sign_Y_Gyro, Sign_Z_Gyro;
32 
33 #define INT_COEF 16384.0f
34 #define REM_COEF 16384
35 
36 /*********************************** Types ************************************/
37 typedef struct{
38  uint8_t _ID;
39  uint32_t _BaudRate;
40  uint8_t _Sample_Rate;
41  UART_HandleTypeDef* _UART_Handle;
42  I2C_HandleTypeDef* _I2C_Handle;
43  float _X_GYRO;
44  float _Y_GYRO;
45  float _Z_GYRO;
46  float _X_ACCEL;
47  float _Y_ACCEL;
48  float _Z_ACCEL;
50  //offsets:
51  float _X_GYRO_OFFSET;
52  float _Y_GYRO_OFFSET;
53  float _Z_GYRO_OFFSET;
54  float _X_ACCEL_OFFSET;
55  float _Y_ACCEL_OFFSET;
56  float _Z_ACCEL_OFFSET;
57 
58  //angles in degrees (calculated using _Z_ACCEL_OFFSET)
59  //see page 10 of https://www.nxp.com/docs/en/application-note/AN3461.pdf
60 
61  float _ROLL;
62  float _PITCH;
63 
64 
66 
67 /**************** Function Definitions ********************************/
68 void MPU6050_READ_DATA(MPU6050_HandleTypeDef *sMPU6050, uint8_t Reg_addr, uint8_t* sensor_buffer);
69 BaseType_t MPU6050_READ_DATA_IT(MPU6050_HandleTypeDef *sMPU6050, uint8_t Reg_addr, uint8_t* sensor_buffer);
70 void MPU6050_WRITE_REG(MPU6050_HandleTypeDef *sMPU6050,uint8_t reg_addr, uint8_t data);
71 void MPU6050_set_LPF(MPU6050_HandleTypeDef *sMPU6050, uint8_t lpf);
72 uint8_t MPU6050_READ_REG(MPU6050_HandleTypeDef *sMPU6050, uint8_t reg_addr);
73 void MPU6050_init(MPU6050_HandleTypeDef *sMPU6050);
74 void MPU6050_user_calibration(MPU6050_HandleTypeDef *sMPU6050);
75 void MPU6050_RESET_SENSOR_REG();
76 void MPU6050_Clear_Int();
77 void MPU6050_Data_Ready_Int();
78 void MPU6050_Get_Val_Gyro();
79 void MPU6050_Get_Val_Accel();
80 void MPU6050_print_Angular_Velocity(MPU6050_HandleTypeDef *sMPU6050);
81 void MPU6050_print_Acceleration(MPU6050_HandleTypeDef *sMPU6050);
82 void MPU6050_Read_Gyroscope(MPU6050_HandleTypeDef *sMPU6050);
83 void MPU6050_Read_Accelerometer(MPU6050_HandleTypeDef *sMPU6050);
89 
90 void generateClocks(uint8_t numClocks, uint8_t sendStopBits);
91 
92 #define MPU6050_RA_WHO_AM_I 0x75
93 #define MPU6050_ADDR 0b11010000 // ID
94 #define MPU6050_ADDRESS_AD0_LOW 0x68 // address pin low (GND), default for InvenSense evaluation board
95 #define MPU6050_ADDRESS_AD0_HIGH 0x69 // address pin high (VCC)
96 #define MPU6050_ADDR 0b11010000
97 #define MPU6050_RA_XG_OFFS_TC 0x00 //[7] PWR_MODE, [6:1] XG_OFFS_TC, [0] OTP_BNK_VLD
98 #define MPU6050_RA_YG_OFFS_TC 0x01 //[7] PWR_MODE, [6:1] YG_OFFS_TC, [0] OTP_BNK_VLD
99 #define MPU6050_RA_ZG_OFFS_TC 0x02 //[7] PWR_MODE, [6:1] ZG_OFFS_TC, [0] OTP_BNK_VLD
100 #define MPU6050_RA_X_FINE_GAIN 0x03 //[7:0] X_FINE_GAIN
101 #define MPU6050_RA_Y_FINE_GAIN 0x04 //[7:0] Y_FINE_GAIN
102 #define MPU6050_RA_Z_FINE_GAIN 0x05 //[7:0] Z_FINE_GAIN
103 #define MPU6050_RA_XA_OFFS_H 0x06 //[15:0] XA_OFFS
104 #define MPU6050_RA_XA_OFFS_L_TC 0x07
105 #define MPU6050_RA_YA_OFFS_H 0x08 //[15:0] YA_OFFS
106 #define MPU6050_RA_YA_OFFS_L_TC 0x09
107 #define MPU6050_RA_ZA_OFFS_H 0x0A //[15:0] ZA_OFFS
108 #define MPU6050_RA_ZA_OFFS_L_TC 0x0B
109 #define MPU6050_RA_XG_OFFS_USRH 0x13 //[15:0] XG_OFFS_USR
110 #define MPU6050_RA_XG_OFFS_USRL 0x14
111 #define MPU6050_RA_YG_OFFS_USRH 0x15 //[15:0] YG_OFFS_USR
112 #define MPU6050_RA_YG_OFFS_USRL 0x16
113 #define MPU6050_RA_ZG_OFFS_USRH 0x17 //[15:0] ZG_OFFS_USR
114 #define MPU6050_RA_ZG_OFFS_USRL 0x18
115 #define MPU6050_RA_SMPLRT_DIV 0x19
116 #define MPU6050_RA_CONFIG 0x1A
117 #define MPU6050_RA_GYRO_CONFIG 0x1B
118 #define MPU6050_RA_ACCEL_CONFIG 0x1C
119 #define MPU6050_RA_FIFO_EN 0x23
120 #define MPU6050_RA_I2C_MST_CTRL 0x24
121 #define MPU6050_RA_I2C_MST_STATUS 0x36
122 #define MPU6050_RA_INT_PIN_CFG 0x37
123 #define MPU6050_RA_INT_ENABLE 0x38
124 #define MPU6050_RA_DMP_INT_STATUS 0x39
125 #define MPU6050_RA_INT_STATUS 0x3A
126 
127 //since we are using the 0 setting for MPU6050_RA_GYRO_CONFIG, we define :
128 #define IMU_GY_RANGE 131 // divide by this to get degrees per second
129 //since we are using the 0 setting for MPU6050_RA_ACCEL_CONFIG, we define :
130 
131 #define ACC_RANGE 16384 //divide to get in units of g
132 
133 /*************Output****************************/
134 #define MPU6050_RA_ACCEL_XOUT_H 0x3B
135 #define MPU6050_RA_ACCEL_XOUT_L 0x3C
136 #define MPU6050_RA_ACCEL_YOUT_H 0x3D
137 #define MPU6050_RA_ACCEL_YOUT_L 0x3E
138 #define MPU6050_RA_ACCEL_ZOUT_H 0x3F
139 #define MPU6050_RA_ACCEL_ZOUT_L 0x40
140 #define MPU6050_RA_TEMP_OUT_H 0x41
141 #define MPU6050_RA_TEMP_OUT_L 0x42
142 #define MPU6050_RA_GYRO_XOUT_H 0x43
143 #define MPU6050_RA_GYRO_XOUT_L 0x44
144 #define MPU6050_RA_GYRO_YOUT_H 0x45
145 #define MPU6050_RA_GYRO_YOUT_L 0x46
146 #define MPU6050_RA_GYRO_ZOUT_H 0x47
147 #define MPU6050_RA_GYRO_ZOUT_L 0x48
148 
149 #define MPU6050_RA_USER_CTRL 0x6A
150 
151 #define MPU6050_RA_PWR_MGMT_1 0x6B
152 #define MPU6050_RA_PWR_MGMT_2 0x6C
153 
154 #define MPU6050_RA_FIFO_COUNTH 0x72
155 #define MPU6050_RA_FIFO_COUNTL 0x73
156 #define MPU6050_RA_FIFO_R_W 0x74
157 #define MPU6050_RA_WHO_AM_I 0x75
158 
159 #define MPU6050_GCONFIG_FS_SEL_BIT 4
160 #define MPU6050_GCONFIG_FS_SEL_LENGTH 2
161 
162 /***********Full scale selection*********************/
163 #define MPU6050_GYRO_FS_250 0x00
164 #define MPU6050_GYRO_FS_500 0x01
165 #define MPU6050_GYRO_FS_1000 0x02
166 #define MPU6050_GYRO_FS_2000 0x03
167 
168 #define MPU6050_ACCEL_FS_2 0x00
169 #define MPU6050_ACCEL_FS_4 0x01
170 #define MPU6050_ACCEL_FS_8 0x02
171 #define MPU6050_ACCEL_FS_16 0x03
172 
173 /* FIFO enable bit***********************************/
174 #define MPU6050_TEMP_FIFO_EN_BIT 7
175 #define MPU6050_XG_FIFO_EN_BIT 6
176 #define MPU6050_YG_FIFO_EN_BIT 5
177 #define MPU6050_ZG_FIFO_EN_BIT 4
178 #define MPU6050_ACCEL_FIFO_EN_BIT 3
179 #define MPU6050_SLV2_FIFO_EN_BIT 2
180 #define MPU6050_SLV1_FIFO_EN_BIT 1
181 #define MPU6050_SLV0_FIFO_EN_BIT 0
182 
183 /*****************Sample Rate DIV*******************/
184 #define MPU6050_CLOCK_DIV_348 0x0
185 #define MPU6050_CLOCK_DIV_333 0x1
186 #define MPU6050_CLOCK_DIV_320 0x2
187 #define MPU6050_CLOCK_DIV_308 0x3
188 #define MPU6050_CLOCK_DIV_296 0x4
189 #define MPU6050_CLOCK_DIV_286 0x5
190 #define MPU6050_CLOCK_DIV_276 0x6
191 #define MPU6050_CLOCK_DIV_267 0x7
192 #define MPU6050_CLOCK_DIV_258 0x8
193 #define MPU6050_CLOCK_DIV_500 0x9
194 #define MPU6050_CLOCK_DIV_471 0xA
195 #define MPU6050_CLOCK_DIV_444 0xB
196 #define MPU6050_CLOCK_DIV_421 0xC
197 #define MPU6050_CLOCK_DIV_400 0xD
198 #define MPU6050_CLOCK_DIV_381 0xE
199 #define MPU6050_CLOCK_DIV_364 0xF
200 
201 /***********interrupt*************************/
202 #define MPU6050_INTERRUPT_FF_BIT 7
203 #define MPU6050_INTERRUPT_MOT_BIT 6
204 #define MPU6050_INTERRUPT_ZMOT_BIT 5
205 #define MPU6050_INTERRUPT_FIFO_OFLOW_BIT 4
206 #define MPU6050_INTERRUPT_I2C_MST_INT_BIT 3
207 #define MPU6050_INTERRUPT_PLL_RDY_INT_BIT 2
208 #define MPU6050_INTERRUPT_DMP_INT_BIT 1
209 #define MPU6050_INTERRUPT_DATA_RDY_BIT 0
210 
211 // TODO: figure out what these actually do
212 // UMPL source code is not very obivous
213 #define MPU6050_DMPINT_5_BIT 5
214 #define MPU6050_DMPINT_4_BIT 4
215 #define MPU6050_DMPINT_3_BIT 3
216 #define MPU6050_DMPINT_2_BIT 2
217 #define MPU6050_DMPINT_1_BIT 1
218 #define MPU6050_DMPINT_0_BIT 0
219 
220 #define MPU6050_MOTION_MOT_XNEG_BIT 7
221 #define MPU6050_MOTION_MOT_XPOS_BIT 6
222 #define MPU6050_MOTION_MOT_YNEG_BIT 5
223 #define MPU6050_MOTION_MOT_YPOS_BIT 4
224 #define MPU6050_MOTION_MOT_ZNEG_BIT 3
225 #define MPU6050_MOTION_MOT_ZPOS_BIT 2
226 #define MPU6050_MOTION_MOT_ZRMOT_BIT 0
227 
228 /****************Path Rest************************/
229 #define MPU6050_PATHRESET_GYRO_RESET_BIT 2
230 #define MPU6050_PATHRESET_ACCEL_RESET_BIT 1
231 #define MPU6050_PATHRESET_TEMP_RESET_BIT 0
232 
233 #define MPU6050_USERCTRL_DMP_EN_BIT 7
234 #define MPU6050_USERCTRL_FIFO_EN_BIT 6
235 #define MPU6050_USERCTRL_I2C_MST_EN_BIT 5
236 #define MPU6050_USERCTRL_I2C_IF_DIS_BIT 4
237 #define MPU6050_USERCTRL_DMP_RESET_BIT 3
238 #define MPU6050_USERCTRL_FIFO_RESET_BIT 2
239 #define MPU6050_USERCTRL_I2C_MST_RESET_BIT 1
240 #define MPU6050_USERCTRL_SIG_COND_RESET_BIT 0
241 
242 /************Power Management************************/
243 #define MPU6050_PWR1_DEVICE_RESET_BIT 7
244 #define MPU6050_PWR1_SLEEP_BIT 6
245 #define MPU6050_PWR1_CYCLE_BIT 5
246 #define MPU6050_PWR1_TEMP_DIS_BIT 3
247 #define MPU6050_PWR1_CLKSEL_BIT 2
248 #define MPU6050_PWR1_CLKSEL_LENGTH 3
249 
250 #define MPU6050_PWR2_LP_WAKE_CTRL_BIT 7
251 #define MPU6050_PWR2_LP_WAKE_CTRL_LENGTH 2
252 #define MPU6050_PWR2_STBY_XA_BIT 5
253 #define MPU6050_PWR2_STBY_YA_BIT 4
254 #define MPU6050_PWR2_STBY_ZA_BIT 3
255 #define MPU6050_PWR2_STBY_XG_BIT 2
256 #define MPU6050_PWR2_STBY_YG_BIT 1
257 #define MPU6050_PWR2_STBY_ZG_BIT 0
258 
259 #define MPU6050_WAKE_FREQ_1P25 0x0
260 #define MPU6050_WAKE_FREQ_2P5 0x1
261 #define MPU6050_WAKE_FREQ_5 0x2
262 
263 #endif /* MPU6050_H_ */
void MPU6050_READ_DATA(MPU6050_HandleTypeDef *sMPU6050, uint8_t Reg_addr, uint8_t *sensor_buffer)
This function reads a register from the MPU6050 without interrupts, and stores it into a buffer...
Definition: MPU6050.c:252
-
float _X_ACCEL
Definition: MPU6050.h:46
-
float _Z_ACCEL
Definition: MPU6050.h:48
-
uint8_t _ID
Definition: MPU6050.h:38
-
float _Z_GYRO
Definition: MPU6050.h:45
-
float _X_GYRO
Definition: MPU6050.h:43
+Go to the documentation of this file.
1 
12 #ifndef MPU_REGS_H_
13 #define MPU_REGS_H_
14 
15 #include "i2c.h"
16 #include "cmsis_os.h"
17 #include "usart.h"
18 #include "gpio.h"
19 #include <stdio.h>
20 #include <stdlib.h>
21 
22 #include "sharedMacros.h"
23 
24 uint16_t TOTAL_COUNT;
25 uint8_t Acc_X, Acc_Y, Acc_Z;
26 float acc_X;
27 int Gyro_X, Gyro_Y, Gyro_Z;
28 int Rem_X_Accel,Rem_Y_Accel,Rem_Z_Accel;
29 int Rem_X_Gyro,Rem_Y_Gyro,Rem_Z_Gyro;
30 char Sign_X_Accel, Sign_Y_Accel, Sign_Z_Accel;
31 char Sign_X_Gyro, Sign_Y_Gyro, Sign_Z_Gyro;
32 
33 #define INT_COEF 16384.0f
34 #define REM_COEF 16384
35 
36 /*********************************** Types ************************************/
41 typedef struct{
42  uint8_t _ID;
43  uint32_t _BaudRate;
44  uint8_t _Sample_Rate;
45  UART_HandleTypeDef* _UART_Handle;
46  I2C_HandleTypeDef* _I2C_Handle;
47  float _X_GYRO;
48  float _Y_GYRO;
49  float _Z_GYRO;
50  float _X_ACCEL;
51  float _Y_ACCEL;
52  float _Z_ACCEL;
54  //offsets:
55  float _X_GYRO_OFFSET;
56  float _Y_GYRO_OFFSET;
57  float _Z_GYRO_OFFSET;
58  float _X_ACCEL_OFFSET;
59  float _Y_ACCEL_OFFSET;
60  float _Z_ACCEL_OFFSET;
61 
62  //angles in degrees (calculated using _Z_ACCEL_OFFSET)
63  //see page 10 of https://www.nxp.com/docs/en/application-note/AN3461.pdf
64 
65  float _ROLL;
66  float _PITCH;
67 
68 
70 
71 /**************** Function Definitions ********************************/
72 void MPU6050_READ_DATA(MPU6050_HandleTypeDef *sMPU6050, uint8_t Reg_addr, uint8_t* sensor_buffer);
73 BaseType_t MPU6050_READ_DATA_IT(MPU6050_HandleTypeDef *sMPU6050, uint8_t Reg_addr, uint8_t* sensor_buffer);
74 void MPU6050_WRITE_REG(MPU6050_HandleTypeDef *sMPU6050,uint8_t reg_addr, uint8_t data);
75 void MPU6050_set_LPF(MPU6050_HandleTypeDef *sMPU6050, uint8_t lpf);
76 uint8_t MPU6050_READ_REG(MPU6050_HandleTypeDef *sMPU6050, uint8_t reg_addr);
77 void MPU6050_init(MPU6050_HandleTypeDef *sMPU6050);
78 void MPU6050_user_calibration(MPU6050_HandleTypeDef *sMPU6050);
79 void MPU6050_RESET_SENSOR_REG();
80 void MPU6050_Clear_Int();
81 void MPU6050_Data_Ready_Int();
82 void MPU6050_Get_Val_Gyro();
83 void MPU6050_Get_Val_Accel();
84 void MPU6050_print_Angular_Velocity(MPU6050_HandleTypeDef *sMPU6050);
85 void MPU6050_print_Acceleration(MPU6050_HandleTypeDef *sMPU6050);
86 void MPU6050_Read_Gyroscope(MPU6050_HandleTypeDef *sMPU6050);
87 void MPU6050_Read_Accelerometer(MPU6050_HandleTypeDef *sMPU6050);
93 
94 void generateClocks(uint8_t numClocks, uint8_t sendStopBits);
95 
96 #define MPU6050_RA_WHO_AM_I 0x75
97 #define MPU6050_ADDR 0b11010000 // ID
98 #define MPU6050_ADDRESS_AD0_LOW 0x68 // address pin low (GND), default for InvenSense evaluation board
99 #define MPU6050_ADDRESS_AD0_HIGH 0x69 // address pin high (VCC)
100 #define MPU6050_ADDR 0b11010000
101 #define MPU6050_RA_XG_OFFS_TC 0x00 //[7] PWR_MODE, [6:1] XG_OFFS_TC, [0] OTP_BNK_VLD
102 #define MPU6050_RA_YG_OFFS_TC 0x01 //[7] PWR_MODE, [6:1] YG_OFFS_TC, [0] OTP_BNK_VLD
103 #define MPU6050_RA_ZG_OFFS_TC 0x02 //[7] PWR_MODE, [6:1] ZG_OFFS_TC, [0] OTP_BNK_VLD
104 #define MPU6050_RA_X_FINE_GAIN 0x03 //[7:0] X_FINE_GAIN
105 #define MPU6050_RA_Y_FINE_GAIN 0x04 //[7:0] Y_FINE_GAIN
106 #define MPU6050_RA_Z_FINE_GAIN 0x05 //[7:0] Z_FINE_GAIN
107 #define MPU6050_RA_XA_OFFS_H 0x06 //[15:0] XA_OFFS
108 #define MPU6050_RA_XA_OFFS_L_TC 0x07
109 #define MPU6050_RA_YA_OFFS_H 0x08 //[15:0] YA_OFFS
110 #define MPU6050_RA_YA_OFFS_L_TC 0x09
111 #define MPU6050_RA_ZA_OFFS_H 0x0A //[15:0] ZA_OFFS
112 #define MPU6050_RA_ZA_OFFS_L_TC 0x0B
113 #define MPU6050_RA_XG_OFFS_USRH 0x13 //[15:0] XG_OFFS_USR
114 #define MPU6050_RA_XG_OFFS_USRL 0x14
115 #define MPU6050_RA_YG_OFFS_USRH 0x15 //[15:0] YG_OFFS_USR
116 #define MPU6050_RA_YG_OFFS_USRL 0x16
117 #define MPU6050_RA_ZG_OFFS_USRH 0x17 //[15:0] ZG_OFFS_USR
118 #define MPU6050_RA_ZG_OFFS_USRL 0x18
119 #define MPU6050_RA_SMPLRT_DIV 0x19
120 #define MPU6050_RA_CONFIG 0x1A
121 #define MPU6050_RA_GYRO_CONFIG 0x1B
122 #define MPU6050_RA_ACCEL_CONFIG 0x1C
123 #define MPU6050_RA_FIFO_EN 0x23
124 #define MPU6050_RA_I2C_MST_CTRL 0x24
125 #define MPU6050_RA_I2C_MST_STATUS 0x36
126 #define MPU6050_RA_INT_PIN_CFG 0x37
127 #define MPU6050_RA_INT_ENABLE 0x38
128 #define MPU6050_RA_DMP_INT_STATUS 0x39
129 #define MPU6050_RA_INT_STATUS 0x3A
130 
131 //since we are using the 0 setting for MPU6050_RA_GYRO_CONFIG, we define :
132 #define IMU_GY_RANGE 131 // divide by this to get degrees per second
133 //since we are using the 0 setting for MPU6050_RA_ACCEL_CONFIG, we define :
134 
135 #define ACC_RANGE 16384 //divide to get in units of g
136 
137 /*************Output****************************/
138 #define MPU6050_RA_ACCEL_XOUT_H 0x3B
139 #define MPU6050_RA_ACCEL_XOUT_L 0x3C
140 #define MPU6050_RA_ACCEL_YOUT_H 0x3D
141 #define MPU6050_RA_ACCEL_YOUT_L 0x3E
142 #define MPU6050_RA_ACCEL_ZOUT_H 0x3F
143 #define MPU6050_RA_ACCEL_ZOUT_L 0x40
144 #define MPU6050_RA_TEMP_OUT_H 0x41
145 #define MPU6050_RA_TEMP_OUT_L 0x42
146 #define MPU6050_RA_GYRO_XOUT_H 0x43
147 #define MPU6050_RA_GYRO_XOUT_L 0x44
148 #define MPU6050_RA_GYRO_YOUT_H 0x45
149 #define MPU6050_RA_GYRO_YOUT_L 0x46
150 #define MPU6050_RA_GYRO_ZOUT_H 0x47
151 #define MPU6050_RA_GYRO_ZOUT_L 0x48
152 
153 #define MPU6050_RA_USER_CTRL 0x6A
154 
155 #define MPU6050_RA_PWR_MGMT_1 0x6B
156 #define MPU6050_RA_PWR_MGMT_2 0x6C
157 
158 #define MPU6050_RA_FIFO_COUNTH 0x72
159 #define MPU6050_RA_FIFO_COUNTL 0x73
160 #define MPU6050_RA_FIFO_R_W 0x74
161 #define MPU6050_RA_WHO_AM_I 0x75
162 
163 #define MPU6050_GCONFIG_FS_SEL_BIT 4
164 #define MPU6050_GCONFIG_FS_SEL_LENGTH 2
165 
166 /***********Full scale selection*********************/
167 #define MPU6050_GYRO_FS_250 0x00
168 #define MPU6050_GYRO_FS_500 0x01
169 #define MPU6050_GYRO_FS_1000 0x02
170 #define MPU6050_GYRO_FS_2000 0x03
171 
172 #define MPU6050_ACCEL_FS_2 0x00
173 #define MPU6050_ACCEL_FS_4 0x01
174 #define MPU6050_ACCEL_FS_8 0x02
175 #define MPU6050_ACCEL_FS_16 0x03
176 
177 /* FIFO enable bit***********************************/
178 #define MPU6050_TEMP_FIFO_EN_BIT 7
179 #define MPU6050_XG_FIFO_EN_BIT 6
180 #define MPU6050_YG_FIFO_EN_BIT 5
181 #define MPU6050_ZG_FIFO_EN_BIT 4
182 #define MPU6050_ACCEL_FIFO_EN_BIT 3
183 #define MPU6050_SLV2_FIFO_EN_BIT 2
184 #define MPU6050_SLV1_FIFO_EN_BIT 1
185 #define MPU6050_SLV0_FIFO_EN_BIT 0
186 
187 /*****************Sample Rate DIV*******************/
188 #define MPU6050_CLOCK_DIV_348 0x0
189 #define MPU6050_CLOCK_DIV_333 0x1
190 #define MPU6050_CLOCK_DIV_320 0x2
191 #define MPU6050_CLOCK_DIV_308 0x3
192 #define MPU6050_CLOCK_DIV_296 0x4
193 #define MPU6050_CLOCK_DIV_286 0x5
194 #define MPU6050_CLOCK_DIV_276 0x6
195 #define MPU6050_CLOCK_DIV_267 0x7
196 #define MPU6050_CLOCK_DIV_258 0x8
197 #define MPU6050_CLOCK_DIV_500 0x9
198 #define MPU6050_CLOCK_DIV_471 0xA
199 #define MPU6050_CLOCK_DIV_444 0xB
200 #define MPU6050_CLOCK_DIV_421 0xC
201 #define MPU6050_CLOCK_DIV_400 0xD
202 #define MPU6050_CLOCK_DIV_381 0xE
203 #define MPU6050_CLOCK_DIV_364 0xF
204 
205 /***********interrupt*************************/
206 #define MPU6050_INTERRUPT_FF_BIT 7
207 #define MPU6050_INTERRUPT_MOT_BIT 6
208 #define MPU6050_INTERRUPT_ZMOT_BIT 5
209 #define MPU6050_INTERRUPT_FIFO_OFLOW_BIT 4
210 #define MPU6050_INTERRUPT_I2C_MST_INT_BIT 3
211 #define MPU6050_INTERRUPT_PLL_RDY_INT_BIT 2
212 #define MPU6050_INTERRUPT_DMP_INT_BIT 1
213 #define MPU6050_INTERRUPT_DATA_RDY_BIT 0
214 
215 // TODO: figure out what these actually do
216 // UMPL source code is not very obivous
217 #define MPU6050_DMPINT_5_BIT 5
218 #define MPU6050_DMPINT_4_BIT 4
219 #define MPU6050_DMPINT_3_BIT 3
220 #define MPU6050_DMPINT_2_BIT 2
221 #define MPU6050_DMPINT_1_BIT 1
222 #define MPU6050_DMPINT_0_BIT 0
223 
224 #define MPU6050_MOTION_MOT_XNEG_BIT 7
225 #define MPU6050_MOTION_MOT_XPOS_BIT 6
226 #define MPU6050_MOTION_MOT_YNEG_BIT 5
227 #define MPU6050_MOTION_MOT_YPOS_BIT 4
228 #define MPU6050_MOTION_MOT_ZNEG_BIT 3
229 #define MPU6050_MOTION_MOT_ZPOS_BIT 2
230 #define MPU6050_MOTION_MOT_ZRMOT_BIT 0
231 
232 /****************Path Rest************************/
233 #define MPU6050_PATHRESET_GYRO_RESET_BIT 2
234 #define MPU6050_PATHRESET_ACCEL_RESET_BIT 1
235 #define MPU6050_PATHRESET_TEMP_RESET_BIT 0
236 
237 #define MPU6050_USERCTRL_DMP_EN_BIT 7
238 #define MPU6050_USERCTRL_FIFO_EN_BIT 6
239 #define MPU6050_USERCTRL_I2C_MST_EN_BIT 5
240 #define MPU6050_USERCTRL_I2C_IF_DIS_BIT 4
241 #define MPU6050_USERCTRL_DMP_RESET_BIT 3
242 #define MPU6050_USERCTRL_FIFO_RESET_BIT 2
243 #define MPU6050_USERCTRL_I2C_MST_RESET_BIT 1
244 #define MPU6050_USERCTRL_SIG_COND_RESET_BIT 0
245 
246 /************Power Management************************/
247 #define MPU6050_PWR1_DEVICE_RESET_BIT 7
248 #define MPU6050_PWR1_SLEEP_BIT 6
249 #define MPU6050_PWR1_CYCLE_BIT 5
250 #define MPU6050_PWR1_TEMP_DIS_BIT 3
251 #define MPU6050_PWR1_CLKSEL_BIT 2
252 #define MPU6050_PWR1_CLKSEL_LENGTH 3
253 
254 #define MPU6050_PWR2_LP_WAKE_CTRL_BIT 7
255 #define MPU6050_PWR2_LP_WAKE_CTRL_LENGTH 2
256 #define MPU6050_PWR2_STBY_XA_BIT 5
257 #define MPU6050_PWR2_STBY_YA_BIT 4
258 #define MPU6050_PWR2_STBY_ZA_BIT 3
259 #define MPU6050_PWR2_STBY_XG_BIT 2
260 #define MPU6050_PWR2_STBY_YG_BIT 1
261 #define MPU6050_PWR2_STBY_ZG_BIT 0
262 
263 #define MPU6050_WAKE_FREQ_1P25 0x0
264 #define MPU6050_WAKE_FREQ_2P5 0x1
265 #define MPU6050_WAKE_FREQ_5 0x2
266 
267 #endif /* MPU6050_H_ */
void MPU6050_READ_DATA(MPU6050_HandleTypeDef *sMPU6050, uint8_t Reg_addr, uint8_t *sensor_buffer)
This function reads a register from the MPU6050 without interrupts, and stores it into a buffer...
Definition: MPU6050.c:252
+
float _X_ACCEL
Definition: MPU6050.h:50
+
float _Z_ACCEL
Definition: MPU6050.h:52
+
uint8_t _ID
Definition: MPU6050.h:42
+
float _Z_GYRO
Definition: MPU6050.h:49
+
float _X_GYRO
Definition: MPU6050.h:47
void MPU6050_set_LPF(MPU6050_HandleTypeDef *sMPU6050, uint8_t lpf)
This function allows you to set the value of the LPF manually. Please see https://cdn.sparkfun.com/datasheets/Sensors/Accelerometers/RM-MPU-6000A.pdf for descriptions of what each value does.
Definition: MPU6050.c:84
This file defines macros used throughout various parts of the system that engage in non-blocking I/O ...
-
float _Y_ACCEL
Definition: MPU6050.h:47
+
float _Y_ACCEL
Definition: MPU6050.h:51
void MPU6050_manually_set_offsets(MPU6050_HandleTypeDef *sMPU6050)
This function is used to manually set the offsets of the accelerometer and gyroscope based on empiric...
Definition: MPU6050.c:64
void MPU6050_Read_Accelerometer_Withoffset_IT(MPU6050_HandleTypeDef *sMPU6050)
This function reads the accelerometer using interrupts.
Definition: MPU6050.c:111
void MPU6050_Read_Gyroscope_Withoffset_IT(MPU6050_HandleTypeDef *sMPU6050)
This function reads the gyroscope using interrupts.
Definition: MPU6050.c:189
@@ -106,11 +106,11 @@
void MPU6050_Read_Gyroscope_Withoffset(MPU6050_HandleTypeDef *sMPU6050)
This function reads the gyroscope without using interrupts.
Definition: MPU6050.c:223
uint8_t MPU6050_READ_REG(MPU6050_HandleTypeDef *sMPU6050, uint8_t reg_addr)
This function reads from an MPU6050 register and returns it directly.
Definition: MPU6050.c:301
BaseType_t MPU6050_READ_DATA_IT(MPU6050_HandleTypeDef *sMPU6050, uint8_t Reg_addr, uint8_t *sensor_buffer)
This function reads a register from the MPU6050 with interrupts, and stores it into a buffer...
Definition: MPU6050.c:271
-
float _Y_GYRO
Definition: MPU6050.h:44
-
uint32_t _BaudRate
Definition: MPU6050.h:39
+
float _Y_GYRO
Definition: MPU6050.h:48
+
uint32_t _BaudRate
Definition: MPU6050.h:43
void MPU6050_WRITE_REG(MPU6050_HandleTypeDef *sMPU6050, uint8_t reg_addr, uint8_t data)
This function writes to a register from the MPU6050.
Definition: MPU6050.c:290
void MPU6050_init(MPU6050_HandleTypeDef *sMPU6050)
This function is used as the first step of initialization of an MPU6050_HandleTypeDef struct...
Definition: MPU6050.c:37
-
Definition: MPU6050.h:37
+
Data structure to organize MPU6050 configuration details and sensor readings.
Definition: MPU6050.h:41
diff --git a/Robot/Doc/html/_m_p_u_filter_8h_source.html b/Robot/Doc/html/_m_p_u_filter_8h_source.html index 83bc32ba..16405002 100644 --- a/Robot/Doc/html/_m_p_u_filter_8h_source.html +++ b/Robot/Doc/html/_m_p_u_filter_8h_source.html @@ -93,7 +93,7 @@ Go to the documentation of this file.
1 
11 /******************************* SOURCE LICENSE *********************************
12 Copyright (c) 2018 MicroModeler.
13 
14 A non-exclusive, nontransferable, perpetual, royalty-free license is granted to the Licensee to
15 use the following Information for academic, non-profit, or government-sponsored research purposes.
16 Use of the following Information under this License is restricted to NON-COMMERCIAL PURPOSES ONLY.
17 Commercial use of the following Information requires a separately executed written license agreement.
18 
19 This Information is distributed WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 
22 ******************************* END OF LICENSE *********************************/
23 // Link with library: libarm_cortexM4_mathL.a (or equivalent)
24 // Add CMSIS/Lib/GCC to the library search path
25 // Add CMSIS/Include to the include search path
26 // A commercial license for MicroModeler DSP can be obtained at http://www.micromodeler.com/launch.jsp
27 
28 
29 
30 
31 /******************** Define to prevent recursive inclusion ******************/
32 #ifndef __MPUFILTER_H__
33 #define __MPUFILTER_H__
34 
35 
36 
37 
38 /********************************** Macros ***********************************/
39 // Note: This needs to be defined before arm_math.h is included
40 #define ARM_MATH_CM4 // Use ARM Cortex M4
41 
42 
43 
44 
45 /********************************* Includes **********************************/
46 #include "stm32f446xx.h" // __FPU_PRESENT == 1 ==> generate FPU instructions
47 #include <arm_math.h> // Include CMSIS header
48 #include "MPU6050.h"
49 
50 
51 
52 
53 /***************************** Function prototypes ***************************/
56 
57 #endif /* __MPUFILTER_H__ */
void MPUFilter_InitAllFilters()
Initialize acceleration and angular velocity FIR filters for IMU data.
Definition: MPUFilter.c:160
Header code for the MPU6050 library, including the struct in which accelerometer and gyroscope data a...
void MPUFilter_FilterAngularVelocity(MPU6050_HandleTypeDef *IMUdata)
Reads Vz, Vy, and Vx from the IMU handle and writes them into their corresponding FIR filters...
Definition: MPUFilter.c:173
-
Definition: MPU6050.h:37
+
Data structure to organize MPU6050 configuration details and sensor readings.
Definition: MPU6050.h:41
diff --git a/Robot/Doc/html/_m_x28_8h_source.html b/Robot/Doc/html/_m_x28_8h_source.html index fedad68f..142829a1 100644 --- a/Robot/Doc/html/_m_x28_8h_source.html +++ b/Robot/Doc/html/_m_x28_8h_source.html @@ -93,7 +93,7 @@ Go to the documentation of this file.
1 
17 /******************** Define to prevent recursive inclusion ******************/
18 #ifndef __MX28_H__
19 #define __MX28_H__
20 
21 
22 
23 
24 /********************************* Includes **********************************/
25 #include "../Dynamixel_HandleTypeDef.h"
26 
27 
28 
29 
30 /********************************** Macros ***********************************/
31 /* Value limit definitions */
32 #define MX28_MAX_VELOCITY 117
34 /* Register addresses */
35 #define MX28_REG_MULTI_TURN_OFFSET 0x14
36 #define MX28_REG_RESOLUTION_DIVIDER 0x16
37 #define MX28_REG_D_GAIN 0x1A
38 #define MX28_REG_I_GAIN 0x1B
39 #define MX28_REG_P_GAIN 0x1C
40 #define MX28_REG_GOAL_ACCELERATION 0x49
42 /* Default register value definitions */
43 #define MX28_DEFAULT_BAUD_RATE 0x22
44 #define MX28_DEFAULT_CCW_ANGLE_LIMIT 0x0FFF
45 #define MX28_DEFAULT_HIGHEST_VOLTAGE_LIMIT 0xA0
46 #define MX28_DEFAULT_D_GAIN 0x08
47 #define MX28_DEFAULT_I_GAIN 0x00
48 #define MX28_DEFAULT_P_GAIN 0x08
49 #define MX28_DEFAULT_PUNCH 0x0000
54 /***************************** Function prototypes ***************************/
55 // Setters (use the WRITE DATA instruction)
56 void MX28_SetMultiTurnOffset(Dynamixel_HandleTypeDef* hdynamixel, int16_t offset);
57 void MX28_SetResolutionDivider(Dynamixel_HandleTypeDef* hdynamixel, uint8_t divider);
58 void MX28_SetDGain(Dynamixel_HandleTypeDef* hdynamixel, uint8_t DGain);
59 void MX28_SetIGain(Dynamixel_HandleTypeDef* hdynamixel, uint8_t IGain);
60 void MX28_SetPGain(Dynamixel_HandleTypeDef* hdynamixel, uint8_t PGain);
61 void MX28_SetGoalAcceleration(Dynamixel_HandleTypeDef* hdynamixel, float goalAcceleration);
62 
63 // Interfaces for previously-defined functions
65 
69 /* end MX28Header */
70 
71 #endif /* __MX28_H__ */
void MX28_SetIGain(Dynamixel_HandleTypeDef *hdynamixel, uint8_t IGain)
Sets the value of the integral gain used in the motor&#39;s PID controller.
Definition: MX28.c:126
void MX28_EnterMultiTurnMode(Dynamixel_HandleTypeDef *hdynamixel)
Activates multi-turn mode, which allows the actuator to have a range of controllable position values ...
Definition: MX28.c:211
void MX28_SetPGain(Dynamixel_HandleTypeDef *hdynamixel, uint8_t PGain)
Sets the value of the proportional gain used in the motor&#39;s PID controller.
Definition: MX28.c:142
-
Definition: Dynamixel_HandleTypeDef.h:39
+
Organizes all the information relevant to a motor.
Definition: Dynamixel_HandleTypeDef.h:39
void MX28_SetResolutionDivider(Dynamixel_HandleTypeDef *hdynamixel, uint8_t divider)
Unimplemented. This function should change the resolution divider, allowing for more precise or less ...
Definition: MX28.c:97
void MX28_SetMultiTurnOffset(Dynamixel_HandleTypeDef *hdynamixel, int16_t offset)
For an actuator in multi-turn mode, this applies a tunable offset to all positions. That is it allows you to change where the actuator considers position 0 to be. For an actuator not in multi-turn mode, this setting has no effect.
Definition: MX28.c:73
void MX28_SetDGain(Dynamixel_HandleTypeDef *hdynamixel, uint8_t DGain)
Sets the value of the derivative gain used in the motor&#39;s PID controller.
Definition: MX28.c:110
diff --git a/Robot/Doc/html/_u_a_r_t___handler_8c.html b/Robot/Doc/html/_u_a_r_t___handler_8c.html index 9f87f110..b9f981ac 100644 --- a/Robot/Doc/html/_u_a_r_t___handler_8c.html +++ b/Robot/Doc/html/_u_a_r_t___handler_8c.html @@ -122,8 +122,8 @@

@@ -584,7 +585,7 @@

 This function reads from an MPU6050 register and returns it directly. More...
 
void MPU6050_init (MPU6050_HandleTypeDef *sMPU6050)
 This function is used as the first step of initialization of an MPU6050_HandleTypeDef struct. More...
 This function is used as the first step of initialization of an MPU6050_HandleTypeDef struct. More...
 
void MPU6050_user_calibration (MPU6050_HandleTypeDef *sMPU6050)
- - + +

Variables

osMessageQId UART_rxHandle
 
osMessageQId TXQueueHandle
 

Detailed Description

This file implements a generic event processor for UART events, which occur when commands for the motors need to be distributed.

diff --git a/Robot/Doc/html/_u_a_r_t___handler_8c.js b/Robot/Doc/html/_u_a_r_t___handler_8c.js index 03482b94..67786bdc 100644 --- a/Robot/Doc/html/_u_a_r_t___handler_8c.js +++ b/Robot/Doc/html/_u_a_r_t___handler_8c.js @@ -1,5 +1,5 @@ var _u_a_r_t___handler_8c = [ [ "UART_ProcessEvent", "group___u_a_r_t___handler.html#ga9714c8eb77aab0d3a5719e5233d397ca", null ], - [ "UART_rxHandle", "group___u_a_r_t___handler.html#gade81e4b71063ca3c76b947f6adf50d88", null ] + [ "TXQueueHandle", "group___u_a_r_t___handler.html#ga4f2e3ebb92cb44b567285706fa6e6c3c", null ] ]; \ No newline at end of file diff --git a/Robot/Doc/html/_u_a_r_t___handler_8h.html b/Robot/Doc/html/_u_a_r_t___handler_8h.html index dfe4ff59..a56a6442 100644 --- a/Robot/Doc/html/_u_a_r_t___handler_8h.html +++ b/Robot/Doc/html/_u_a_r_t___handler_8h.html @@ -129,8 +129,10 @@

Data Structures

struct  UARTcmd_t + The container type for motor commands. The control thread sends these to the various UART handlers through the UART queues. The container provides all the information needed to generate the appropriate motor action (reading from or writing to motor command registers) More...
  struct  TXData_t + This is the data structure copied into the sensor queue, and read by the thread that sends data to the PC. It includes 2 fields: one that indicates the type of data it encapsulates, and the other pointing to the data. More...
  + +

@@ -139,10 +141,12 @@ cmdWritePosition, cmdWriteTorque }

 Enumerates the types of motor commands that can be sent to the UART handlers. More...
 
enum  eTXData_t { eMotorData, eIMUData }
 Enumerates the types of data that can be sent to the sensor queue. This is used so that the reader of the queue will know how to typecast the void pointer so that the data can be interpreted correctly. See TXData_t for more details. More...
 
- - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -227,60 +227,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -290,24 +281,33 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -353,14 +353,14 @@ - - - - - - + + + + + + @@ -439,6 +439,18 @@

diff --git a/Robot/Doc/html/_u_a_r_t___handler_8h_source.html b/Robot/Doc/html/_u_a_r_t___handler_8h_source.html index 04ab1ae1..5af7a2f0 100644 --- a/Robot/Doc/html/_u_a_r_t___handler_8h_source.html +++ b/Robot/Doc/html/_u_a_r_t___handler_8h_source.html @@ -90,23 +90,23 @@
UART_Handler.h
-Go to the documentation of this file.
1 
21 /******************** Define to prevent recursive inclusion *******************/
22 #ifndef __UART_HANDLER_H__
23 #define __UART_HANDLER_H__
24 
25 
26 
27 
28 /********************************** Includes **********************************/
29 #include "../Drivers/Dynamixel/DynamixelProtocolV1.h"
30 #include "cmsis_os.h"
31 
32 
33 
34 
35 /*********************************** Types ************************************/
39 typedef enum{
43 }eUARTcmd_t;
44 
51 typedef struct {
56  float value;
59  QueueHandle_t qHandle;
61 }UARTcmd_t;
62 
69 typedef enum{
73 }eTXData_t;
74 
85 typedef struct {
87  void* pData;
88 }TXData_t;
89 
90 
91 
92 
93 /***************************** Function prototypes ****************************/
94 void UART_ProcessEvent(UARTcmd_t* cmdPtr, TXData_t* DataToSend);
95 
99 /* end UART_HandlerHeader */
100 
101 #endif /* __UART_HANDLER_H__ */
eUARTcmd_t type
Definition: UART_Handler.h:52
-
Definition: UART_Handler.h:70
-
Definition: Dynamixel_HandleTypeDef.h:39
-
Definition: UART_Handler.h:85
+Go to the documentation of this file.
1 
21 /******************** Define to prevent recursive inclusion *******************/
22 #ifndef __UART_HANDLER_H__
23 #define __UART_HANDLER_H__
24 
25 
26 
27 
28 /********************************** Includes **********************************/
29 #include "../Drivers/Dynamixel/DynamixelProtocolV1.h"
30 #include "cmsis_os.h"
31 
32 
33 
34 
35 /*********************************** Types ************************************/
40 typedef enum{
44 }eUARTcmd_t;
45 
52 typedef struct {
57  float value;
60  QueueHandle_t qHandle;
62 }UARTcmd_t;
63 
70 typedef enum{
74 }eTXData_t;
75 
87 typedef struct {
89  void* pData;
90 }TXData_t;
91 
92 
93 
94 
95 /***************************** Function prototypes ****************************/
96 void UART_ProcessEvent(UARTcmd_t* cmdPtr, TXData_t* DataToSend);
97 
101 /* end UART_HandlerHeader */
102 
103 #endif /* __UART_HANDLER_H__ */
eUARTcmd_t type
Definition: UART_Handler.h:53
+
Definition: UART_Handler.h:71
+
Organizes all the information relevant to a motor.
Definition: Dynamixel_HandleTypeDef.h:39
+
This is the data structure copied into the sensor queue, and read by the thread that sends data to th...
Definition: UART_Handler.h:87
void UART_ProcessEvent(UARTcmd_t *cmdPtr, TXData_t *DataToSend)
The UART event processor calls the low-level libraries to execute reads and writes for motors...
Definition: UART_Handler.c:43
-
QueueHandle_t qHandle
Definition: UART_Handler.h:59
-
eTXData_t
Definition: UART_Handler.h:69
-
void * pData
Definition: UART_Handler.h:87
-
Definition: UART_Handler.h:40
-
float value
Definition: UART_Handler.h:56
-
Definition: UART_Handler.h:41
-
eTXData_t eDataType
Definition: UART_Handler.h:86
-
Dynamixel_HandleTypeDef * motorHandle
Definition: UART_Handler.h:54
-
Definition: UART_Handler.h:42
-
Definition: UART_Handler.h:72
-
eUARTcmd_t
Definition: UART_Handler.h:39
-
Definition: UART_Handler.h:51
+
QueueHandle_t qHandle
Definition: UART_Handler.h:60
+
eTXData_t
Enumerates the types of data that can be sent to the sensor queue. This is used so that the reader of...
Definition: UART_Handler.h:70
+
void * pData
Definition: UART_Handler.h:89
+
Definition: UART_Handler.h:41
+
float value
Definition: UART_Handler.h:57
+
Definition: UART_Handler.h:42
+
eTXData_t eDataType
Definition: UART_Handler.h:88
+
Dynamixel_HandleTypeDef * motorHandle
Definition: UART_Handler.h:55
+
Definition: UART_Handler.h:43
+
Definition: UART_Handler.h:73
+
eUARTcmd_t
Enumerates the types of motor commands that can be sent to the UART handlers.
Definition: UART_Handler.h:40
+
The container type for motor commands. The control thread sends these to the various UART handlers th...
Definition: UART_Handler.h:52
diff --git a/Robot/Doc/html/annotated.html b/Robot/Doc/html/annotated.html index 4ac72bf2..c3570b57 100644 --- a/Robot/Doc/html/annotated.html +++ b/Robot/Doc/html/annotated.html @@ -92,13 +92,13 @@
Here are the data structures with brief descriptions:
- - + + - - - - + + + +
 CDynamixel_HandleTypeDef
 CMPU6050_HandleTypeDef
 CDynamixel_HandleTypeDefOrganizes all the information relevant to a motor
 CMPU6050_HandleTypeDefData structure to organize MPU6050 configuration details and sensor readings
 CMPUFilterVel_tContainer for angular velocity filter
 Crobot_goal
 Crobot_state
 CTXData_t
 CUARTcmd_t
 Crobot_goalData structure sent from the PC to the MCU. Contains "goal" motor positions
 Crobot_stateData structure sent from the MCU to the PC. Contains sensor data
 CTXData_tThis is the data structure copied into the sensor queue, and read by the thread that sends data to the PC. It includes 2 fields: one that indicates the type of data it encapsulates, and the other pointing to the data
 CUARTcmd_tThe container type for motor commands. The control thread sends these to the various UART handlers through the UART queues. The container provides all the information needed to generate the appropriate motor action (reading from or writing to motor command registers)
diff --git a/Robot/Doc/html/freertos_8c.html b/Robot/Doc/html/freertos_8c.html index 64d918a4..7a4bea94 100644 --- a/Robot/Doc/html/freertos_8c.html +++ b/Robot/Doc/html/freertos_8c.html @@ -170,36 +170,36 @@

void StartDefaultTask (void const *argument)
 
-void MX_FREERTOS_Init (void)
 
void StartCommandTask (void const *argument)
 This function is executed in the context of the commandTask thread. It initializes all data structures and peripheral devices associated with the application, and then assumes responsibility for distributing commands to the actuators. More...
 
void UART1_Handler (void const *argument)
 This function is executed in the context of the UART1_ thread. It processes all commands for the motors physically connected to UART1, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void UART2_Handler (void const *argument)
 This function is executed in the context of the UART2_ thread. It processes all commands for the motors physically connected to UART2, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void UART3_Handler (void const *argument)
 This function is executed in the context of the UART3_ thread. It processes all commands for the motors physically connected to UART3, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void UART4_Handler (void const *argument)
 This function is executed in the context of the UART4_ thread. It processes all commands for the motors physically connected to UART4, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void UART6_Handler (void const *argument)
 This function is executed in the context of the UART6_ thread. It processes all commands for the motors physically connected to UART6, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void StartUART1Task (void const *argument)
 This function is executed in the context of the UART1_ thread. It processes all commands for the motors physically connected to UART1, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void StartUART2Task (void const *argument)
 This function is executed in the context of the UART2_ thread. It processes all commands for the motors physically connected to UART2, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void StartUART3Task (void const *argument)
 This function is executed in the context of the UART3_ thread. It processes all commands for the motors physically connected to UART3, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void StartUART4Task (void const *argument)
 This function is executed in the context of the UART4_ thread. It processes all commands for the motors physically connected to UART4, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void StartUART6Task (void const *argument)
 This function is executed in the context of the UART6_ thread. It processes all commands for the motors physically connected to UART6, and initiates the I/O calls to them. Whenever it processes read commands for a motor, it sends the data received to the multi-writer sensor queue, which is read only by the TX task. More...
 
void StartIMUTask (void const *argument)
 This function is executed in the context of the IMUTask thread. During each control cycle, this thread fetches accelerometer and gyroscope data, then sends this data to the multi-writer sensor queue, which is read only by the TX task. More...
 
void StartCommandTask (void const *argument)
 This function is executed in the context of the commandTask thread. It initializes all data structures and peripheral devices associated with the application, and then assumes responsibility for distributing commands to the actuators. More...
 
void StartRxTask (void const *argument)
 This function is executed in the context of the RxTask thread. It initiates DMA-based receptions of RobotGoals from the PC via UART5. Upon successful reception of a RobotGoal, the UARTx_ and IMUTask threads are unblocked. More...
 
void StartTxTask (void const *argument)
 This function is executed in the context of the TxTask thread. This thread is blocked until all sensor data has been received through the sensor queue. After this time, the UARTx_ and IMUTask will be blocked. Then, a DMA-based transmission of a RobotState is sent to the PC via UART5. More...
 
+void MX_FREERTOS_Init (void)
 
void vApplicationGetIdleTaskMemory (StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize)
 
osStaticThreadDef_t defaultTaskControlBlock
 
-osThreadId commandTaskHandle
 
-uint32_t commandTaskBuffer [512]
 
-osStaticThreadDef_t commandTaskControlBlock
 
-osThreadId UART1_Handle
 
-uint32_t UART1_Buffer [128]
 
-osStaticThreadDef_t UART1_ControlBlock
 
-osThreadId UART2_Handle
 
-uint32_t UART2_Buffer [128]
 
-osStaticThreadDef_t UART2_ControlBlock
 
-osThreadId UART3_Handle
 
-uint32_t UART3_Buffer [128]
 
-osStaticThreadDef_t UART3_ControlBlock
 
-osThreadId UART4_Handle
 
-uint32_t UART4_Buffer [128]
 
-osStaticThreadDef_t UART4_ControlBlock
 
-osThreadId UART6_Handle
 
-uint32_t UART6_Buffer [128]
 
-osStaticThreadDef_t UART6_ControlBlock
 
+osThreadId UART1TaskHandle
 
+uint32_t UART1TaskBuffer [128]
 
+osStaticThreadDef_t UART1TaskControlBlock
 
+osThreadId UART2TaskHandle
 
+uint32_t UART2TaskBuffer [128]
 
+osStaticThreadDef_t UART2TaskControlBlock
 
+osThreadId UART3TaskHandle
 
+uint32_t UART3TaskBuffer [128]
 
+osStaticThreadDef_t UART3TaskControlBlock
 
+osThreadId UART4TaskHandle
 
+uint32_t UART4TaskBuffer [128]
 
+osStaticThreadDef_t UART4TaskControlBlock
 
+osThreadId UART6TaskHandle
 
+uint32_t UART6TaskBuffer [128]
 
+osStaticThreadDef_t UART6TaskControlBlock
 
osThreadId IMUTaskHandle
 
osStaticThreadDef_t IMUTaskControlBlock
 
-osThreadId rxTaskHandle
 
-uint32_t rxTaskBuffer [512]
 
-osStaticThreadDef_t rxTaskControlBlock
 
-osThreadId txTaskHandle
 
-uint32_t txTaskBuffer [512]
 
-osStaticThreadDef_t txTaskControlBlock
 
+osThreadId CommandTaskHandle
 
+uint32_t CommandTaskBuffer [512]
 
+osStaticThreadDef_t CommandTaskControlBlock
 
+osThreadId RxTaskHandle
 
+uint32_t RxTaskBuffer [512]
 
+osStaticThreadDef_t RxTaskControlBlock
 
+osThreadId TxTaskHandle
 
+uint32_t TxTaskBuffer [512]
 
+osStaticThreadDef_t TxTaskControlBlock
 
osMessageQId UART1_reqHandle
 
osStaticMessageQDef_t UART6_reqControlBlock
 
osMessageQId UART_rxHandle
 
-uint8_t UART_rxBuffer [32 *sizeof(UARTcmd_t)]
 
-osStaticMessageQDef_t UART_rxControlBlock
 
osMessageQId TXQueueHandle
 
+uint8_t TXQueueBuffer [32 *sizeof(TXData_t)]
 
+osStaticMessageQDef_t TXQueueControlBlock
 
osMutexId PCUARTHandle
 

Detailed Description

Code for freertos application.

+

File Name : freertos.c Description : Code for freertos applications

+

This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners.

+

Copyright (c) 2018 STMicroelectronics International N.V. All rights reserved.

+

Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met:

+
    +
  1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. +
  3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  4. +
  5. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission.
  6. +
  7. This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics.
  8. +
  9. Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license.
  10. +
+

THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author
Gokul
Tyler
diff --git a/Robot/Doc/html/freertos_8c.js b/Robot/Doc/html/freertos_8c.js index d3e6589e..5378412e 100644 --- a/Robot/Doc/html/freertos_8c.js +++ b/Robot/Doc/html/freertos_8c.js @@ -30,15 +30,15 @@ var freertos_8c = [ "StartIMUTask", "group___threads.html#ga2b1b4b3fe51fe46654895c7626bf83bd", null ], [ "StartRxTask", "group___threads.html#gaf50979eaf2ad1b106c5514b33138a434", null ], [ "StartTxTask", "group___threads.html#gabfae5c57e07c9a086f73340d2aee1a7b", null ], - [ "UART1_Handler", "group___threads.html#gabb7badba6cdb3ff61f2dff35b5a9ff2c", null ], - [ "UART2_Handler", "group___threads.html#gafd685a32f5ae07a72d480671f7c646d5", null ], - [ "UART3_Handler", "group___threads.html#ga478be609d54754b09cd8bdaee19aaf65", null ], - [ "UART4_Handler", "group___threads.html#ga099b379cd3d7afbd65e8009d5bcae63f", null ], - [ "UART6_Handler", "group___threads.html#gaeaecd9665005d7d4414f1e30828e89a9", null ], + [ "StartUART1Task", "group___threads.html#gadc2ba415e0f9e676e5906f2cae0be0c7", null ], + [ "StartUART2Task", "group___threads.html#gace242633a4776f26ce5ccea02f87436a", null ], + [ "StartUART3Task", "group___threads.html#ga928fcff8baaf66bc24bf6a5e84b52424", null ], + [ "StartUART4Task", "group___threads.html#gad07ae38e26b77f8241361f1f6d501863", null ], + [ "StartUART6Task", "group___threads.html#gab48676fff631b962b0a8e5d11df84fbf", null ], [ "vApplicationGetIdleTaskMemory", "freertos_8c.html#a1988aa923b19fa6f31c93afa7773f793", null ], - [ "commandTaskBuffer", "freertos_8c.html#a3c7c61f94eb90ed3b8b7a635e0afc881", null ], - [ "commandTaskControlBlock", "freertos_8c.html#a14ff070d109bfc8e915f91f8edb93dcd", null ], - [ "commandTaskHandle", "freertos_8c.html#abca5ae79d68392bed5acba7016a9772c", null ], + [ "CommandTaskBuffer", "freertos_8c.html#a6bda9758317b7a21f8e124ab50be6d1d", null ], + [ "CommandTaskControlBlock", "freertos_8c.html#a2c851b3a1c3fbdbf512ac69a523aaa84", null ], + [ "CommandTaskHandle", "freertos_8c.html#a86821eaed664c48c071665bc3894b140", null ], [ "defaultTaskBuffer", "freertos_8c.html#a0ef1a80eb9a31084b335d4b71c24e001", null ], [ "defaultTaskControlBlock", "freertos_8c.html#aca18732f09ae696fd34b94d393dc9a42", null ], [ "defaultTaskHandle", "freertos_8c.html#aa658fe134a5d1309d7a15c8116fa142c", null ], @@ -67,46 +67,46 @@ var freertos_8c = [ "Motor9", "freertos_8c.html#af0ac589cf979a4687cbbf6047713f216", null ], [ "PCUARTControlBlock", "freertos_8c.html#a38a6787624391c0a0a1116e9da3203aa", null ], [ "PCUARTHandle", "freertos_8c.html#a1823938c87480c88a635c070d3238efb", null ], - [ "rxTaskBuffer", "freertos_8c.html#af4f5f44ae6c9b982651f3d31e0cb6423", null ], - [ "rxTaskControlBlock", "freertos_8c.html#a02464f95c64666dd2dc00619e705ceb7", null ], - [ "rxTaskHandle", "freertos_8c.html#aa09dc533387f9ebef95327853c8b595a", null ], + [ "RxTaskBuffer", "freertos_8c.html#aa1b128f5417649621f7dd5f9a03d4bd0", null ], + [ "RxTaskControlBlock", "freertos_8c.html#acdb584e21ef8e432d0ff52c655ece32c", null ], + [ "RxTaskHandle", "freertos_8c.html#aa5b996363967b8aaf360f18eadbf651d", null ], [ "setupIsDone", "freertos_8c.html#a9eb2be76c074cc3a7544564a1c8a7340", null ], - [ "txTaskBuffer", "freertos_8c.html#a8334ce7bd4272f0c578ff78bbd28f6fb", null ], - [ "txTaskControlBlock", "freertos_8c.html#a9d3ad79bce824dc2ada66df5a13f641a", null ], - [ "txTaskHandle", "freertos_8c.html#a6777afabed87550002ee631be769ca74", null ], - [ "UART1_Buffer", "freertos_8c.html#ad57d4b39c32e6d2f5e14d18785466358", null ], - [ "UART1_ControlBlock", "freertos_8c.html#a2dc985ea36f7664c0db24809bf0c1f3d", null ], - [ "UART1_Handle", "freertos_8c.html#aab6d3bdb9f6cc41726dcd9127c249c2d", null ], + [ "TXQueueBuffer", "freertos_8c.html#a26d708465d981447743dcd28034831cb", null ], + [ "TXQueueControlBlock", "freertos_8c.html#a1914e57fd70ae8a4ab6faad4b481f713", null ], + [ "TXQueueHandle", "group___u_a_r_t___handler.html#ga4f2e3ebb92cb44b567285706fa6e6c3c", null ], + [ "TxTaskBuffer", "freertos_8c.html#ad1986bdf371dfac41e6d881286bfc0e3", null ], + [ "TxTaskControlBlock", "freertos_8c.html#a027101c1feff4b03379bcdbe2801dfb1", null ], + [ "TxTaskHandle", "freertos_8c.html#ad05fa2ac113dfe10786ba05ad1c22f67", null ], [ "UART1_reqBuffer", "freertos_8c.html#a796d693f5d46e5540ec8ca1462671835", null ], [ "UART1_reqControlBlock", "freertos_8c.html#a04ba5a2483e03c4f55466fcd0a9e4de7", null ], [ "UART1_reqHandle", "freertos_8c.html#a0d6af9c7c799cadbfdbfdef3204907d2", null ], - [ "UART2_Buffer", "freertos_8c.html#a393c94e85933e8b0cc88c6e66b745960", null ], - [ "UART2_ControlBlock", "freertos_8c.html#a922382cff62432f7fab1a81cd45f73ee", null ], - [ "UART2_Handle", "freertos_8c.html#adba26ce4b878fc7fcb2db9546eba8051", null ], + [ "UART1TaskBuffer", "freertos_8c.html#abb001192704266ac30b6707ecf17142e", null ], + [ "UART1TaskControlBlock", "freertos_8c.html#a1885458af8741301b2753b837ff617b8", null ], + [ "UART1TaskHandle", "freertos_8c.html#acbb065c8ad964277ca665347acf9c101", null ], [ "UART2_reqBuffer", "freertos_8c.html#a3f227b6b5d45b449ef392d809ac592eb", null ], [ "UART2_reqControlBlock", "freertos_8c.html#a88069dfa083311d528c603c00f699c04", null ], [ "UART2_reqHandle", "freertos_8c.html#ae60af5bf8fec35483818c6105a38a6b3", null ], - [ "UART3_Buffer", "freertos_8c.html#abb6529490dad7751ade1df136c5d5b33", null ], - [ "UART3_ControlBlock", "freertos_8c.html#a7da9719affac2bab9d30fc2eec83789e", null ], - [ "UART3_Handle", "freertos_8c.html#ad585d07c19973263354b0e4fd062faec", null ], + [ "UART2TaskBuffer", "freertos_8c.html#a3fc678145162f28fbb89f077b3d9e01c", null ], + [ "UART2TaskControlBlock", "freertos_8c.html#adb9fea3a17b8391c5d05018cc5b5763d", null ], + [ "UART2TaskHandle", "freertos_8c.html#a57fc0acc4e3e760d9611e275218d5464", null ], [ "UART3_reqBuffer", "freertos_8c.html#a2e0b30d5e7ec72aaf867e4cad0ae9e20", null ], [ "UART3_reqControlBlock", "freertos_8c.html#ad90b6893f276964c3a3fc8fca75e3ccf", null ], [ "UART3_reqHandle", "freertos_8c.html#ad2e184a43c4ffe52d133cea3fe7b630a", null ], - [ "UART4_Buffer", "freertos_8c.html#ac7338b8475678301d38e308537faee91", null ], - [ "UART4_ControlBlock", "freertos_8c.html#abe42300683d75b73464223992ba649c0", null ], - [ "UART4_Handle", "freertos_8c.html#acda81d976d119571ad2e3125baadc783", null ], + [ "UART3TaskBuffer", "freertos_8c.html#a89957d6aeeeb36264ba1d47b6571358c", null ], + [ "UART3TaskControlBlock", "freertos_8c.html#a4da7c9bd3c283e9c9b1fdaff7de0ba69", null ], + [ "UART3TaskHandle", "freertos_8c.html#a0ec3f32c24e2f9191a4d446b77c980e1", null ], [ "UART4_reqBuffer", "freertos_8c.html#ac8a41139c630a801b8b686c79efc4956", null ], [ "UART4_reqControlBlock", "freertos_8c.html#a1a8546127cd980482abbb922b73a6f73", null ], [ "UART4_reqHandle", "freertos_8c.html#a1bf511ac2d955da81f3716c498e5fa8c", null ], - [ "UART6_Buffer", "freertos_8c.html#ad827782c580b469829e5783ed34e99aa", null ], - [ "UART6_ControlBlock", "freertos_8c.html#a131664dd99efed67e1b6fedc9caa7a70", null ], - [ "UART6_Handle", "freertos_8c.html#ad8eee195035732883a8c48f27000d22c", null ], + [ "UART4TaskBuffer", "freertos_8c.html#aa6a32d4e76e8a08c418a9db6aff4d998", null ], + [ "UART4TaskControlBlock", "freertos_8c.html#a19f975ce65e1841a364bc3a836fb9253", null ], + [ "UART4TaskHandle", "freertos_8c.html#ab1b3c6b338d711d7902af875721d8b5e", null ], [ "UART6_reqBuffer", "freertos_8c.html#a28f6831b849a0dd22792904b9db76843", null ], [ "UART6_reqControlBlock", "freertos_8c.html#afa08bb64da76de841b72398cfe64b156", null ], [ "UART6_reqHandle", "freertos_8c.html#af5f6c93227b0020cdc41cc9abf6fe028", null ], - [ "UART_rxBuffer", "freertos_8c.html#a44c56573b190027c106400058c2a1fe6", null ], - [ "UART_rxControlBlock", "freertos_8c.html#acc7072eff561c639801e29fca10e5f2d", null ], - [ "UART_rxHandle", "group___u_a_r_t___handler.html#gade81e4b71063ca3c76b947f6adf50d88", null ], + [ "UART6TaskBuffer", "freertos_8c.html#aec75b02c1a4d5838bb6c38c5ebcf8b2f", null ], + [ "UART6TaskControlBlock", "freertos_8c.html#a21d2af9db553bd0d065c4d8138626b5a", null ], + [ "UART6TaskHandle", "freertos_8c.html#ae18d9f163e50ea69ddd337a665f3b8f9", null ], [ "xIdleStack", "freertos_8c.html#af311b04396149ce536fe1a3b5f127445", null ], [ "xIdleTaskTCBBuffer", "freertos_8c.html#a2dd1013c5ef8f355ac2f1479e36ec659", null ] ]; \ No newline at end of file diff --git a/Robot/Doc/html/globals_func.html b/Robot/Doc/html/globals_func.html index d35ff1b5..2cb09ed3 100644 --- a/Robot/Doc/html/globals_func.html +++ b/Robot/Doc/html/globals_func.html @@ -420,6 +420,21 @@

- s -

diff --git a/Robot/Doc/html/globals_u.html b/Robot/Doc/html/globals_u.html index 0c9162db..d3b13506 100644 --- a/Robot/Doc/html/globals_u.html +++ b/Robot/Doc/html/globals_u.html @@ -89,28 +89,9 @@
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- u -

diff --git a/Robot/Doc/html/globals_vars.html b/Robot/Doc/html/globals_vars.html index 81763a32..40188f56 100644 --- a/Robot/Doc/html/globals_vars.html +++ b/Robot/Doc/html/globals_vars.html @@ -112,16 +112,16 @@

- d -

Where N = readLength. Also, this function computes the checksum of data using the same algorithm as the motors, and it sets ‘hdynamixel -> _lastReadIsValid’ if the computations match, and clears this field otherwise. This is a basic data integrity check that reduces the probability of passing invalid data to the application

Parameters
- +
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
readAddrthe address inside the motor memory table where reading is to begin
readLengththe number of bytes to be read. Must be either 1 or 2
@@ -391,7 +391,7 @@

Parameters
- +
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
argsan array of arguments of the form {ADDR, PARAM_1, ... , PARAM_N}
numArgsthis must be equal to sizeof(args), and must be either 2 or 3
diff --git a/Robot/Doc/html/group___dynamixel_protocol_v1___public___functions___other.html b/Robot/Doc/html/group___dynamixel_protocol_v1___public___functions___other.html index ba384578..bd3675b5 100644 --- a/Robot/Doc/html/group___dynamixel_protocol_v1___public___functions___other.html +++ b/Robot/Doc/html/group___dynamixel_protocol_v1___public___functions___other.html @@ -141,7 +141,7 @@

Parameters
- +
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor

@@ -177,7 +177,7 @@

Parameters
- +
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
@@ -242,7 +242,7 @@

Parameters
- + diff --git a/Robot/Doc/html/group___dynamixel_protocol_v1___public___functions___setters.html b/Robot/Doc/html/group___dynamixel_protocol_v1___public___functions___setters.html index af3b3181..1addb6e6 100644 --- a/Robot/Doc/html/group___dynamixel_protocol_v1___public___functions___setters.html +++ b/Robot/Doc/html/group___dynamixel_protocol_v1___public___functions___setters.html @@ -197,7 +197,7 @@

Default value: 0x00
Parameters

hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
arrSizethe size of the array to be written (either 1 or 2)
writeAddrthe starting address for where the data is to be written
param1the first parameter
- +
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
isEnabled