00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "registers.h"
00036
00044 namespace camera1394
00045 {
00046
00047 Registers::Registers(dc1394camera_t *camera) : camera_(camera)
00048 {}
00049
00050 Registers::Registers() : camera_(NULL)
00051 {}
00052
00053
00054
00055
00063 bool Registers::getControlRegisters(const uint64_t offset,
00064 const uint32_t num_regs,
00065 std::vector<uint32_t> &val)
00066 {
00067 int err = dc1394_get_control_registers(camera_, offset, &val[0], num_regs);
00068 return (DC1394_SUCCESS == err);
00069 }
00076 bool Registers::setControlRegisters(const uint64_t offset,
00077 const std::vector<uint32_t> &val)
00078 {
00079 int err = dc1394_set_control_registers(camera_, offset, &val[0], val.size());
00080 return (DC1394_SUCCESS == err);
00081 }
00082
00084 bool Registers::getAbsoluteRegister(const uint64_t offset,
00085 const uint32_t feature,
00086 uint32_t &val)
00087 {
00088 int err = dc1394_get_absolute_register(camera_, feature, offset, &val);
00089 return (DC1394_SUCCESS == err);
00090 }
00092 bool Registers::setAbsoluteRegister(const uint64_t offset,
00093 const uint32_t feature,
00094 const uint32_t val)
00095 {
00096 int err = dc1394_set_absolute_register(camera_, feature, offset, val);
00097 return (DC1394_SUCCESS == err);
00098 }
00099
00101 bool Registers::getFormat7Register(const uint64_t offset,
00102 const uint32_t mode,
00103 uint32_t &val)
00104 {
00105 int err = dc1394_get_format7_register(camera_, mode, offset, &val);
00106 return (DC1394_SUCCESS == err);
00107 }
00109 bool Registers::setFormat7Register(const uint64_t offset,
00110 const uint32_t mode,
00111 const uint32_t val)
00112 {
00113 int err = dc1394_set_format7_register(camera_, mode, offset, val);
00114 return (DC1394_SUCCESS == err);
00115 }
00116
00118 bool Registers::getAdvancedControlRegisters(const uint64_t offset,
00119 const uint32_t num_regs,
00120 std::vector<uint32_t> &val)
00121 {
00122 int err = dc1394_get_adv_control_registers(camera_, offset, &val[0],
00123 num_regs);
00124 return (DC1394_SUCCESS == err);
00125 }
00127 bool Registers::setAdvancedControlRegisters(const uint64_t offset,
00128 const std::vector<uint32_t> &val)
00129 {
00130 int err = dc1394_set_adv_control_registers(camera_, offset, &val[0],
00131 val.size());
00132 return (DC1394_SUCCESS == err);
00133 }
00134
00136 bool Registers::getPIORegister(const uint64_t offset, uint32_t &val)
00137 {
00138 int err = dc1394_get_PIO_register(camera_, offset, &val);
00139 return (DC1394_SUCCESS == err);
00140 }
00142 bool Registers::setPIORegister(const uint64_t offset, const uint32_t val)
00143 {
00144 int err = dc1394_set_PIO_register(camera_, offset, val);
00145 return (DC1394_SUCCESS == err);
00146 }
00147
00149 bool Registers::getSIORegister(const uint64_t offset, uint32_t &val)
00150 {
00151 int err = dc1394_get_SIO_register(camera_, offset, &val);
00152 return (DC1394_SUCCESS == err);
00153 }
00155 bool Registers::setSIORegister(const uint64_t offset, const uint32_t val)
00156 {
00157 int err = dc1394_set_SIO_register(camera_, offset, val);
00158 return (DC1394_SUCCESS == err);
00159 }
00160
00162 bool Registers::getStrobeRegister(const uint64_t offset,uint32_t &val)
00163 {
00164 int err = dc1394_get_strobe_register(camera_, offset, &val);
00165 return (DC1394_SUCCESS == err);
00166 }
00168 bool Registers::setStrobeRegister(const uint64_t offset, const uint32_t val)
00169 {
00170 int err = dc1394_set_strobe_register(camera_, offset, val);
00171 return (DC1394_SUCCESS == err);
00172 }
00173
00174 }