PU2CLR Si4735 Arduino Library 2.1.4
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
Loading...
Searching...
No Matches
Deal with Interrupt and I2C bus

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)
 

Detailed Description

Function Documentation

◆ getInterruptStatus()

si47x_status SI4735::getInterruptStatus ( )
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.

See also
Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 135
si47x_status
waitToSend
Returns
si47x_status the bit data structure with the status response

References SI4735::waitToSend().

◆ setGpioCtl()

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
See also
Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 82 and 144
Parameters
GPO1OEN
GPO2OEN
GPO3OEN

References SI4735::waitToSend().

◆ setGpio()

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
See also
Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 83 and 145
Parameters
GPO1LEVEL
GPO2LEVEL
GPO3LEVEL

References SI4735::waitToSend().

◆ setGpioIen()

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.

See also
Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); page 146
Parameters
STCIENSeek/Tune Complete Interrupt Enable (0 or 1).
RSQIENRSQ Interrupt Enable (0 or 1).
ERRIENERR Interrupt Enable (0 or 1).
CTSIENCTS Interrupt Enable (0 or 1).
STCREPSTC Interrupt Repeat (0 or 1).
RSQREPRSQ Interrupt Repeat(0 or 1).

◆ getDeviceI2CAddress()

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.

Parameters
uint8_tresetPin MCU Mater (Arduino) reset pin
Returns
int16_t 0x11 if the SEN pin of the Si47XX is low or 0x63 if the SEN pin of the Si47XX is HIGH or 0x0 if error.

References SI4735::reset().

◆ setDeviceI2CAddress()

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.

Parameters
senPin0 - 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).
See also
: getDeviceI2CAddress

◆ setDeviceOtherI2CAddress()

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

Parameters
uint8_ti2cAddr (example 0x10)