Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
actuators_faulhaber.c File Reference
#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>
+ Include dependency graph for actuators_faulhaber.c:

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_periphfaulhaber_dev = &(FAULHABER_DEV)
 
static struct faulhaber_parser_t faulhaber_p
 
struct faulhaber_t faulhaber
 

Detailed Description

Author
Freek van Tienen Serial Connection module between ap and a faulhaber motor controller

Definition in file actuators_faulhaber.c.


Data Structure Documentation

◆ faulhaber_parser_t

struct faulhaber_parser_t

Definition at line 48 of file actuators_faulhaber.c.

Data Fields
uint8_t calc_crc8
uint8_t cmd_code
uint8_t data[64]
uint8_t data_idx
uint8_t data_length
uint8_t node_nb
uint8_t state

Macro Definition Documentation

◆ FAULHABER_MAX_VELOCITY

#define FAULHABER_MAX_VELOCITY   12000

Definition at line 42 of file actuators_faulhaber.c.

◆ FAULHABER_P_GAIN

#define FAULHABER_P_GAIN   0.07

Definition at line 37 of file actuators_faulhaber.c.

◆ GET_CRC

#define GET_CRC   5

Definition at line 99 of file actuators_faulhaber.c.

◆ GET_DATA

#define GET_DATA   4

Definition at line 98 of file actuators_faulhaber.c.

◆ GET_EOF

#define GET_EOF   6

Definition at line 100 of file actuators_faulhaber.c.

◆ GOT_FULL_PACKET

#define GOT_FULL_PACKET   7

Definition at line 101 of file actuators_faulhaber.c.

◆ GOT_LENGTH

#define GOT_LENGTH   2

Definition at line 96 of file actuators_faulhaber.c.

◆ GOT_NODE_NB

#define GOT_NODE_NB   3

Definition at line 97 of file actuators_faulhaber.c.

◆ GOT_SOF

#define GOT_SOF   1

Definition at line 95 of file actuators_faulhaber.c.

◆ Polynom

#define Polynom   0xD5

Definition at line 61 of file actuators_faulhaber.c.

◆ UINIT

#define UINIT   0

Definition at line 94 of file actuators_faulhaber.c.

Function Documentation

◆ actuators_faulhaber_event()

void actuators_faulhaber_event ( void  )

◆ actuators_faulhaber_init()

◆ actuators_faulhaber_periodic()

◆ actuators_faulhaber_SetMode()

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.

◆ faulhaber_crc8()

static uint8_t faulhaber_crc8 ( uint8_t  u8Byte,
uint8_t  u8CRC 
)
static

Definition at line 62 of file actuators_faulhaber.c.

References Polynom.

Referenced by faulhaber_parser(), and faulhaber_send_command().

+ Here is the caller graph for this function:

◆ faulhaber_parse_msg()

◆ faulhaber_parser()

static void faulhaber_parser ( struct faulhaber_parser_t p,
uint8_t  c 
)
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ faulhaber_send_command()

static void faulhaber_send_command ( struct uart_periph dev,
uint8_t  cmd_code,
uint8_t data,
uint8_t  data_length 
)
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ faulhaber

◆ faulhaber_dev

struct uart_periph* faulhaber_dev = &(FAULHABER_DEV)
static

◆ faulhaber_p

struct faulhaber_parser_t faulhaber_p
static

Definition at line 45 of file actuators_faulhaber.c.

Referenced by actuators_faulhaber_event(), and actuators_faulhaber_init().