Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
actuators.h File Reference

Actuator driver for the disco. More...

#include "std.h"
#include "mcu_periph/i2c.h"
#include "mcu_periph/pwm_sysfs.h"
+ Include dependency graph for actuators.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ActuatorsDisco
 

Macros

#define ACTUATORS_DISCO_ADDR   0x10
 
#define ACTUATORS_DISCO_SET_REF_SPEED   0x02
 Set reference speed. More...
 
#define ACTUATORS_DISCO_GET_OBS_DATA   0x20
 Get observation data. More...
 
#define ACTUATORS_DISCO_START_PROP   0x40
 Start the propellers. More...
 
#define ACTUATORS_DISCO_TOGGLE_GPIO   0x4D
 Toggle GPIO (reset, red led, green led) More...
 
#define ACTUATORS_DISCO_STOP_PROP   0x60
 Stop the propellers. More...
 
#define ACTUATORS_DISCO_CLEAR_ERROR   0x80
 Clear all current erros. More...
 
#define ACTUATORS_DISCO_PLAY_SOUND   0x82
 Play a sound (0=stop, 1=short beep, 2=boot beep, 3=Be-Bop-Ah-Lula, negative=repeat) More...
 
#define ACTUATORS_DISCO_GET_INFO   0xA0
 Get version information. More...
 
#define ACTUATORS_DISCO_PWM_NB   6
 Max number of PWM channels. More...
 
#define ACTUATORS_DISCO_MOTOR_IDX   0
 Index for motor BLDC. More...
 
#define ActuatorsDiscoSet(_i, _v)   actuators_disco_set(_i, _v)
 
#define ActuatorsDiscoCommit()   actuators_disco_commit()
 
#define ActuatorsDiscoInit()   actuators_disco_init()
 

Functions

void actuators_disco_set (uint8_t idx, uint16_t val)
 
void actuators_disco_commit (void)
 
void actuators_disco_init (void)
 

Variables

struct ActuatorsDisco actuators_disco
 

Detailed Description

Actuator driver for the disco.

Disco plane is using the same ESC (I2C) than bebop for its motor and Pwm_sysfs linux driver for the PWM outputs

Definition in file actuators.h.


Data Structure Documentation

◆ ActuatorsDisco

struct ActuatorsDisco

Definition at line 54 of file actuators.h.

+ Collaboration diagram for ActuatorsDisco:
Data Fields
struct i2c_transaction i2c_trans I2C transaction for communicating with the Disco BLDC driver.
uint16_t motor_rpm Motor RPM setpoint.
struct PWM_Sysfs pwm[ACTUATORS_DISCO_PWM_NB] Array of PWM outputs.
uint16_t rpm_obs Measured RPM.
bool rpm_saturated RPM saturation flag (bit 15 in obs data)
uint8_t status Status flag.

Macro Definition Documentation

◆ ACTUATORS_DISCO_ADDR

#define ACTUATORS_DISCO_ADDR   0x10

Definition at line 38 of file actuators.h.

◆ ACTUATORS_DISCO_CLEAR_ERROR

#define ACTUATORS_DISCO_CLEAR_ERROR   0x80

Clear all current erros.

Definition at line 46 of file actuators.h.

◆ ACTUATORS_DISCO_GET_INFO

#define ACTUATORS_DISCO_GET_INFO   0xA0

Get version information.

Definition at line 48 of file actuators.h.

◆ ACTUATORS_DISCO_GET_OBS_DATA

#define ACTUATORS_DISCO_GET_OBS_DATA   0x20

Get observation data.

Definition at line 42 of file actuators.h.

◆ ACTUATORS_DISCO_MOTOR_IDX

#define ACTUATORS_DISCO_MOTOR_IDX   0

Index for motor BLDC.

Definition at line 52 of file actuators.h.

◆ ACTUATORS_DISCO_PLAY_SOUND

#define ACTUATORS_DISCO_PLAY_SOUND   0x82

Play a sound (0=stop, 1=short beep, 2=boot beep, 3=Be-Bop-Ah-Lula, negative=repeat)

Definition at line 47 of file actuators.h.

◆ ACTUATORS_DISCO_PWM_NB

#define ACTUATORS_DISCO_PWM_NB   6

Max number of PWM channels.

Definition at line 51 of file actuators.h.

◆ ACTUATORS_DISCO_SET_REF_SPEED

#define ACTUATORS_DISCO_SET_REF_SPEED   0x02

Set reference speed.

Definition at line 41 of file actuators.h.

◆ ACTUATORS_DISCO_START_PROP

#define ACTUATORS_DISCO_START_PROP   0x40

Start the propellers.

Definition at line 43 of file actuators.h.

◆ ACTUATORS_DISCO_STOP_PROP

#define ACTUATORS_DISCO_STOP_PROP   0x60

Stop the propellers.

Definition at line 45 of file actuators.h.

◆ ACTUATORS_DISCO_TOGGLE_GPIO

#define ACTUATORS_DISCO_TOGGLE_GPIO   0x4D

Toggle GPIO (reset, red led, green led)

Definition at line 44 of file actuators.h.

◆ ActuatorsDiscoCommit

#define ActuatorsDiscoCommit ( )    actuators_disco_commit()

Definition at line 64 of file actuators.h.

◆ ActuatorsDiscoInit

#define ActuatorsDiscoInit ( )    actuators_disco_init()

Definition at line 65 of file actuators.h.

◆ ActuatorsDiscoSet

#define ActuatorsDiscoSet (   _i,
  _v 
)    actuators_disco_set(_i, _v)

Definition at line 63 of file actuators.h.

Function Documentation

◆ actuators_disco_commit()

◆ actuators_disco_init()

◆ actuators_disco_set()

void actuators_disco_set ( uint8_t  idx,
uint16_t  val 
)

Definition at line 101 of file actuators.c.

References actuators_disco, ACTUATORS_DISCO_MOTOR_IDX, ACTUATORS_DISCO_PWM_NB, idx, ActuatorsDisco::motor_rpm, ActuatorsDisco::pwm, pwm_sysfs_set_duty(), and val.

+ Here is the call graph for this function:

Variable Documentation

◆ actuators_disco

struct ActuatorsDisco actuators_disco
extern

Definition at line 74 of file actuators.c.

Referenced by actuators_disco_commit(), actuators_disco_init(), and actuators_disco_set().