PU2CLR Si4735 Arduino Library 2.1.4
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
|
Functions | |
si47x_status | SI4735::getInterruptStatus () |
Updates bits 6:0 of the status byte. | |
void | SI4735::setGpioCtl (uint8_t GPO1OEN, uint8_t GPO2OEN, uint8_t GPO3OEN) |
Enables output for GPO1, 2, and 3. | |
void | SI4735::setGpio (uint8_t GPO1LEVEL, uint8_t GPO2LEVEL, uint8_t GPO3LEVEL) |
Sets the output level (high or low) for GPO1, 2, and 3. | |
void | SI4735::setGpioIen (uint8_t STCIEN, uint8_t RSQIEN, uint8_t ERRIEN, uint8_t CTSIEN, uint8_t STCREP, uint8_t RSQREP) |
Configures the sources for the GPO2/INT interrupt pin. | |
int16_t | SI4735::getDeviceI2CAddress (uint8_t resetPin) |
I2C bus address setup. | |
void | SI4735::setDeviceI2CAddress (uint8_t senPin) |
Sets the I2C Bus Address. | |
void | SI4735::setDeviceOtherI2CAddress (uint8_t i2cAddr) |
Sets the other I2C Bus Address (for Si470X) | |
|
protected |
Updates bits 6:0 of the status byte.
This command should be called after any command that sets the STCINT or RSQINT bits.
When polling this command should be periodically called to monitor the STATUS byte, and when using interrupts, this command should be called after the interrupt is set to update the STATUS byte.
The CTS bit (and optional interrupt) is set when it is safe to send the next command.
References SI4735::waitToSend().
void SI4735::setGpioCtl | ( | uint8_t | GPO1OEN, |
uint8_t | GPO2OEN, | ||
uint8_t | GPO3OEN | ||
) |
Enables output for GPO1, 2, and 3.
GPO1, 2, and 3 can be configured for output (Hi-Z or active drive) by setting the GPO1OEN, GPO2OEN, and GPO3OEN bit.
The state (high or low) of GPO1, 2, and 3 is set with the GPIO_SET command.
To avoid excessive current consumption due to oscillation, GPO pins should not be left in a high impedance state.
GPIO Output Enable | value 0 | value 1 |
---|---|---|
GPO1OEN | Output Disabled (Hi-Z) (default) | Output Enabled |
GPO2OEN | Output Disabled (Hi-Z) (default) | Output Enabled |
GPO3OEN | Output Disabled (Hi-Z) (default) | Output Enabled |
GPO1OEN | |
GPO2OEN | |
GPO3OEN |
References SI4735::waitToSend().
void SI4735::setGpio | ( | uint8_t | GPO1LEVEL, |
uint8_t | GPO2LEVEL, | ||
uint8_t | GPO3LEVEL | ||
) |
Sets the output level (high or low) for GPO1, 2, and 3.
GPO1, 2, and 3 can be configured for output by setting the GPO1OEN, GPO2OEN, and GPO3OEN bit in the GPIO_CTL command.
To avoid excessive current consumption due to oscillation, GPO pins should not be left in a high impedance state.
To avoid excessive current consumption due to oscillation, GPO pins should not be left in a high impedance state.
GPIO Output Enable | value 0 | value 1 |
---|---|---|
GPO1LEVEL | Output low (default) | Output high |
GPO2LEVEL | Output low (default) | Output high |
GPO3LEVEL | Output low (default) | Output high |
GPO1LEVEL | |
GPO2LEVEL | |
GPO3LEVEL |
References SI4735::waitToSend().
void SI4735::setGpioIen | ( | uint8_t | STCIEN, |
uint8_t | RSQIEN, | ||
uint8_t | ERRIEN, | ||
uint8_t | CTSIEN, | ||
uint8_t | STCREP, | ||
uint8_t | RSQREP | ||
) |
Configures the sources for the GPO2/INT interrupt pin.
Valid sources are the lower 8 bits of the STATUS byte, including CTS, ERR, RSQINT, and STCINT bits.
The corresponding bit is set before the interrupt occurs. The CTS bit (and optional interrupt) is set when it is safe to send the next command.
The CTS interrupt enable (CTSIEN) can be set with this property and the POWER_UP command.
The state of the CTSIEN bit set during the POWER_UP command can be read by reading this property and modified by writing this property.
STCIEN | Seek/Tune Complete Interrupt Enable (0 or 1). |
RSQIEN | RSQ Interrupt Enable (0 or 1). |
ERRIEN | ERR Interrupt Enable (0 or 1). |
CTSIEN | CTS Interrupt Enable (0 or 1). |
STCREP | STC Interrupt Repeat (0 or 1). |
RSQREP | RSQ Interrupt Repeat(0 or 1). |
int16_t SI4735::getDeviceI2CAddress | ( | uint8_t | resetPin | ) |
I2C bus address setup.
Scans for two possible addresses for the Si47XX (0x11 or 0x63).
This function also sets the system to use the found I2C bus address of Si47XX.
The default I2C address is 0x11. So, you do not need to use this function if you are using an SI4735 and the
SEN PIN is configured to ground (GND) or you are using the SI4732 and tnhe SEN PIN is configured to Vcc.
Use this function if you do not know how the SEN pin is configured.
uint8_t | resetPin MCU Mater (Arduino) reset pin |
References SI4735::reset().
void SI4735::setDeviceI2CAddress | ( | uint8_t | senPin | ) |
Sets the I2C Bus Address.
The parameter senPin can be 0 or 1 (is not the I2C bus address).
It refers to the SEN pin setup of your schematic (eletronic circuit).
If are using an SI4735 and SEN pin is connected to the ground, call this function with senPin = 0; else senPin = 1.
If are using an SI4732 and SEN pin is connected to the Vcc, call this function with senPin = 0; else senPin = 1.
Consider using the getDeviceI2CAddress function instead.
senPin | 0 - SI4735 device: when the pin SEN (16 on SSOP version or pin 6 on QFN version) is set to low (GND - 0V); 1 - Si4735 device: when the pin SEN (16 on SSOP version or pin 6 on QFN version) is set to high (+3.3V). If you are using an SI4732 device, reverse the above logic (1 - GND or 0 - +3.3V). |
void SI4735::setDeviceOtherI2CAddress | ( | uint8_t | i2cAddr | ) |
Sets the other I2C Bus Address (for Si470X)
You can set another I2C address different of 0x11 and 0x63
It can be useful if another device made by Silicon Labs uses another address setup
uint8_t | i2cAddr (example 0x10) |