iCub-main
downloader.h
Go to the documentation of this file.
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 /*
4  * Copyright (C) 2008 RobotCub Consortium
5  * Author: Marco Maggiali, Marco Randazzo, Alessandro Scalzo, Marco Accame
6  * CopyPolicy: Released under the terms of the GNU GPL v2.0.
7  *
8  */
9 
10 #ifndef DOWNLOADER_H
11 #define DOWNLOADER_H
12 
13 #include <yarp/os/Searchable.h>
14 #include <yarp/dev/CanBusInterface.h>
15 
16 #include <fstream>
17 #include "stdint.h"
18 
19 
20 //*****************************************************************/
21 
22 struct sBoard
23 {
24 public:
25  int bus; // the can bus
26  int pid; // the id inside the can bus
27  int type; // the board type. use macros ICUBCANPROTO_BOARDTYPE__DSP etc. or .. eObrd_type_t
28  bool applicationisrunning; // if true the board runs the application. if false it runs the bootloader
29  int appl_vers_major; // the major number of the version of the sw it is running (former ...)
30  int appl_vers_minor; // the minor number of the version of the sw it is running (former ...)
31  int appl_vers_build; // the build number of the version of the sw it is running (former ...). not meaningful for bootloader
32  int prot_vers_major; // the major number of the can protocol of the application. not meaningful for bootloader
33  int prot_vers_minor; // the minor number of the can protocol of the application. not meaningful for bootloader
34  char serial [50]; // only for strain
35  int strainregsetinuse; // only for strain
36  int strainregsetatboot; // only for strain
37  int status;
38  bool selected;
39  bool eeprom;
40  char add_info [50]; // but can protocol supports upt to 32 bytes
41 };
42 
43 //*****************************************************************/
44 
45 #define BOARD_RUNNING 0
46 #define BOARD_WAITING 1
47 #define BOARD_WAITING_ACK 2
48 #define BOARD_DOWNLOADING 3
49 #define BOARD_OK 4
50 #define BOARD_ERR 5
51 
52 #define SPRS_STATE_WAIT 0
53 #define SPRS_STATE_TYPE 1
54 #define SPRS_STATE_ADDRESS 2
55 #define SPRS_STATE_LENGTH 3
56 #define SPRS_STATE_DATA 4
57 #define SPRS_STATE_CHECKSUM 5
58 
59 #define SPRS_TYPE_0 '0'
60 #define SPRS_TYPE_1 '1'
61 #define SPRS_TYPE_3 '3'
62 #define SPRS_TYPE_4 '4'
63 #define SPRS_TYPE_7 '7'
64 
65 #define ID_MASTER 0x00
66 #define ID_BROADCAST 0x0F
67 
68 
69 //*****************************************************************/
70 
71 void drv_sleep (double time);
72 
73 //*****************************************************************/
74 
75 
76 
77 #include "driver.h"
78 
79 #include "EoBoards.h"
80 #include "EoCommon.h"
81 
82 #include <iCubCanProto_types.h>
83 
84 // it forces the use of the new driver2 interface
85 #define DOWNLOADER_USE_IDRIVER2
86 
87 
88 #if defined(DOWNLOADER_USE_IDRIVER2)
89 // if you define it, the canLoader shall be able to retrieve can boards from both CAN1 and CAN2
90 #define DOWNLOADER_ETH_SUPPORTS_MULTIBUS
91 #endif
92 
93 
95 {
96  uint8_t data[6];
97  strain2_ampl_regs_t() { data[0] = data[1] = data[2] = data[3] = data[4] = data[5] = 0; }
98  void load(void *mem, size_t s) { memmove(data, mem, sizeof(data)); }
99  void * memory() { return data; }
100  size_t size() { return 6; }
101 };
102 
103 //Luca
105 {
108 };
109 
110 
112 {
113 
114 private:
115 
116 #if defined(DOWNLOADER_USE_IDRIVER2)
117  iDriver2* m_idriver;
118  vector<CanPacket> txBuffer;
119  vector<CanPacket> rxBuffer;
120 #else
121  iDriver* m_idriver;
122  yarp::dev::CanBuffer txBuffer;
123  yarp::dev::CanBuffer rxBuffer;
124 #endif
125 
126  // the id of the can bus is moved inside the struct sBoard because we want to manage boards from different CAN buses.
127  int canbus_id;
128 
129  bool strain_is_acquiring_in_calibratedmode;
130 
131 private:
132 int download_motorola_line(char* line, int len, int bus, int board_pid);
133 int download_hexintel_line(char* line, int len, int bus, int board_pid, bool eeprom, int board_type);
134 
135 int build_id(int source, int dest);
136 int get_src_from_id (int id);
137 int get_dst_from_id (int id);
138 
139 int verify_ack(int command, int read_messages);
140 
141 //Luca
142 enum { ampl_gain_numberOf = 13 };
143 
144 
145 public:
146 
149 
154 unsigned int sprsPage;
155  std::fstream filestr;
157 
159 int initdriver(yarp::os::Searchable &config, bool verbose = true);
160 int stopdriver();
161 
162 int initschede ();
163 int startscheda (int bus, int board_pid, bool board_eeprom, int download_type);
164 int stopscheda (int bus, int board_pid);
165 int download_file (int bus, int board_pid, int download_type, bool eeprom);
167 int change_card_address (int bus, int target_id, int new_id, int board_type);
168 int change_board_info (int bus, int target_id, char* board_info);
169 int get_board_info (int bus, int target_id, char* board_info);
170 int get_serial_no (int bus, int target_id, char* board_info);
171 int get_firmware_version(int bus, int target_id, eObrd_cantype_t boardtype, eObrd_info_t *info, bool &noreply);
172 int get_canbus_id ();
173 void set_canbus_id (int id);
174 
175 int strain_start_sampling (int bus, int target_id, string *errorstring = NULL);
176 int strain_stop_sampling (int bus, int target_id, string *errorstring = NULL);
177 
179 
180 // the strain2 has multiple (up to 3) regulation sets. with these functions we can get / set the regulation set in use inside the strain2.
181 // allowed values for regset are only strain_regset_one/two/three. with regsetmode we choose if the value is the one currently used or the one in eeprom.
182 // attention: funtion strain_set_regulationset() does not want strain_regset_inuse but only strain_regset_one/two/three
183 int strain_set_regulationset (int bus, int target_id, int regset = strain_regset_one, int regsetmode = strain_regsetmode_temporary, string *errorstring = NULL);
184 int strain_get_regulationset (int bus, int target_id, int &regset, const int regsetmode = strain_regsetmode_temporary, string *errorstring = NULL);
185 
186 
187 // the calibration of the offset is meaningful only for the calibration set in use
188 int strain_calibrate_offset (int bus, int target_id, icubCanProto_boardType_t boardtype, unsigned int middle_val, string *errorstring = NULL);
189 
190 int strain_calibrate_offset2 (int bus, int target_id, icubCanProto_boardType_t boardtype, const std::vector<strain2_ampl_discretegain_t> &gains, const std::vector<int16_t> &targets, string *errorstring = NULL);
191 
192 // they are not dependent on the regulation set or we cannot specify one
193 int strain_get_adc (int bus, int target_id, char channel, unsigned int& adc, int type, string *errorstring = NULL);
194 int strain_get_eeprom_saved (int bus, int target_id, bool* status, string *errorstring = NULL);
195 int strain_save_to_eeprom (int bus, int target_id, string *errorstring = NULL);
196 // funtions *curr_bias() apply only to strain_regset_inuse because the curr bias is not part of the regulation set. it is a volatile regulation.
197 int strain_get_curr_bias (int bus, int target_id, char channel, signed int& bias, string *errorstring = NULL);
198 int strain_set_curr_bias (int bus, int target_id, string *errorstring = NULL); // only for strain_regset_inuse because the curr bias is not saved in eeprom in the regulation set
199 int strain_set_curr_bias (int bus, int target_id, char channel, signed int bias, string *errorstring = NULL); // only for strain_regset_inuse because the curr bias is not saved in eeprom in the regulation set
200 int strain_reset_curr_bias (int bus, int target_id, string *errorstring = NULL); // only for strain_regset_inuse because the curr bias is not saved in eeprom in the regulation set
201 // serial number is unique and does not depend on regulation set
202 int strain_get_serial_number (int bus, int target_id, char* serial_number, string *errorstring = NULL);
203 int strain_set_serial_number (int bus, int target_id, const char* serial_number, string *errorstring = NULL);
204 
205 
206 // all of the following can be related to any calibration set: the one in use or one of set 1, 2, 3. default is the one in use (old strain have only one regulation set)
207 int strain_get_offset (int bus, int target_id, char channel, unsigned int& offset, int regset = strain_regset_inuse, string *errorstring = NULL);
208 int strain_set_offset (int bus, int target_id, char channel, unsigned int offset, int regset = strain_regset_inuse, string *errorstring = NULL);
209 
210 int strain_get_matrix_rc (int bus, int target_id, char r, char c, unsigned int& elem, int regset = strain_regset_inuse, string *errorstring = NULL);
211 int strain_set_matrix_rc (int bus, int target_id, char r, char c, unsigned int elem, int regset = strain_regset_inuse, string *errorstring = NULL);
212 
213 int strain_get_matrix_gain (int bus, int target_id, unsigned int& gain, int regset = strain_regset_inuse, string *errorstring = NULL);
214 int strain_set_matrix_gain (int bus, int target_id, unsigned int gain, int regset = strain_regset_inuse, string *errorstring = NULL);
215 
216 int strain_set_amplifier_regs(int bus, int target_id, unsigned char channel, const strain2_ampl_regs_t &ampregs, int regset = strain_regset_inuse, string *errorstring = NULL);
217 int strain_get_amplifier_regs(int bus, int target_id, unsigned char channel, strain2_ampl_regs_t &ampregs, int regset = strain_regset_inuse, string *errorstring = NULL);
218 
219 int strain_set_amplifier_discretegain(int bus, int target_id, unsigned char channel, strain2_ampl_discretegain_t ampset, int regset = strain_regset_inuse, string *errorstring = NULL);
220 
221 int strain_get_amplifier_gain_offset(int bus, int target_id, unsigned char channel, float &gain, uint16_t &offset, int regset = strain_regset_inuse, string *errorstring = NULL);
222 int strain_set_amplifier_gain_offset(int bus, int target_id, unsigned char channel, float gain, uint16_t offset, int regset = strain_regset_inuse, string *errorstring = NULL);
223 
224 int strain_get_calib_bias (int bus, int target_id, char channel, signed int& bias, int regset = strain_regset_inuse, string *errorstring = NULL);
225 int strain_set_calib_bias (int bus, int target_id, string *errorstring = NULL); // used only for strain_regset_inuse
226 int strain_set_calib_bias (int bus, int target_id, char channel, signed int bias, int regset = strain_regset_inuse, string *errorstring = NULL);
227 int strain_reset_calib_bias (int bus, int target_id, string *errorstring = NULL); // used only for strain_regset_inuse
228 
229 int strain_set_full_scale (int bus, int target_id, unsigned char channel, unsigned int full_scale, int regset = strain_regset_inuse, string *errorstring = NULL);
230 int strain_get_full_scale (int bus, int target_id, unsigned char channel, unsigned int& full_scale, int regset = strain_regset_inuse, string *errorstring = NULL);
231 
232 
233 
234 
235 
236 
237 // for use by the future strain calibration data acquisition gui
238 
240 {
241  bool valid; // the acquisition is meaninful
242  bool calibrated; // the values are calibrated
243  bool saturated; // at least one measure is saturated. see saturationinfo[6] to know more
244  unsigned int channel[6]; // the values
245  icubCanProto_strain_saturationInfo_t saturationinfo[6]; // the saturation info
246  strain_value_t() : calibrated(false), valid(false), saturated(false) {
247  channel[0] = channel[1] = channel[2] = channel[3] = channel[4] = channel[5] = 0;
248  saturationinfo[0] = saturationinfo[1] = saturationinfo[2] = saturationinfo[3] = saturationinfo[4] = saturationinfo[5] = saturationNONE;
249  }
250  void extract(signed short *ss6) const {
251  if(NULL == ss6) return;
252  for(size_t i=0; i<6; i++) { ss6[i] = static_cast<unsigned short>(channel[i]) - 0x7fff; }
253  }
254 };
255 
256 typedef enum
257 {
261 
262 int strain_acquire_start(int bus, int target_id, uint8_t txratemilli = 20, bool calibmode = true, strain_acquisition_mode_t acqmode = strain_acquisition_mode_streaming, string *errorstring = NULL);
263 int strain_acquire_get(int bus, int target_id, vector<strain_value_t> &values, const unsigned int howmany = 10, void (*updateProgressBar)(void*, float) = NULL, void *arg = NULL, strain_acquisition_mode_t acqmode = strain_acquisition_mode_streaming, const unsigned int maxerrors = 1, string *errorstring = NULL);
264 int strain_acquire_stop(int bus, int target_id, strain_acquisition_mode_t acqmode = strain_acquisition_mode_streaming, string *errorstring = NULL);
265 
266 cDownloader(bool verbose = true);
267 
268 void set_verbose(bool verbose);
269 
270 void set_external_logger(void *caller = NULL, void (*logger)(void *, const std::string &) = NULL);
271 
272 
273 private:
274  void clean_rx(void);
275 
276 #if defined(DOWNLOADER_USE_IDRIVER2)
277  void set_bus(CanPacket &pkt, int bus);
278  int get_bus(CanPacket &pkt);
279 #else
280  void set_bus(yarp::dev::CanMessage &msg, int bus);
281  int get_bus(yarp::dev::CanMessage &msg);
282 #endif
283 
284  bool _verbose;
285 
286 
287  int strain_calibrate_offset2_strain1(int bus, int target_id, int16_t t, string *errorstring);
288  int strain_calibrate_offset2_strain1safer(int bus, int target_id, int16_t t, uint8_t nmeasures, bool fullsearch, string *errorstring);
289  int strain_calibrate_offset2_strain2(int bus, int target_id, const std::vector<strain2_ampl_discretegain_t> &gains, const std::vector<int16_t> &targets, string *errorstring = NULL);
290 
291  int readADC(int bus, int target_id, int channel, int nmeasures = 2);
292 
293  void (*_externalLoggerFptr)(void *caller, const std::string &output);
294  void * _externalLoggerCaller;
295 
296  void Log(const std::string &msg);
297 
298 };
299 
300 #endif
301 
302 // eof
303 
cDownloader::strain_set_amplifier_regs
int strain_set_amplifier_regs(int bus, int target_id, unsigned char channel, const strain2_ampl_regs_t &ampregs, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:913
cDownloader::strain_regset_three
@ strain_regset_three
Definition: downloader.h:147
cDownloader::strain_regset_two
@ strain_regset_two
Definition: downloader.h:147
sBoard::applicationisrunning
bool applicationisrunning
Definition: downloader.h:28
cDownloader
Definition: downloader.h:111
cDownloader::strain_reset_curr_bias
int strain_reset_curr_bias(int bus, int target_id, string *errorstring=NULL)
Definition: downloader.cpp:622
cDownloader::get_firmware_version
int get_firmware_version(int bus, int target_id, eObrd_cantype_t boardtype, eObrd_info_t *info, bool &noreply)
Definition: downloader.cpp:2155
sBoard::prot_vers_major
int prot_vers_major
Definition: downloader.h:32
cDownloader::set_external_logger
void set_external_logger(void *caller=NULL, void(*logger)(void *, const std::string &)=NULL)
Definition: downloader.cpp:103
cDownloader::strain_value_t::valid
bool valid
Definition: downloader.h:241
cDownloader::set_verbose
void set_verbose(bool verbose)
Definition: downloader.cpp:98
iCub::action::log::info
@ info
Definition: actionPrimitives.cpp:64
cDownloader::filestr
std::fstream filestr
Definition: downloader.h:155
driver.h
cDownloader::stopdriver
int stopdriver()
Definition: downloader.cpp:122
CanPacket
Definition: driver.h:47
sBoard::status
int status
Definition: downloader.h:37
cDownloader::strain_reset_calib_bias
int strain_reset_calib_bias(int bus, int target_id, string *errorstring=NULL)
Definition: downloader.cpp:524
cDownloader::strain_set_serial_number
int strain_set_serial_number(int bus, int target_id, const char *serial_number, string *errorstring=NULL)
Definition: downloader.cpp:644
sBoard::strainregsetinuse
int strainregsetinuse
Definition: downloader.h:35
strain2_ampl_regs_t::strain2_ampl_regs_t
strain2_ampl_regs_t()
Definition: downloader.h:97
cDownloader::strain_get_amplifier_gain_offset
int strain_get_amplifier_gain_offset(int bus, int target_id, unsigned char channel, float &gain, uint16_t &offset, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:1088
cDownloader::get_canbus_id
int get_canbus_id()
Definition: downloader.cpp:2729
offset
degrees offset
Definition: sine.m:4
drv_sleep
void drv_sleep(double time)
Definition: downloader.cpp:26
cDownloader::strain_calibrate_offset2
int strain_calibrate_offset2(int bus, int target_id, icubCanProto_boardType_t boardtype, const std::vector< strain2_ampl_discretegain_t > &gains, const std::vector< int16_t > &targets, string *errorstring=NULL)
Definition: downloader.cpp:1699
file
FILE * file
Definition: main.cpp:81
cDownloader::open_file
int open_file(std::string file)
Definition: downloader.cpp:3416
cDownloader::strain_acquisition_mode_polling
@ strain_acquisition_mode_polling
Definition: downloader.h:259
cDownloader::strain_set_matrix_gain
int strain_set_matrix_gain(int bus, int target_id, unsigned int gain, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:891
cDownloader::strain_get_full_scale
int strain_get_full_scale(int bus, int target_id, unsigned char channel, unsigned int &full_scale, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:1184
strain2_ampl_regs_t::memory
void * memory()
Definition: downloader.h:99
cDownloader::board_list
sBoard * board_list
Definition: downloader.h:150
sBoard::add_info
char add_info[50]
Definition: downloader.h:40
cDownloader::board_list_size
int board_list_size
Definition: downloader.h:151
sBoard::type
int type
Definition: downloader.h:27
cDownloader::strain_stop_sampling
int strain_stop_sampling(int bus, int target_id, string *errorstring=NULL)
Definition: downloader.cpp:1659
cDownloader::strain_get_matrix_rc
int strain_get_matrix_rc(int bus, int target_id, char r, char c, unsigned int &elem, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:1245
cDownloader::strain_acquire_start
int strain_acquire_start(int bus, int target_id, uint8_t txratemilli=20, bool calibmode=true, strain_acquisition_mode_t acqmode=strain_acquisition_mode_streaming, string *errorstring=NULL)
Definition: downloader.cpp:1351
cDownloader::strain_set_curr_bias
int strain_set_curr_bias(int bus, int target_id, string *errorstring=NULL)
Definition: downloader.cpp:575
sBoard::appl_vers_minor
int appl_vers_minor
Definition: downloader.h:30
cDownloader::sprsPage
unsigned int sprsPage
Definition: downloader.h:154
sBoard::selected
bool selected
Definition: downloader.h:38
cDownloader::strain_get_serial_number
int strain_get_serial_number(int bus, int target_id, char *serial_number, string *errorstring=NULL)
Definition: downloader.cpp:672
ampl_gain20
@ ampl_gain20
Definition: downloader.h:106
cDownloader::strain_get_curr_bias
int strain_get_curr_bias(int bus, int target_id, char channel, signed int &bias, string *errorstring=NULL)
Definition: downloader.cpp:545
cDownloader::strain_value_t::saturated
bool saturated
Definition: downloader.h:243
sBoard::strainregsetatboot
int strainregsetatboot
Definition: downloader.h:36
cDownloader::strain_regsetmode_permanent
@ strain_regsetmode_permanent
Definition: downloader.h:148
cDownloader::download_file
int download_file(int bus, int board_pid, int download_type, bool eeprom)
Definition: downloader.cpp:3454
cDownloader::change_card_address
int change_card_address(int bus, int target_id, int new_id, int board_type)
Definition: downloader.cpp:2412
cDownloader::strain_get_matrix_gain
int strain_get_matrix_gain(int bus, int target_id, unsigned int &gain, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:746
cDownloader::change_board_info
int change_board_info(int bus, int target_id, char *board_info)
Definition: downloader.cpp:2363
cDownloader::strain_value_t
Definition: downloader.h:239
cDownloader::strain_get_offset
int strain_get_offset(int bus, int target_id, char channel, unsigned int &offset, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:399
cDownloader::strain_regset_one
@ strain_regset_one
Definition: downloader.h:147
cDownloader::strain_value_t::extract
void extract(signed short *ss6) const
Definition: downloader.h:250
strain2_ampl_regs_t::data
uint8_t data[6]
Definition: downloader.h:96
cDownloader::strain_acquire_get
int strain_acquire_get(int bus, int target_id, vector< strain_value_t > &values, const unsigned int howmany=10, void(*updateProgressBar)(void *, float)=NULL, void *arg=NULL, strain_acquisition_mode_t acqmode=strain_acquisition_mode_streaming, const unsigned int maxerrors=1, string *errorstring=NULL)
Definition: downloader.cpp:1450
cDownloader::strain_start_sampling
int strain_start_sampling(int bus, int target_id, string *errorstring=NULL)
Definition: downloader.cpp:1633
cDownloader::get_board_info
int get_board_info(int bus, int target_id, char *board_info)
Definition: downloader.cpp:2280
sBoard::eeprom
bool eeprom
Definition: downloader.h:39
cDownloader::strain_set_matrix_rc
int strain_set_matrix_rc(int bus, int target_id, char r, char c, unsigned int elem, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:1291
cDownloader::strain_amplifier_discretegain2float
float strain_amplifier_discretegain2float(strain2_ampl_discretegain_t c)
Definition: downloader.cpp:992
iDriver
Definition: driver.h:280
cDownloader::file_length
int file_length
Definition: downloader.h:153
cDownloader::strain_save_to_eeprom
int strain_save_to_eeprom(int bus, int target_id, string *errorstring=NULL)
Definition: downloader.cpp:214
ampl_gain06
@ ampl_gain06
Definition: downloader.h:107
iDriver2
Definition: driver.h:94
strain2_ampl_discretegain_t
strain2_ampl_discretegain_t
Definition: downloader.h:104
strain2_ampl_regs_t::load
void load(void *mem, size_t s)
Definition: downloader.h:98
ampl_gain16
@ ampl_gain16
Definition: downloader.h:106
ampl_gain24
@ ampl_gain24
Definition: downloader.h:106
string
string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}") include_directories($
Definition: CMakeLists.txt:9
cDownloader::initschede
int initschede()
Definition: downloader.cpp:2480
cDownloader::strain_value_t::channel
unsigned int channel[6]
Definition: downloader.h:244
cDownloader::strain_set_regulationset
int strain_set_regulationset(int bus, int target_id, int regset=strain_regset_one, int regsetmode=strain_regsetmode_temporary, string *errorstring=NULL)
Definition: downloader.cpp:804
ampl_gain48
@ ampl_gain48
Definition: downloader.h:106
ampl_gain128
@ ampl_gain128
Definition: downloader.h:106
cDownloader::strain_value_t::strain_value_t
strain_value_t()
Definition: downloader.h:246
cDownloader::strain_set_calib_bias
int strain_set_calib_bias(int bus, int target_id, string *errorstring=NULL)
Definition: downloader.cpp:476
sBoard::prot_vers_minor
int prot_vers_minor
Definition: downloader.h:33
ampl_gain10
@ ampl_gain10
Definition: downloader.h:107
cDownloader::strain_acquisition_mode_t
strain_acquisition_mode_t
Definition: downloader.h:256
cDownloader::strain_set_offset
int strain_set_offset(int bus, int target_id, char channel, unsigned int offset, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:1316
cDownloader::strain_acquisition_mode_streaming
@ strain_acquisition_mode_streaming
Definition: downloader.h:258
ampl_gain04
@ ampl_gain04
Definition: downloader.h:107
strain2_ampl_regs_t
Definition: downloader.h:94
ampl_gain36
@ ampl_gain36
Definition: downloader.h:106
cDownloader::strain_set_amplifier_discretegain
int strain_set_amplifier_discretegain(int bus, int target_id, unsigned char channel, strain2_ampl_discretegain_t ampset, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:1009
ampl_gain64
@ ampl_gain64
Definition: downloader.h:106
cDownloader::strain_get_calib_bias
int strain_get_calib_bias(int bus, int target_id, char channel, signed int &bias, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:444
cDownloader::connected
bool connected
Definition: downloader.h:158
cDownloader::strain_value_t::saturationinfo
icubCanProto_strain_saturationInfo_t saturationinfo[6]
Definition: downloader.h:245
sBoard::pid
int pid
Definition: downloader.h:26
sBoard::serial
char serial[50]
Definition: downloader.h:34
sBoard::appl_vers_build
int appl_vers_build
Definition: downloader.h:31
cDownloader::cDownloader
cDownloader(bool verbose=true)
Definition: downloader.cpp:87
cDownloader::strain_set_amplifier_gain_offset
int strain_set_amplifier_gain_offset(int bus, int target_id, unsigned char channel, float gain, uint16_t offset, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:1127
ampl_gain96
@ ampl_gain96
Definition: downloader.h:106
cDownloader::strain_get_amplifier_regs
int strain_get_amplifier_regs(int bus, int target_id, unsigned char channel, strain2_ampl_regs_t &ampregs, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:947
cDownloader::strain_get_regulationset
int strain_get_regulationset(int bus, int target_id, int &regset, const int regsetmode=strain_regsetmode_temporary, string *errorstring=NULL)
Definition: downloader.cpp:837
cDownloader::strain_acquire_stop
int strain_acquire_stop(int bus, int target_id, strain_acquisition_mode_t acqmode=strain_acquisition_mode_streaming, string *errorstring=NULL)
Definition: downloader.cpp:1404
cDownloader::strain_get_eeprom_saved
int strain_get_eeprom_saved(int bus, int target_id, bool *status, string *errorstring=NULL)
Definition: downloader.cpp:713
cDownloader::strain_value_t::calibrated
bool calibrated
Definition: downloader.h:242
sBoard
Definition: downloader.h:22
cDownloader::strain_get_adc
int strain_get_adc(int bus, int target_id, char channel, unsigned int &adc, int type, string *errorstring=NULL)
Definition: downloader.cpp:348
ampl_gain256
@ ampl_gain256
Definition: downloader.h:106
cDownloader::strain_calibrate_offset
int strain_calibrate_offset(int bus, int target_id, icubCanProto_boardType_t boardtype, unsigned int middle_val, string *errorstring=NULL)
Definition: downloader.cpp:1718
cDownloader::initdriver
int initdriver(yarp::os::Searchable &config, bool verbose=true)
Definition: downloader.cpp:142
cDownloader::strain_set_full_scale
int strain_set_full_scale(int bus, int target_id, unsigned char channel, unsigned int full_scale, int regset=strain_regset_inuse, string *errorstring=NULL)
Definition: downloader.cpp:1221
cDownloader::progress
int progress
Definition: downloader.h:152
sBoard::appl_vers_major
int appl_vers_major
Definition: downloader.h:29
strain2_ampl_regs_t::size
size_t size()
Definition: downloader.h:100
time
degrees time
Definition: sine.m:5
cDownloader::strain_regset_inuse
@ strain_regset_inuse
Definition: downloader.h:147
cDownloader::strain_regsetmode_temporary
@ strain_regsetmode_temporary
Definition: downloader.h:148
ampl_gain08
@ ampl_gain08
Definition: downloader.h:107
cDownloader::set_canbus_id
void set_canbus_id(int id)
Definition: downloader.cpp:2734
sBoard::bus
int bus
Definition: downloader.h:25
cDownloader::get_serial_no
int get_serial_no(int bus, int target_id, char *board_info)
Definition: downloader.cpp:2123
cDownloader::stopscheda
int stopscheda(int bus, int board_pid)
Definition: downloader.cpp:2836
cDownloader::nSelectedBoards
int nSelectedBoards
Definition: downloader.h:156
cDownloader::startscheda
int startscheda(int bus, int board_pid, bool board_eeprom, int download_type)
Definition: downloader.cpp:2741