CircuitPython module for the SI4713 RDS FM transmitter. See examples/simpletest.py for a demo of the usage. Based on the Arduino library at: https://github.com/adafruit/Adafruit-Si4713-Library/
- Author(s): Tony DiCola
SI4713(i2c, *, address=99, reset=None, timeout_s=0.1)¶
- SI4713 RDS FM transmitter. Initialize by specifying:
- i2c: The I2C bus connected to the board.
- Optionally specify:
- address: The I2C address if it has been changed.
- reset: A DigitalInOut instance connected to the board’s reset line,
- this will be used to perform a soft reset when necessary.
- timeout_s: The amount of time (in seconds) to wait for a command to
- succeed. If this timeout is exceed a runtime error is thrown.
Retrieve the ASQ or audio signal quality status value from the chip. This is a byte that indicates if the transmitted input audio signal is overmodulating (too high) or above/below input audio level thresholds. See page 25 of AN332 for more discussion of this value: https://www.silabs.com/documents/public/application-notes/AN332.pdf
configure_rds(program_id, station=None, rds_buffer=None)¶
Configure and enable the RDS broadcast of the specified program ID. Program ID must be a 16-bit value that will be broacast on the RDS bands of the transmitter. Specify optional station and RDS buffer strings that will be used to broadcast the station and currently playing song information, or later set the rds_station and rds_buffer to change these values too. The station value is up to 96 bytes long, and the buffer is up to 106 bytes long. Note this will configure RDS properties of the chip for a typical North American RDS broadcast (deviation, mix, repeat, etc. parameters).
gpio_control(gpio1=False, gpio2=False, gpio3=False)¶
Control the GPIO outputs of the chip. Each gpio1, gpio2, gpio3 parameter is a boolean that indicates if that GPIO channel (corresponding to GPIO1, GPIO2, GPIO3 of the chip respectively) is driven actively (True) or is high-impedence/off (False). By default any unspecified GPIO is set to high-impedence/off unless otherwise provided.
gpio_set(gpio1=False, gpio2=False, gpio3=False)¶
Drive the GPIO outputs of the chip that are enabled with active output. Each gpio1, gpio2, gpio3 parameter is a boolean that indicates if the associated GPIO (corresponding to GPIO1, GPIO2, GPIO3 of the chip respectively) is driven high (True) or low (False). By default all GPIO are assumed to be set low (False) unless otherwise specified. Note that you must first set GPIOs to active output with the gpio_control function to see their output physically change.
Read the input level of audio to the chip and return it in dBfs units.
Read the interrupt bit status of the chip. This will return a byte value with interrupt status bits as defined by the radio, see page 11 of the AN332 programming guide: https://www.silabs.com/documents/public/application-notes/AN332.pdf
Set the RDS broadcast buffer to the specified byte string. Can be at most 106 bytes long and will be padded with blank spaces if less.
Set the RDS broadcast station to the specified byte string. Can be at most 96 bytes long and will be padded with blank spaces if less.
Measure the received noise level for the specified frequency (in kilohertz, 76mhz - 108mhz and must be a multiple of 50) and return its value in units of dBuV (decibel microvolts). Will use automatic antenna capacitance tuning by default, otherwise specify an antenna capacitance in pF from 0.25 to 47.75 (only steps of 0.25pF are supported).
Perform a reset of the chip using the reset line. Will also perform necessary chip power up procedures.
Set both the transmit power (in dBuV, from 88-115) and antenna capacitance of the transmitter. Capacitance is a value specified in pF from 0.25 to 47.75 (in 0.25 steps), or 0 to indicate automatic tuning. You typically don’t need to use this function unless you want explicit control of tuning antenna capacitance, instead for simple transmit power changes use the tx_power property (which assumes automatic antenna capacitance).
Read the transmit antenna capacitance in pico-Farads (pF). Use the set_tx_power_capacitance function to change this value (must also change transmit power at the same time). It’s uncommon to adjust this beyond the automatic tuning option!
Get and set the transmit frequency of the chip (in kilohertz). See AN332 page 19 for a discussion of the constraints on this value, in particular only a multiple of 50khz can be specified, and the value must be between 76 and 108mhz.
Get and set the transmit power in dBuV (decibel microvolts). Can be a value within the range of 88-115, or 0 to indicate transmission power is disabled. Setting this value assumes auto-tuning of antenna capacitance, see the set_tx_power_capacitance function for explicit control of setting both transmit power and capacitance if needed.