23 debug(
"SpecsMezzanine::SpecsMezzanine",
"SpecsMezzanine built.");
51 debug(
"SpecsMezzanine::addBus",
52 element->
name()+
" added to the bus child tree.");
67 transform(cmd[0].begin(),cmd[0].end(),cmd[0].begin(),tolower);
69 if (cmd[0].compare(
"address")==0){
74 if (cmd[0].compare(
"address")==0){
79 if (cmd[0].compare(
"reset")==0){
84 if (cmd[0].compare(
"internalreset")==0){
89 if (cmd[0].compare(
"led")==0){
90 if ( 0==atoi(cmd[1].c_str()) ) {
99 if (cmd[0].compare(
"regwrite")==0){
101 "Register "+ cmd[1]+
" -> Write " + cmd[2]);
103 atoi(cmd[2].c_str()));
107 if (cmd[0].compare(
"i2cwritereg")==0){
108 int add = atoi(cmd[1].c_str());
109 int out = atoi(cmd[2].c_str());
110 int ssadd = atoi(cmd[3].c_str());
111 int nword = atoi(cmd[4].c_str());
113 for (
int i = 0 ; i< nword ; ++i ) {
114 data[i]=(
unsigned char) (atoi(cmd[5+i].c_str()));
117 "I2C Register "+ cmd[2]+
"/" +
itos(add) +
118 " -> Write " + cmd[4] +
" words.");
123 if (cmd[0].compare(
"i2creadreg")==0){
124 int add = atoi(cmd[1].c_str());
125 int out = atoi(cmd[2].c_str());
126 int ssadd = atoi(cmd[3].c_str());
127 int nword = atoi(cmd[4].c_str());
130 "I2C Register "+ cmd[2]+
"/" +
itos(add) +
131 " -> Read " + cmd[3] +
" words.");
133 for (
int i = 0 ; i< nword ; ++i ) {
139 if (cmd[0].compare(
"regread")==0){
144 "Register "+ cmd[1]+
" -> " +
itos(val) );
148 if (cmd[0].compare(
"help")==0){
160 info(
"SpecsMezzanine",
"Specs Mezzanine Element help");
162 msgSvc(0,
"",
"Address # : set slave address at #");
163 msgSvc(0,
"",
"Reset : reset of the slave");
164 msgSvc(0,
"",
"ResetInternal : internal reset of the slave");
165 msgSvc(0,
"",
"RegWrite #0 #1 : write register #0 with value #1");
166 msgSvc(0,
"",
"RegRead #0 #1 : read register #");
175 unsigned char reg = 8 ;
179 val = (val&0xFF00)*100+(val&0xFF);
182 warning(
"" ,
"Compilation in _NoDevice_ mode." );
191 unsigned char reg = 4 ;
196 val = ( val & 0xF7FF ) ;
198 debug(
"SpecsMezzanine::led",
"setting Glue LEDs On");
201 val = ( val | 0x0800 ) ;
203 debug(
"SpecsMezzanine::led",
"setting Glue LEDs OFF");
206 warning(
"" ,
"Compilation in _NoDevice_ mode." );
214 unsigned char reg = 4 ;
218 if ( 0 != ( val & 0x0800 ) ){
219 debug(
"SpecsMezzanine::led",
"Glue LEDs are OFF");
223 warning(
"" ,
"Compilation in _NoDevice_ mode." );
226 debug(
"SpecsMezzanine::led",
"Glue LEDs are ON");
void info(std::string mymsg)
SpecsMezzanine()
Standard constructor.
void setOutputSelect(U8 outputSelect)
void setParent(Hierarchy *parent)
void setName(std::string name)
bool specsReadI2c(unsigned char address, unsigned char nOctects, U8 *i2cWords)
virtual ~SpecsMezzanine()
Standard Desctructor.
bool specsWriteI2c(unsigned char address, unsigned char nData, U8 *data)
void setAddress(U8 address)
bool specsWriteRegister(unsigned char, unsigned short)
void setType(std::string type)
void debug(std::string mymsg)
def data(object, stream=None)
void setAddress(unsigned char)
virtual void addChild(Hierarchy *element)
void msgSvc(int level, std::string msg, std::string name)
void warning(std::string mymsg)
bool cmdline(std::vector< std::string >)
bool specsReadRegister(unsigned char, U16 &)