PU2CLR Si4735 Arduino Library 2.1.4
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
|
SI473X data representation. More...
Data Structures | |
union | si473x_powerup |
Power Up arguments data type. More... | |
union | si473x_gpio |
Data type for Enables output for GPO1, GPO2 and GPO3. More... | |
union | si473x_gpio_ien |
Data type for Configuring the sources for the GPO2/INT interrupt pin. More... | |
union | si47x_frequency |
Represents how the frequency is stored in the si4735. More... | |
union | si47x_antenna_capacitor |
Antenna Tuning Capacitor data type manupulation. More... | |
union | si47x_set_frequency |
AM Tune frequency data type command (AM_TUNE_FREQ command) More... | |
union | si47x_seek |
Seek frequency (automatic tuning). ARG1. More... | |
struct | si47x_seek_am_complement |
Seek frequency (automatic tuning) AM complement (ARG2, ARG3, ARG4 and ARG5) More... | |
union | si47x_status |
Status response data representation. More... | |
union | si47x_response_status |
Response status command. More... | |
union | si47x_firmware_information |
Data representation for Firmware Information (GET_REV) More... | |
union | si47x_firmware_query_library |
Firmware Query Library ID response. More... | |
union | si47x_tune_status |
Seek station status. More... | |
union | si47x_property |
Data type to deal with SET_PROPERTY command. More... | |
union | si47x_rqs_status |
Radio Signal Quality data representation. More... | |
union | si47x_frontend_agc_control |
Adjusts the AM AGC for external front-end attenuator and external front-end cascode LNA. More... | |
union | si47x_rds_command |
Data type for RDS Status command and response information. More... | |
union | si47x_rds_status |
Response data type for current channel and reads an entry from the RDS FIFO. More... | |
union | si47x_rds_int_source |
FM_RDS_INT_SOURCE property data type. More... | |
union | si47x_rds_config |
Data type for FM_RDS_CONFIG Property. More... | |
union | si47x_rds_blocka |
Block A data type. More... | |
union | si47x_rds_blockb |
Block B data type. More... | |
union | si47x_rds_date_time |
union | si47x_agc_status |
union | si47x_agc_overrride |
union | si47x_bandwidth_config |
union | si47x_ssb_mode |
union | si4735_digital_output_format |
Digital audio output format data structure (Property 0x0102. DIGITAL_OUTPUT_FORMAT). More... | |
union | si4735_eeprom_patch_header |
patch header stored in a eeprom More... | |
struct | si4735_digital_output_sample_rate |
Digital audio output sample structure (Property 0x0104. DIGITAL_OUTPUT_SAMPLE_RATE). More... | |
struct | si473x_powerup.arg |
struct | si473x_gpio.arg |
struct | si473x_gpio_ien.arg |
struct | si47x_frequency.raw |
struct | si47x_antenna_capacitor.raw |
struct | si47x_set_frequency.arg |
struct | si47x_seek.arg |
struct | si47x_status.refined |
struct | si47x_response_status.resp |
struct | si47x_firmware_information.resp |
struct | si47x_firmware_query_library.resp |
struct | si47x_tune_status.arg |
struct | si47x_property.raw |
struct | si47x_rqs_status.resp |
struct | si47x_frontend_agc_control.field |
struct | si47x_rds_command.arg |
struct | si47x_rds_status.resp |
struct | si47x_rds_int_source.refined |
struct | si47x_rds_config.arg |
struct | si47x_rds_blocka.refined |
struct | si47x_rds_blocka.raw |
struct | si47x_rds_blockb.group0 |
struct | si47x_rds_blockb.group2 |
struct | si47x_rds_blockb.refined |
struct | si47x_rds_blockb.raw |
struct | si47x_rds_date_time.refined |
struct | si47x_agc_status.refined |
struct | si47x_agc_overrride.arg |
struct | si47x_bandwidth_config.param |
struct | si47x_ssb_mode.param |
struct | si4735_digital_output_format.refined |
struct | si4735_eeprom_patch_header.refined |
SI473X data representation.
The goal of this approach is separating data from code. The Si47XX family works with many internal data that can be represented by data structure or defined data type in C/C++. These C/C++ resources have been used widely here. This approach made the library easier to build and maintain. Each data structure created here has its reference (name of the document and page on which it was based). In other words, to make the SI47XX device easier to deal, some defined data types were created to handle byte and bits to process commands, properties and responses. These data types will be usefull to deal with SI473X
union si473x_powerup |
Power Up arguments data type.
Data Fields | ||
---|---|---|
struct si473x_powerup.arg | arg | Refined powerup parameters. |
uint8_t | raw[2] | Raw powerup parameters data. Same arg memory position. So, same content. |
union si473x_gpio |
Data type for Enables output for GPO1, GPO2 and GPO3.
GPO1, 2, and 3 can be configured for output (Hi-Z or active drive) by setting the GPO1OEN, GPO2OEN, and GPO3OEN bit.
Data Fields | ||
---|---|---|
struct si473x_gpio.arg | arg | Refined powerup parameters. |
uint8_t | raw |
union si473x_gpio_ien |
Data type for Configuring 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.
Data Fields | ||
---|---|---|
struct si473x_gpio_ien.arg | arg | |
uint16_t | raw |
union si47x_frequency |
Represents how the frequency is stored in the si4735.
It helps to convert frequency in uint16_t to two bytes (uint8_t) (FREQL and FREQH)
Data Fields | ||
---|---|---|
struct si47x_frequency.raw | raw | Raw data that represents the frequency stored in the Si47XX device. |
uint16_t | value | frequency (integer value) |
union si47x_antenna_capacitor |
Antenna Tuning Capacitor data type manupulation.
Data Fields | ||
---|---|---|
struct si47x_antenna_capacitor.raw | raw | |
uint16_t | value |
union si47x_set_frequency |
AM Tune frequency data type command (AM_TUNE_FREQ command)
Data Fields | ||
---|---|---|
struct si47x_set_frequency.arg | arg | |
uint8_t | raw[5] |
union si47x_seek |
Seek frequency (automatic tuning). ARG1.
Represents searching for a valid frequency data type AM and FM.
When AM, the searching data have to be complemented by si47x_seek_am_complement.
Data Fields | ||
---|---|---|
struct si47x_seek.arg | arg | |
uint8_t | raw |
struct si47x_seek_am_complement |
union si47x_status |
Status response data representation.
Represents searching for a valid frequency data type.
Data Fields | ||
---|---|---|
struct si47x_status.refined | refined | |
uint8_t | raw |
union si47x_response_status |
Response status command.
Response data from a query status command
Data Fields | ||
---|---|---|
struct si47x_response_status.resp | resp | |
uint8_t | raw[8] | Check it. |
union si47x_firmware_information |
Data representation for Firmware Information (GET_REV)
The part number, chip revision, firmware revision, patch revision and component revision numbers.
Data Fields | ||
---|---|---|
struct si47x_firmware_information.resp | resp | |
uint8_t | raw[9] |
union si47x_firmware_query_library |
Firmware Query Library ID response.
Used to represent the response of a power up command with FUNC = 15 (patch)
To confirm that the patch is compatible with the internal device library revision, the library revision should be confirmed by issuing the POWER_UP command with Function = 15 (query library ID)
Data Fields | ||
---|---|---|
struct si47x_firmware_query_library.resp | resp | |
uint8_t | raw[8] |
union si47x_tune_status |
Seek station status.
Status of FM_TUNE_FREQ or FM_SEEK_START commands or Status of AM_TUNE_FREQ or AM_SEEK_START commands.
Data Fields | ||
---|---|---|
struct si47x_tune_status.arg | arg | |
uint8_t | raw |
union si47x_property |
Data type to deal with SET_PROPERTY command.
Property Data type (help to deal with SET_PROPERTY command on si473X)
Data Fields | ||
---|---|---|
struct si47x_property.raw | raw | |
uint16_t | value |
union si47x_rqs_status |
Radio Signal Quality data representation.
Data type for status information about the received signal quality (FM_RSQ_STATUS and AM_RSQ_STATUS)
Data Fields | ||
---|---|---|
struct si47x_rqs_status.resp | resp | |
uint8_t | raw[8] |
union si47x_frontend_agc_control |
Adjusts the AM AGC for external front-end attenuator and external front-end cascode LNA.
Data Fields | ||
---|---|---|
struct si47x_frontend_agc_control.field | field | |
uint16_t | word |
union si47x_rds_command |
Data type for RDS Status command and response information.
Data Fields | ||
---|---|---|
struct si47x_rds_command.arg | arg | |
uint8_t | raw |
union si47x_rds_status |
Response data type for current channel and reads an entry from the RDS FIFO.
Data Fields | ||
---|---|---|
struct si47x_rds_status.resp | resp | |
uint8_t | raw[13] |
union si47x_rds_int_source |
FM_RDS_INT_SOURCE property data type.
Data Fields | ||
---|---|---|
struct si47x_rds_int_source.refined | refined | |
uint8_t | raw[2] |
union si47x_rds_config |
Data type for FM_RDS_CONFIG Property.
IMPORTANT: all block errors must be less than or equal the associated block error threshold for the group to be stored in the RDS FIFO. 0 = No errors; 1 = 1–2 bit errors detected and corrected; 2 = 3–5 bit errors detected and corrected; 3 = Uncorrectable. Recommended Block Error Threshold options: 2,2,2,2 = No group stored if any errors are uncorrected. 3,3,3,3 = Group stored regardless of errors. 0,0,0,0 = No group stored containing corrected or uncorrected errors. 3,2,3,3 = Group stored with corrected errors on B, regardless of errors on A, C, or D.
Data Fields | ||
---|---|---|
struct si47x_rds_config.arg | arg | |
uint8_t | raw[2] |
union si47x_rds_blocka |
Block A data type.
Data Fields | ||
---|---|---|
struct si47x_rds_blocka.refined | refined | |
struct si47x_rds_blocka.raw | raw |
union si47x_rds_blockb |
Block B data type.
For GCC on System-V ABI on 386-compatible (32-bit processors), the following stands:
1) Bit-fields are allocated from right to left (least to most significant). 2) A bit-field must entirely reside in a storage unit appropriate for its declared type. Thus a bit-field never crosses its unit boundary. 3) Bit-fields may share a storage unit with other struct/union members, including members that are not bit-fields. Of course, struct members occupy different parts of the storage unit. 4) Unnamed bit-fields' types do not affect the alignment of a structure or union, although individual bit-fields' member offsets obey the alignment constraints.
Data Fields | ||
---|---|---|
struct si47x_rds_blockb.group0 | group0 | |
struct si47x_rds_blockb.group2 | group2 | |
struct si47x_rds_blockb.refined | refined | |
struct si47x_rds_blockb.raw | raw |
union si47x_rds_date_time |
Group type 4A ( RDS Date and Time) When group type 4A is used by the station, it shall be transmitted every minute according to EN 50067. This Structure uses blocks 2,3 and 5 (B,C,D)
ATTENTION: To make it compatible with 8, 16 and 32 bits platforms and avoid Crosses boundary, it was necessary to split minute and hour representation.
Data Fields | ||
---|---|---|
struct si47x_rds_date_time.refined | refined | |
uint8_t | raw[6] |
union si47x_agc_status |
AGC data types FM / AM and SSB structure to AGC
Data Fields | ||
---|---|---|
struct si47x_agc_status.refined | refined | |
uint8_t | raw[3] |
union si47x_agc_overrride |
If FM, Overrides AGC setting by disabling the AGC and forcing the LNA to have a certain gain that ranges between 0 (minimum attenuation) and 26 (maximum attenuation). If AM, overrides the AGC setting by disabling the AGC and forcing the gain index that ranges between 0
Data Fields | ||
---|---|---|
struct si47x_agc_overrride.arg | arg | |
uint8_t | raw[2] |
union si47x_bandwidth_config |
The bandwidth of the AM channel filter data type AMCHFLT values: 0 = 6 kHz Bandwidth 1 = 4 kHz Bandwidth 2 = 3 kHz Bandwidth 3 = 2 kHz Bandwidth 4 = 1 kHz Bandwidth 5 = 1.8 kHz Bandwidth 6 = 2.5 kHz Bandwidth, gradual roll off 7–15 = Reserved (Do not use)
Data Fields | ||
---|---|---|
struct si47x_bandwidth_config.param | param | |
uint8_t | raw[2] |
union si47x_ssb_mode |
SSB - datatype for SSB_MODE (property 0x0101)
Data Fields | ||
---|---|---|
struct si47x_ssb_mode.param | param | |
uint8_t | raw[2] |
union si4735_digital_output_format |
Digital audio output format data structure (Property 0x0102. DIGITAL_OUTPUT_FORMAT).
Used to configure: DCLK edge, data format, force mono, and sample precision.
Data Fields | ||
---|---|---|
struct si4735_digital_output_format.refined | refined | |
uint16_t | raw |
union si4735_eeprom_patch_header |
patch header stored in a eeprom
This data type represents o header of a eeprom with a patch content
This structure will be used to read an eeprom generated by leo sketch SI47XX_09_SAVE_SSB_PATCH_EEPROM.ino.
The sketch SI47XX_09_SAVE_SSB_PATCH_EEPROM can be found on Examples/SI47XX_TOOLS folder
Data Fields | ||
---|---|---|
struct si4735_eeprom_patch_header.refined | refined | |
uint8_t | raw[32] |
struct si4735_digital_output_sample_rate |
struct si473x_powerup.arg |
struct si473x_gpio.arg |
struct si473x_gpio_ien.arg |
struct si47x_frequency.raw |
struct si47x_antenna_capacitor.raw |
struct si47x_set_frequency.arg |
struct si47x_seek.arg |
struct si47x_status.refined |
struct si47x_response_status.resp |
struct si47x_firmware_information.resp |
struct si47x_firmware_query_library.resp |
struct si47x_tune_status.arg |
struct si47x_rqs_status.resp |
struct si47x_rds_command.arg |
struct si47x_rds_status.resp |
struct si47x_rds_int_source.refined |
struct si47x_rds_config.arg |
struct si47x_rds_blockb.group0 |
struct si47x_rds_blockb.group2 |
struct si47x_rds_blockb.refined |
struct si47x_rds_date_time.refined |
struct si47x_agc_status.refined |
struct si47x_bandwidth_config.param |
struct si47x_ssb_mode.param |
struct si4735_digital_output_format.refined |