Skip to content

Writing Method

Tiago Lobão edited this page Aug 26, 2018 · 1 revision

You can read a regiter using the the write method from the CS5490 class

  void write(int page, int address, long value);

Choose the page and address value from the CS5490 Datasheet

The Value is a long variable with 3 bytes information to send. An example of a write usage is the setBaudRate method:

void CS5490::setBaudRate(long value){

	//Calculate the correct binary value
	uint32_t hexBR = ceil(value*0.5242880/MCLK);
	if (hexBR > 65535) hexBR = 65535;
	hexBR += 0x020000;

	this->write(0x80,0x07,hexBR);
	delay(100); //To avoid bugs from ESP32

	//Reset Serial communication from controller
	cSerial->end();
	cSerial->begin(value);
	return;
}

"line" variable is consider the default instance of the class CS5490 for every example in this Wiki

Clone this wiki locally