Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/actuators/actuators_faulhaber.h"
#include "mcu_periph/uart.h"
#include "mcu_periph/sys_time.h"
#include "modules/datalink/downlink.h"
#include "modules/core/abi.h"
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | faulhaber_parser_t |
Macros | |
#define | FAULHABER_P_GAIN 0.07 |
#define | FAULHABER_MAX_VELOCITY 12000 |
#define | Polynom 0xD5 |
#define | UINIT 0 |
#define | GOT_SOF 1 |
#define | GOT_LENGTH 2 |
#define | GOT_NODE_NB 3 |
#define | GET_DATA 4 |
#define | GET_CRC 5 |
#define | GET_EOF 6 |
#define | GOT_FULL_PACKET 7 |
Functions | |
static uint8_t | faulhaber_crc8 (uint8_t u8Byte, uint8_t u8CRC) |
static void | faulhaber_send_command (struct uart_periph *dev, uint8_t cmd_code, uint8_t *data, uint8_t data_length) |
static void | faulhaber_parser (struct faulhaber_parser_t *p, uint8_t c) |
void | actuators_faulhaber_init (void) |
void | actuators_faulhaber_periodic (void) |
static void | faulhaber_parse_msg (struct faulhaber_parser_t *p) |
void | actuators_faulhaber_event (void) |
void | actuators_faulhaber_SetMode (uint8_t mode) |
Variables | |
static struct uart_periph * | faulhaber_dev = &(FAULHABER_DEV) |
static struct faulhaber_parser_t | faulhaber_p |
struct faulhaber_t | faulhaber |
Definition in file actuators_faulhaber.c.
struct faulhaber_parser_t |
#define FAULHABER_MAX_VELOCITY 12000 |
Definition at line 42 of file actuators_faulhaber.c.
#define FAULHABER_P_GAIN 0.07 |
Definition at line 37 of file actuators_faulhaber.c.
#define GET_CRC 5 |
Definition at line 99 of file actuators_faulhaber.c.
#define GET_DATA 4 |
Definition at line 98 of file actuators_faulhaber.c.
#define GET_EOF 6 |
Definition at line 100 of file actuators_faulhaber.c.
#define GOT_FULL_PACKET 7 |
Definition at line 101 of file actuators_faulhaber.c.
#define GOT_LENGTH 2 |
Definition at line 96 of file actuators_faulhaber.c.
#define GOT_NODE_NB 3 |
Definition at line 97 of file actuators_faulhaber.c.
#define GOT_SOF 1 |
Definition at line 95 of file actuators_faulhaber.c.
#define Polynom 0xD5 |
Definition at line 61 of file actuators_faulhaber.c.
#define UINIT 0 |
Definition at line 94 of file actuators_faulhaber.c.
void actuators_faulhaber_event | ( | void | ) |
Definition at line 457 of file actuators_faulhaber.c.
References faulhaber_dev, faulhaber_p, faulhaber_parse_msg(), faulhaber_parser(), GOT_FULL_PACKET, faulhaber_parser_t::state, uart_char_available(), uart_getch(), and UINIT.
void actuators_faulhaber_init | ( | void | ) |
Definition at line 167 of file actuators_faulhaber.c.
References faulhaber, FAULHABER_MAX_VELOCITY, faulhaber_p, FAULHABER_P_GAIN, FH_MODE_INIT, faulhaber_t::homing_completed, faulhaber_t::max_velocity, faulhaber_t::mode, faulhaber_t::p_gain, faulhaber_t::position_ready, faulhaber_t::real_position, faulhaber_t::setpoint_position, faulhaber_parser_t::state, faulhaber_t::state, faulhaber_t::target_reached, and UINIT.
void actuators_faulhaber_periodic | ( | void | ) |
Definition at line 182 of file actuators_faulhaber.c.
References faulhaber, faulhaber_dev, faulhaber_send_command(), FH_MODE_ERROR, FH_MODE_INIT, FH_MODE_REQ_ERR, FH_MODE_RESET_ERR, FH_MODE_VELOCITY, get_sys_time_float(), faulhaber_t::homing_completed, last_time, faulhaber_t::max_velocity, faulhaber_t::mode, faulhaber_t::p_gain, faulhaber_t::real_position, faulhaber_t::setpoint_position, faulhaber_t::state, and faulhaber_t::target_velocity.
void actuators_faulhaber_SetMode | ( | uint8_t | mode | ) |
Definition at line 468 of file actuators_faulhaber.c.
References faulhaber, faulhaber_t::mode, mode, and faulhaber_t::state.
Definition at line 62 of file actuators_faulhaber.c.
References Polynom.
Referenced by faulhaber_parser(), and faulhaber_send_command().
|
static |
Definition at line 400 of file actuators_faulhaber.c.
References ACT_FEEDBACK_FAULHABER_ID, ACTUATORS_FAULHABER_COMMAND_SCALE, DefaultChannel, DefaultDevice, faulhaber, faulhaber_t::homing_completed, act_feedback_t::idx, p, act_feedback_t::act_feedback_set_t::position, act_feedback_t::position, faulhaber_t::position_ready, faulhaber_t::real_position, act_feedback_t::set, and faulhaber_t::target_reached.
Referenced by actuators_faulhaber_event().
|
static |
Definition at line 103 of file actuators_faulhaber.c.
References faulhaber_crc8(), GET_CRC, GET_DATA, GET_EOF, GOT_FULL_PACKET, GOT_LENGTH, GOT_NODE_NB, GOT_SOF, p, and UINIT.
Referenced by actuators_faulhaber_event().
|
static |
Definition at line 76 of file actuators_faulhaber.c.
References dev, faulhaber_crc8(), uart_put_byte(), and uart_send_message().
Referenced by actuators_faulhaber_periodic().
struct faulhaber_t faulhaber |
Definition at line 45 of file actuators_faulhaber.c.
Referenced by actuators_faulhaber_init(), actuators_faulhaber_periodic(), actuators_faulhaber_SetMode(), and faulhaber_parse_msg().
|
static |
Definition at line 45 of file actuators_faulhaber.c.
Referenced by actuators_faulhaber_event(), and actuators_faulhaber_periodic().
|
static |
Definition at line 45 of file actuators_faulhaber.c.
Referenced by actuators_faulhaber_event(), and actuators_faulhaber_init().