Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
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.
#define ACTUATORS_DISCO_GET_OBS_DATA   0x20
 Get observation data.
#define ACTUATORS_DISCO_START_PROP   0x40
 Start the propellers.
#define ACTUATORS_DISCO_TOGGLE_GPIO   0x4D
 Toggle GPIO (reset, red led, green led).
#define ACTUATORS_DISCO_STOP_PROP   0x60
 Stop the propellers.
#define ACTUATORS_DISCO_CLEAR_ERROR   0x80
 Clear all current erros.
#define ACTUATORS_DISCO_PLAY_SOUND   0x82
 Play a sound (0=stop, 1=short beep, 2=boot beep, 3=Be-Bop-Ah-Lula, negative=repeat).
#define ACTUATORS_DISCO_GET_INFO   0xA0
 Get version information.
#define ACTUATORS_DISCO_PWM_NB   6
 Max number of PWM channels.
#define ACTUATORS_DISCO_MOTOR_IDX   0
 Index for motor BLDC.
#define ActuatorsDiscoSet   actuators_disco_set
#define ActuatorsDiscoCommit()
#define ActuatorsDiscoInit()

Functions

void actuators_disco_set (uint8_t idx, int16_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.

Referenced by actuators_disco_init().

◆ ACTUATORS_DISCO_CLEAR_ERROR

#define ACTUATORS_DISCO_CLEAR_ERROR   0x80

Clear all current erros.

Definition at line 46 of file actuators.h.

Referenced by actuators_disco_commit().

◆ 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.

Referenced by actuators_disco_commit().

◆ ACTUATORS_DISCO_MOTOR_IDX

#define ACTUATORS_DISCO_MOTOR_IDX   0

Index for motor BLDC.

Definition at line 52 of file actuators.h.

Referenced by actuators_disco_set().

◆ 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.

Referenced by actuators_disco_init(), and actuators_disco_set().

◆ ACTUATORS_DISCO_SET_REF_SPEED

#define ACTUATORS_DISCO_SET_REF_SPEED   0x02

Set reference speed.

Definition at line 41 of file actuators.h.

Referenced by actuators_disco_commit().

◆ ACTUATORS_DISCO_START_PROP

#define ACTUATORS_DISCO_START_PROP   0x40

Start the propellers.

Definition at line 43 of file actuators.h.

Referenced by actuators_disco_commit().

◆ ACTUATORS_DISCO_STOP_PROP

#define ACTUATORS_DISCO_STOP_PROP   0x60

Stop the propellers.

Definition at line 45 of file actuators.h.

Referenced by actuators_disco_commit().

◆ 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 ( )
Value:
void actuators_disco_commit(void)
Definition actuators.c:115

Definition at line 64 of file actuators.h.

◆ ActuatorsDiscoInit

#define ActuatorsDiscoInit ( )
Value:
void actuators_disco_init(void)
Definition actuators.c:91

Definition at line 65 of file actuators.h.

◆ ActuatorsDiscoSet

#define ActuatorsDiscoSet   actuators_disco_set

Definition at line 63 of file actuators.h.

Function Documentation

◆ actuators_disco_commit()

◆ actuators_disco_init()

void actuators_disco_init ( void )
extern

Definition at line 91 of file actuators.c.

References actuators_disco, ACTUATORS_DISCO_ADDR, ACTUATORS_DISCO_PWM_NB, disco_channels, I2CTransDone, and pwm_sysfs_init().

Here is the call graph for this function:

◆ actuators_disco_set()

void actuators_disco_set ( uint8_t idx,
int16_t val )
extern

Definition at line 103 of file actuators.c.

References actuators_disco, ACTUATORS_DISCO_MOTOR_IDX, ACTUATORS_DISCO_PWM_NB, idx, 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 88 of file actuators.c.

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