示例#1
0
void Radio::FMPowerOn() {

	i2c.beginTransmission(SI4735ADR);
	i2c.write(0x01);
	i2c.write(0x10);
	i2c.write(0x05);
	i2c.endTransmission();
	_delay_ms(500);
}
示例#2
0
void Radio::seekDownAMFreq() {

	i2c.beginTransmission(SI4735ADR);
	i2c.write(0x41);
	i2c.write(0x04);
	i2c.write(0x00);
	i2c.write(0x00);
	i2c.endTransmission();
	_delay_ms(100);
}
示例#3
0
void Radio::setFMFreq(int freq) {
	char hbyte, lbyte;
	
	hbyte = freq>>8;
	lbyte = freq & 0x00FF;
	i2c.beginTransmission(SI4735ADR);
	i2c.write(0x20);
	i2c.write(0x00);
	i2c.write(hbyte);
	i2c.write(lbyte);
	i2c.endTransmission();
	_delay_ms(100);
}
示例#4
0
void Radio::updateAMRsqStatus() {
	int i;
	
	i2c.beginTransmission(SI4735ADR);
	i2c.write(0x43);
	i2c.write(0x00);
	i2c.endTransmission();
	_delay_ms(2);

	i2c.requestFrom(SI4735ADR, 6);
	for(int i = 0; i < 6; i++) {
		switch(i) {
			case 4:
			AMrssi = i2c.read();
			break;
			default:
			i2c.read();
		}
	}
}
示例#5
0
void Radio::setProperty(int prop, int val) {
	char propertyHighByte;
	char propertyLowByte;
	char propertyValueHighByte;
	char propertyValueLowByte;
	
	propertyHighByte = prop>>8;
	propertyLowByte = prop & 0x00FF;
	propertyValueHighByte = val>>8;
	propertyValueLowByte = val & 0x00FF;
	
	i2c.beginTransmission(SI4735ADR);
	i2c.write(0x12);
	i2c.write(0x00);
	i2c.write(propertyHighByte);
	i2c.write(propertyLowByte);
	i2c.write(propertyValueHighByte);
	i2c.write(propertyValueLowByte);
	i2c.endTransmission();
	_delay_ms(20);
}