Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/actuators/actuators_sts3032.h"
#include "modules/datalink/telemetry.h"
#include "string.h"
#include "mcu_periph/uart.h"
#include "mcu_periph/sys_time.h"
#include "mcu_periph/sys_time_arch.h"
#include <stdint.h>
#include "peripherals/sts3032_regs.h"
Go to the source code of this file.
Macros | |
#define | STS3032_DEBUG FALSE |
#define | STS3032_RESPONSE_LEVEL 0 |
#define | STS3032_DELAY_MSG 1000 |
#define | STS3032_DELAY_MSG_MIN 0 |
#define | BUF_MAX_LENGHT 15 |
Variables | |
struct sts3032 | sts |
uint8_t | cbuf [50 *SERVOS_STS3032_NB] |
uint8_t | buf_rx_param [255] |
int | sts3032_enabled = 1 |
int | sts3032_current_id = 1 |
int | sts3032_future_id = 1 |
int | sts3032_lock_eprom = 1 |
int | sts3032_move = 1024 |
int | sts3032_response_level = 0 |
#define BUF_MAX_LENGHT 15 |
Definition at line 58 of file actuators_sts3032.c.
#define STS3032_DEBUG FALSE |
Definition at line 40 of file actuators_sts3032.c.
#define STS3032_DELAY_MSG 1000 |
Definition at line 51 of file actuators_sts3032.c.
#define STS3032_DELAY_MSG_MIN 0 |
Definition at line 55 of file actuators_sts3032.c.
#define STS3032_RESPONSE_LEVEL 0 |
Definition at line 44 of file actuators_sts3032.c.
void actuators_sts3032_event | ( | void | ) |
Definition at line 100 of file actuators_sts3032.c.
References sts, and sts3032_event().
void actuators_sts3032_init | ( | void | ) |
Definition at line 88 of file actuators_sts3032.c.
References cbuf, circular_buffer_init(), sts3032::ids, sts3032::msg_buf, sts3032::nb_bytes_expected, sts3032::nb_failed_checksum, sts3032::periph, sts3032::rx_state, sts, and STS3032_RX_IDLE.
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.
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().
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().
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().
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().
|
static |
Definition at line 193 of file actuators_sts3032.c.
References id_idx(), offset, sts3032::pos, sts3032::read_addr, SMS_STS_PRESENT_POSITION_L, state, sts3032::states, and sts.
Referenced by sts3032_event().
Definition at line 220 of file actuators_sts3032.c.
References sts3032::ids, and sts.
Referenced by handle_reply().
Definition at line 272 of file actuators_sts3032.c.
References INST_WRITE, SMS_STS_TORQUE_ENABLE, sts, STS3032_RESPONSE_LEVEL, and write_buf().
|
static |
Definition at line 125 of file actuators_sts3032.c.
References sts3032::buf_header, BUF_MAX_LENGHT, buf_rx_param, checksum, circular_buffer_get(), current_state, sts3032::echo, get_sys_time_usec(), handle_reply(), sts3032::msg_buf, sts3032::nb_bytes_expected, sts3032::nb_failed_checksum, sts3032::periph, sts3032::rx_checksum, sts3032::rx_id, sts3032::rx_state, sts, STS3032_DELAY_MSG, STS3032_DELAY_MSG_MIN, STS3032_RX_GOT_LENGTH, STS3032_RX_HEAD_OK, STS3032_RX_IDLE, sts3032::time_last_msg, uart_char_available(), uart_getch(), uart_put_buffer(), and sts3032::wait_reply.
Referenced by actuators_sts3032_event().
void sts3032_init | ( | struct sts3032 * | sts, |
struct uart_periph * | periph, | ||
uint8_t * | cbuf, | ||
size_t | cbuf_len | ||
) |
Definition at line 231 of file actuators_sts3032.c.
References INST_WRITE, SMS_STS_LOCK, sts, STS3032_RESPONSE_LEVEL, and write_buf().
Referenced by actuators_sts3032_lock_eprom().
Definition at line 285 of file actuators_sts3032.c.
References INST_READ, sts3032::read_addr, sts, and write_buf().
Referenced by sts3032_read_pos().
Definition at line 280 of file actuators_sts3032.c.
References SMS_STS_PRESENT_POSITION_L, sts, and sts3032_read_mem().
Referenced by actuators_sts3032_periodic().
Definition at line 251 of file actuators_sts3032.c.
References INST_WRITE, SMS_STS_ID, sts, STS3032_RESPONSE_LEVEL, and write_buf().
Referenced by actuators_sts3032_set_id().
Definition at line 241 of file actuators_sts3032.c.
References INST_WRITE, SMS_STS_RESPONSE_LEVEL, sts, STS3032_RESPONSE_LEVEL, and write_buf().
Referenced by actuators_sts3032_set_response_level().
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().
|
static |
Definition at line 292 of file actuators_sts3032.c.
References BUF_MAX_LENGHT, checksum, circular_buffer_put(), sts3032::msg_buf, and sts.
Referenced by sts3032_enable_torque(), sts3032_lock_eeprom(), sts3032_read_mem(), sts3032_set_id(), sts3032_set_response_level(), and sts3032_write_pos().
uint8_t buf_rx_param[255] |
Definition at line 59 of file actuators_sts3032.c.
Referenced by sts3032_event().
uint8_t cbuf[50 *SERVOS_STS3032_NB] |
Definition at line 48 of file actuators_sts3032.c.
Referenced by actuators_sts3032_init().
struct sts3032 sts |
Definition at line 1 of file actuators_sts3032.c.
Referenced by actuators_sts3032_event(), actuators_sts3032_init(), actuators_sts3032_lock_eprom(), actuators_sts3032_move(), actuators_sts3032_periodic(), actuators_sts3032_set_id(), actuators_sts3032_set_response_level(), gec_clear_sts(), gec_sts_init(), handle_reply(), id_idx(), sts3032_enable_torque(), sts3032_event(), sts3032_lock_eeprom(), sts3032_read_mem(), sts3032_read_pos(), sts3032_set_id(), sts3032_set_response_level(), sts3032_write_pos(), and write_buf().
int sts3032_current_id = 1 |
Definition at line 65 of file actuators_sts3032.c.
Referenced by actuators_sts3032_lock_eprom(), actuators_sts3032_move(), actuators_sts3032_set_id(), and actuators_sts3032_set_response_level().
int sts3032_enabled = 1 |
Definition at line 64 of file actuators_sts3032.c.
int sts3032_future_id = 1 |
Definition at line 66 of file actuators_sts3032.c.
Referenced by actuators_sts3032_set_id().
int sts3032_lock_eprom = 1 |
Definition at line 67 of file actuators_sts3032.c.
Referenced by actuators_sts3032_lock_eprom().
int sts3032_move = 1024 |
Definition at line 68 of file actuators_sts3032.c.
Referenced by actuators_sts3032_move().
int sts3032_response_level = 0 |
Definition at line 69 of file actuators_sts3032.c.
Referenced by actuators_sts3032_set_response_level().