Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What did this function do? of setRaw2() #1

Open
GlanTUT opened this issue Mar 5, 2019 · 2 comments
Open

What did this function do? of setRaw2() #1

GlanTUT opened this issue Mar 5, 2019 · 2 comments

Comments

@GlanTUT
Copy link

GlanTUT commented Mar 5, 2019

hi boy :
i try to transplant this drive with c language for 8 bit mcu, for TLV320ADC3100, but i have encountered some trouble, like this

// file of TLV320DAC3101.cpp       line in 107 
void TLV320DAC3101::setRaw2(uint8_t reg, uint8_t val1, uint8_t val2);

What did this function do? 
save 16 bit val with two register?  may i use another function of setRaw(), and let the reg++;  
because i see .cpp file line 322 like this, cryying.

And if i have an unexpected harvest about ic TLV320ADC3100.

Thinks and sincere regards
@majenkotech
Copy link
Contributor

It is basically the same as setRaw but places two values in subsequent registers using auto increment. It's to satisfy this requirement in the datasheet:

When programming any coefficient value for a filter, the MSB register must always be written first, immediately followed by the LSB register. Even if only the MSB or LSB portion of the coefficient changes, both registers must be written in this sequence.

It would probably work with two setRaw calls, but that would be less efficient since it sets the register address for each call. This way is done as one transaction.

[start]<slaveaddr>[ack]<msbaddr>[ack]<msb>[ack]<lsb>[ack][stop]

@GlanTUT
Copy link
Author

GlanTUT commented Mar 6, 2019

OK thank you for your help and contribution. ヽ(●´ε`●)ノ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants