Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
actuators_sts3032.h File Reference
#include <stdint.h>
#include "mcu_periph/uart.h"
#include "utils/circular_buffer.h"
#include "generated/airframe.h"
+ Include dependency graph for actuators_sts3032.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sts3032
 

Macros

#define ActuatorSTS3032Set(_i, _v)   { if(sts3032_enabled) {sts3032_write_pos(&sts, sts.ids[_i], _v);} }
 
#define ActuatorsSTS3032Init()   actuators_sts3032_init()
 
#define ActuatorsSTS3032Commit()   {}
 

Enumerations

enum  sts3032_rx_state { STS3032_RX_IDLE , STS3032_RX_HEAD_OK , STS3032_RX_GOT_LENGTH }
 

Functions

void actuators_sts3032_init (void)
 
void actuators_sts3032_periodic (void)
 
void actuators_sts3032_event (void)
 
uint8_t id_idx (struct sts3032 *sts, uint8_t id)
 
void sts3032_write_pos (struct sts3032 *sts, uint8_t id, int16_t position)
 
void actuators_sts3032_set_id (float future_id)
 
void actuators_sts3032_lock_eprom (float lock)
 
void actuators_sts3032_move (float pos)
 
void actuators_sts3032_set_response_level (float level)
 

Variables

struct sts3032 sts
 
int sts3032_enabled
 
int sts3032_current_id
 
int sts3032_future_id
 
int sts3032_lock_eprom
 
int sts3032_move
 
int sts3032_response_level
 

Data Structure Documentation

◆ sts3032

struct sts3032

Definition at line 41 of file actuators_sts3032.h.

+ Collaboration diagram for sts3032:
Data Fields
uint8_t buf_header[2]
bool echo
uint8_t ids[SERVOS_STS3032_NB]
struct circular_buffer msg_buf
uint8_t nb_bytes_expected
uint16_t nb_failed_checksum
struct uart_periph * periph
uint16_t pos[SERVOS_STS3032_NB]
uint8_t read_addr
uint8_t rx_checksum
uint8_t rx_id
enum sts3032_rx_state rx_state
uint8_t states[SERVOS_STS3032_NB]
uint32_t time_last_msg
bool wait_reply

Macro Definition Documentation

◆ ActuatorsSTS3032Commit

#define ActuatorsSTS3032Commit ( )    {}

Definition at line 77 of file actuators_sts3032.h.

◆ ActuatorsSTS3032Init

#define ActuatorsSTS3032Init ( )    actuators_sts3032_init()

Definition at line 76 of file actuators_sts3032.h.

◆ ActuatorSTS3032Set

#define ActuatorSTS3032Set (   _i,
  _v 
)    { if(sts3032_enabled) {sts3032_write_pos(&sts, sts.ids[_i], _v);} }

Definition at line 75 of file actuators_sts3032.h.

Enumeration Type Documentation

◆ sts3032_rx_state

Enumerator
STS3032_RX_IDLE 
STS3032_RX_HEAD_OK 
STS3032_RX_GOT_LENGTH 

Definition at line 35 of file actuators_sts3032.h.

Function Documentation

◆ actuators_sts3032_event()

void actuators_sts3032_event ( void  )

Definition at line 100 of file actuators_sts3032.c.

References sts, and sts3032_event().

+ Here is the call graph for this function:

◆ actuators_sts3032_init()

void actuators_sts3032_init ( void  )

◆ actuators_sts3032_lock_eprom()

void actuators_sts3032_lock_eprom ( float  lock)

Definition at line 321 of file actuators_sts3032.c.

References sts, sts3032_current_id, sts3032_lock_eeprom(), and sts3032_lock_eprom.

+ Here is the call graph for this function:

◆ actuators_sts3032_move()

void actuators_sts3032_move ( float  pos)

Definition at line 327 of file actuators_sts3032.c.

References sts3032::pos, sts, sts3032_current_id, sts3032_move, and sts3032_write_pos().

+ Here is the call graph for this function:

◆ actuators_sts3032_periodic()

void actuators_sts3032_periodic ( void  )

Definition at line 105 of file actuators_sts3032.c.

References DefaultChannel, DefaultDevice, sts3032::ids, sts3032::nb_failed_checksum, sts3032::pos, sts, and sts3032_read_pos().

+ Here is the call graph for this function:

◆ actuators_sts3032_set_id()

void actuators_sts3032_set_id ( float  future_id)

Definition at line 315 of file actuators_sts3032.c.

References sts, sts3032_current_id, sts3032_future_id, and sts3032_set_id().

+ Here is the call graph for this function:

◆ actuators_sts3032_set_response_level()

void actuators_sts3032_set_response_level ( float  level)

Definition at line 333 of file actuators_sts3032.c.

References sts, sts3032_current_id, sts3032_response_level, and sts3032_set_response_level().

+ Here is the call graph for this function:

◆ id_idx()

uint8_t id_idx ( struct sts3032 sts,
uint8_t  id 
)

Definition at line 220 of file actuators_sts3032.c.

References sts3032::ids, and sts.

Referenced by handle_reply().

+ Here is the caller graph for this function:

◆ sts3032_write_pos()

void sts3032_write_pos ( struct sts3032 sts,
uint8_t  id,
int16_t  position 
)

Definition at line 259 of file actuators_sts3032.c.

References INST_WRITE, SMS_STS_GOAL_POSITION_L, sts, STS3032_RESPONSE_LEVEL, and write_buf().

Referenced by actuators_sts3032_move().

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

Variable Documentation

◆ sts

◆ sts3032_current_id

◆ sts3032_enabled

int sts3032_enabled
extern

Definition at line 64 of file actuators_sts3032.c.

◆ sts3032_future_id

int sts3032_future_id
extern

Definition at line 66 of file actuators_sts3032.c.

Referenced by actuators_sts3032_set_id().

◆ sts3032_lock_eprom

int sts3032_lock_eprom
extern

Definition at line 67 of file actuators_sts3032.c.

Referenced by actuators_sts3032_lock_eprom().

◆ sts3032_move

int sts3032_move
extern

Definition at line 68 of file actuators_sts3032.c.

Referenced by actuators_sts3032_move().

◆ sts3032_response_level

int sts3032_response_level
extern

Definition at line 69 of file actuators_sts3032.c.

Referenced by actuators_sts3032_set_response_level().