fm 2.0.0.0
|
Functions | |
void | fm_cfg_setup (fm_cfg_t *cfg) |
Config Object Initialization function. | |
FM_RETVAL | fm_init (fm_t *ctx, fm_cfg_t *cfg) |
Initialization function. | |
void | fm_default_cfg (fm_t *ctx) |
Click Default Configuration function. | |
void | fm_generic_write (fm_t *ctx, uint16_t *reg_buf) |
Generic write function. | |
void | fm_generic_read (fm_t *ctx, uint16_t *reg_buf) |
Reading all registers. | |
void | fm_set_bits (uint16_t *register_buffer, uint16_t register_address, uint16_t bits_mask, uint16_t bits_value) |
Setting bits in specific register on a specific bit location. | |
uint8_t | fm_set_seek_threshold (fm_t *ctx, uint16_t seek_threshold) |
Setting seek threshold value. | |
uint8_t | fm_set_volume (fm_t *ctx, uint8_t volume_level) |
Setting volume value. | |
uint8_t | fm_set_snr_threshold (fm_t *ctx, uint8_t snr_threshold) |
Setting seek SNR threshold value. | |
uint8_t | fm_set_seek_impulse_detection_threshold (fm_t *ctx, uint8_t impulse_detection_threshold) |
Setting seek impulse detection threshold value. | |
uint8_t | fm_get_errors_block_a (fm_t *ctx) |
Reading number of errors to be corrected. | |
uint8_t | fm_get_received_signal_strength_indicator (fm_t *ctx) |
Reading recived strength indicator. | |
uint8_t | fm_get_errors_block_b (fm_t *ctx) |
Reading number of errors to be corrected. | |
uint8_t | fm_get_errors_block_c (fm_t *ctx) |
Reading number of errors to be corrected. | |
uint8_t | fm_get_errors_block_d (fm_t *ctx) |
Reading number of errors to be corrected. | |
float | fm_get_channel_frequency (fm_t *ctx) |
Calculating current channel frequency. | |
void | fm_power_up (fm_t *ctx) |
Powering up device. | |
void | fm_basic_settings (fm_t *ctx) |
Setting basic settings. | |
void | fm_power_down (fm_t *ctx) |
Powering down device. | |
uint16_t | fm_get_channel (fm_t *ctx) |
Reading CHANNEL bits. | |
void | fm_tune_channel (fm_t *ctx, uint16_t channel) |
Setting CHANNEL bits. | |
uint8_t | fm_tune (fm_t *ctx, float channel_frequency) |
Tunning radio station. | |
void | fm_end_tune (fm_t *ctx) |
End tunning. | |
void | fm_seek (fm_t *ctx) |
Start seeking radio station. | |
void | fm_end_seek (fm_t *ctx) |
End seeking. | |
uint8_t | fm_volume_up (fm_t *ctx) |
Increasing volume level. | |
uint8_t | fm_volume_down (fm_t *ctx) |
Decreasing volume level. | |
void | fm_mute_enable (fm_t *ctx) |
Enable mute. | |
void | fm_mute_disable (fm_t *ctx) |
Disable mute. | |
uint8_t | fm_fine_tune_up (fm_t *ctx) |
Fine tunning. | |
uint8_t | fm_fine_tune_down (fm_t *ctx) |
Fine tunning. | |
uint8_t | fm_get_int_pin (fm_t *ctx) |
Checking INT pin status. | |
uint8_t | fm_get_an_pin (fm_t *ctx) |
Checking AN pin status. | |
void fm_basic_settings | ( | fm_t * | ctx | ) |
Setting basic settings.
ctx | Click object. |
@description This function sets basic settings to device This function sets optimal settings for device operation in Europe
void fm_cfg_setup | ( | fm_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void fm_default_cfg | ( | fm_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Fm click.
void fm_end_seek | ( | fm_t * | ctx | ) |
End seeking.
ctx | Click object. |
@description This function ends seek by setting SEEK bit LOW This function must be called after fm_seek(); function This function must be executed after seek done interrupt flag This function can be executed before seek done interrupt flag
void fm_end_tune | ( | fm_t * | ctx | ) |
End tunning.
ctx | Click object. |
@description This function ends tunning radio station by setting TUNE bit LOW This function must be executed after getting tune done interrupt flag This function can be executed before getting tune done interrupt flag
uint8_t fm_fine_tune_down | ( | fm_t * | ctx | ) |
Fine tunning.
ctx | Click object. |
uint8_t fm_fine_tune_up | ( | fm_t * | ctx | ) |
Fine tunning.
ctx | Click object. |
@description This fine tunes frequency in smallest possible increments for spacing setting
void fm_generic_read | ( | fm_t * | ctx, |
uint16_t * | reg_buf ) |
Reading all registers.
ctx | Click object. |
reg_buf | All registers to be read are stored into reg_buf[ 16 ]. |
@description This function reads all registers in device starting from address 0x0A This function sorts all device registers in such manner that reg_buf[] can be used with fm_generic_write(); without change
void fm_generic_write | ( | fm_t * | ctx, |
uint16_t * | reg_buf ) |
Generic write function.
ctx | Click object. |
reg_buf | All registers to be written are stored into reg_buf[ 16 ]. |
@description This function writes all registers from device starting from address 0x02 This function should be used after fm_generic_read(); and fm_set_bits(); functions
uint8_t fm_get_an_pin | ( | fm_t * | ctx | ) |
Checking AN pin status.
@description This function returns 0 if AN pin is LOW or 1 if AN pin is HIGH
uint16_t fm_get_channel | ( | fm_t * | ctx | ) |
Reading CHANNEL bits.
ctx | Click object. |
@description This function reads CHANNEL bits from READCHAN register
float fm_get_channel_frequency | ( | fm_t * | ctx | ) |
Calculating current channel frequency.
ctx | Click object. |
@description This function calculates current channel frequency based on band and space settings
uint8_t fm_get_errors_block_a | ( | fm_t * | ctx | ) |
Reading number of errors to be corrected.
ctx | Click object. |
@description This function returns BLERA error bits from status RSSI register This function returns 00h if 0 errors occured This function returns 01h if 1–2 errors occured This function returns 10h if 3–5 errors occured This function returns 11h if 6+ errors occured and correction is not possible.
uint8_t fm_get_errors_block_b | ( | fm_t * | ctx | ) |
Reading number of errors to be corrected.
ctx | Click object. |
@description This function returns BLERB error bits from read Channel register This function returns 00h if 0 errors occured This function returns 01h if 1–2 errors occured This function returns 10h if 3–5 errors occured This function returns 11h if 6+ errors occured and correction is not possible.
uint8_t fm_get_errors_block_c | ( | fm_t * | ctx | ) |
Reading number of errors to be corrected.
ctx | Click object. |
@description This function returns BLERC error bits from read Channel register This function returns 00h if 0 errors occured This function returns 01h if 1–2 errors occured This function returns 10h if 3–5 errors occured This function returns 11h if 6+ errors occured and correction is not possible.
uint8_t fm_get_errors_block_d | ( | fm_t * | ctx | ) |
Reading number of errors to be corrected.
ctx | Click object. |
@description This function returns BLERD error bits from read Channel register This function returns 00h if 0 errors occured This function returns 01h if 1–2 errors occured This function returns 10h if 3–5 errors occured This function returns 11h if 6+ errors occured and correction is not possible.
uint8_t fm_get_int_pin | ( | fm_t * | ctx | ) |
Checking INT pin status.
ctx | Click object. |
@description This function returns 0 if INT pin is LOW or 1 if INT pin is HIGH
uint8_t fm_get_received_signal_strength_indicator | ( | fm_t * | ctx | ) |
Reading recived strength indicator.
ctx | Click object. |
@description This function reads recived signal strength indicatior
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void fm_mute_disable | ( | fm_t * | ctx | ) |
Disable mute.
ctx | Click object. |
@description This function disables mute
void fm_mute_enable | ( | fm_t * | ctx | ) |
Enable mute.
ctx | Click object. |
@description This function enables mute
void fm_power_down | ( | fm_t * | ctx | ) |
Powering down device.
ctx | Click object. |
@description This function powers down device
void fm_power_up | ( | fm_t * | ctx | ) |
Powering up device.
ctx | Click object. |
@description This function powers up device This function first selects 2 wire mode for I2C This function than enables crystal oscylator and waits for it to settle This function than sets ENABLE bit HIGH and DISABLE bit LOW and waits for device to powerup
void fm_seek | ( | fm_t * | ctx | ) |
Start seeking radio station.
ctx | Click object. |
@description This function starts seeking radio stations according to basic seek setings This function seeks stations by seeking up and wraps to lower band limit upon reaching upper band limit if basic settings have not been changed
void fm_set_bits | ( | uint16_t * | register_buffer, |
uint16_t | register_address, | ||
uint16_t | bits_mask, | ||
uint16_t | bits_value ) |
Setting bits in specific register on a specific bit location.
ctx | Click object. |
register_buffer | All device registers are read into register_buffer[ 16 ]. |
register_address | Address of the register whose bits are to be set. |
bits_mask | Bits to be set must be masked first. |
bits_value | Value of the bits in selected range. |
@description This function is used to set bits in specific register on a specific position This function is used after fm_generic_read( uint16_t *register_buffer ) This function is used before fm_generic_write( uint16_t *register_buffer )
uint8_t fm_set_seek_impulse_detection_threshold | ( | fm_t * | ctx, |
uint8_t | impulse_detection_threshold ) |
Setting seek impulse detection threshold value.
ctx | Click object. |
@description This function sets impulse detection threshold value This function sets SKCNT bits in System configuration 3 register This function returns 0 if threshold value is in valid range This function returns 1 if threshold value is not in valid range
uint8_t fm_set_seek_threshold | ( | fm_t * | ctx, |
uint16_t | seek_threshold ) |
Setting seek threshold value.
ctx | Click object. |
seek_threshold | Value of seek threshold. |
@description This function sets seek threshold value This function returns 0 if threshold value is in valid range This function returns 1 if threshold value is not in valid range
uint8_t fm_set_snr_threshold | ( | fm_t * | ctx, |
uint8_t | snr_threshold ) |
Setting seek SNR threshold value.
ctx | Click object. |
@description This function sets seek SNR threshold value This function sets SKSNR bits in System configuration 3 register This function returns 0 if threshold value is in valid range This function returns 1 if threshold value is not in valid range
uint8_t fm_set_volume | ( | fm_t * | ctx, |
uint8_t | volume_level ) |
Setting volume value.
ctx | Click object. |
volume_level | Desired volume value |
@description This function sets volume value (0-16) This function sets VOLUME bits [3:0] in System configuration 2 register This function returns 0 if volume value is in range This function returns 1 if volume value is not in range
uint8_t fm_tune | ( | fm_t * | ctx, |
float | channel_frequency ) |
Tunning radio station.
ctx | Click object. |
channel_frequency | - frequency of the channel to be tuned |
@description This function sets channel for desired radio station and sets tune enable bit This function returns 0 if radio station frequency is in valid range This function returns 1 if radio station frequency is not in valid range
void fm_tune_channel | ( | fm_t * | ctx, |
uint16_t | channel ) |
Setting CHANNEL bits.
ctx | Click object. |
channel | - value stored in channel bits - bits [9:0] |
@description This function sets CHANNEL bits in CHANNEL register
uint8_t fm_volume_down | ( | fm_t * | ctx | ) |
Decreasing volume level.
ctx | Click object. |
@description This function decreases volume level This function returns 0 if volume level decreased This function returns 1 if volume level reached minimum value
uint8_t fm_volume_up | ( | fm_t * | ctx | ) |
Increasing volume level.
ctx | Click object. |
@description This function increases volume level This function returns 0 if volume level increased This function returns 1 if volume level reached maximum value