amfm 2.0.0.0
|
Functions | |
void | amfm_cfg_setup (amfm_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | amfm_init (amfm_t *ctx, amfm_cfg_t *cfg) |
Initialization function. | |
void | amfm_default_cfg (amfm_t *ctx) |
Click Default Configuration function. | |
void | amfm_generic_write (amfm_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | amfm_generic_read (amfm_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | amfm_an_get (amfm_t *ctx) |
Function for checking AN pin state. | |
uint8_t | amfm_int_get (amfm_t *ctx) |
Function for checking INT pin state. | |
void | amfm_rst_set (amfm_t *ctx, uint8_t pin_state) |
Function for setting RST pin state. | |
void | amfm_cs_set (amfm_t *ctx, uint8_t pin_state) |
Function for setting CS pin state. | |
uint8_t | amfm_send_command (amfm_t *ctx, uint8_t *cmd_and_args_buf) |
Function for sending command and command arguments to device. | |
uint8_t | amfm_get_cts (amfm_t *ctx) |
Function for checking CTS bit. | |
uint8_t | amfm_get_stc (amfm_t *ctx) |
Function for checking STC bit. | |
uint8_t | amfm_get_rsq (amfm_t *ctx) |
Function for checking RSQ bit. | |
uint8_t | amfm_get_rds (amfm_t *ctx) |
Function for checking RDS bit. | |
uint8_t | amfm_get_response (amfm_t *ctx, uint8_t *resp_buf, uint8_t n_bytes) |
Function for getting device response. | |
uint8_t | amfm_init_device (amfm_t *ctx) |
Device initialization. | |
uint8_t | amfm_seek (amfm_t *ctx) |
Function for seeking next station. | |
uint8_t | amfm_set_volume (amfm_t *ctx, uint8_t volume) |
Function for setting volume level. | |
uint8_t | amfm_mute (amfm_t *ctx) |
Function for muting device. | |
uint8_t | amfm_unmute (amfm_t *ctx) |
Function for unmuting device. | |
uint8_t | amfm_tune_up (amfm_t *ctx) |
Function for tune up current frequency. | |
uint8_t | amfm_tune_down (amfm_t *ctx) |
Function for tune down current frequency. | |
uint8_t | amfm_tune_frequency (amfm_t *ctx, uint16_t frequency) |
Function for tuning frequency. | |
uint16_t | amfm_get_channel (amfm_t *ctx) |
Function for getting current channel value. | |
uint8_t amfm_an_get | ( | amfm_t * | ctx | ) |
Function for checking AN pin state.
ctx | Click object. |
@description This function returns AN pin state.
void amfm_cfg_setup | ( | amfm_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void amfm_cs_set | ( | amfm_t * | ctx, |
uint8_t | pin_state ) |
Function for setting CS pin state.
ctx | Click object. |
pin_state | Pin state ( 0 or 1 ). |
@description This function sets CS pin state.
void amfm_default_cfg | ( | amfm_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for AmFm click.
void amfm_generic_read | ( | amfm_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf. |
len | Number of the bytes to be read. |
@description This function reads data from the desired register.
void amfm_generic_write | ( | amfm_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint16_t amfm_get_channel | ( | amfm_t * | ctx | ) |
Function for getting current channel value.
ctx | Click object. |
@description This function returns current channel value in KHz.
uint8_t amfm_get_cts | ( | amfm_t * | ctx | ) |
Function for checking CTS bit.
ctx | Click object. |
@description This function checks CTS bit state.
uint8_t amfm_get_rds | ( | amfm_t * | ctx | ) |
Function for checking RDS bit.
ctx | Click object. |
@description This function checks RDS bit state.
uint8_t amfm_get_response | ( | amfm_t * | ctx, |
uint8_t * | resp_buf, | ||
uint8_t | n_bytes ) |
Function for getting device response.
ctx | Click object. |
resp_buf | Buffer to wich the response bytes will be stored. |
n_bytes | Number of response bytes. |
@description This function returns a device response into a resp_buf.
uint8_t amfm_get_rsq | ( | amfm_t * | ctx | ) |
Function for checking RSQ bit.
ctx | Click object. |
@description This function checks RSQ bit state.
uint8_t amfm_get_stc | ( | amfm_t * | ctx | ) |
Function for checking STC bit.
ctx | Click object. |
@description This function checks STC bit state.
err_t amfm_init | ( | amfm_t * | ctx, |
amfm_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t amfm_init_device | ( | amfm_t * | ctx | ) |
Device initialization.
ctx | Click object. |
@description This function returns 0 for succesful initialization of a device and returns 1 for unsucessful initialization of a device.
uint8_t amfm_int_get | ( | amfm_t * | ctx | ) |
Function for checking INT pin state.
ctx | Click object. |
@description This function returns INT pin state.
uint8_t amfm_mute | ( | amfm_t * | ctx | ) |
Function for muting device.
ctx | Click object. |
@description This function returns 0 for succesful mute and returns 1 for unsuccesful mute.
void amfm_rst_set | ( | amfm_t * | ctx, |
uint8_t | pin_state ) |
Function for setting RST pin state.
ctx | Click object. |
pin_state | Pin state ( 0 or 1 ). |
@description This function sets RST pin state.
uint8_t amfm_seek | ( | amfm_t * | ctx | ) |
Function for seeking next station.
ctx | Click object. |
@description This function returns 0 for succesful seek and returns 1 for unsucessful seek.
uint8_t amfm_send_command | ( | amfm_t * | ctx, |
uint8_t * | cmd_and_args_buf ) |
Function for sending command and command arguments to device.
ctx | Click object. |
cmd_and_args_buf | Pointer to buffer that contains command and command arguments to send. |
@description This function sends command and command arguments to device.
uint8_t amfm_set_volume | ( | amfm_t * | ctx, |
uint8_t | volume ) |
Function for setting volume level.
ctx | Click object. |
volume | volume level ( range: 0 - 63 ). |
@description This function sets volume level in range: 0 - 63.
uint8_t amfm_tune_down | ( | amfm_t * | ctx | ) |
Function for tune down current frequency.
ctx | Click object. |
@description This function decrements current frequency for 10 KHz.
uint8_t amfm_tune_frequency | ( | amfm_t * | ctx, |
uint16_t | frequency ) |
Function for tuning frequency.
ctx | Click object. |
frequency | Frequency value to be tuned ( frequency value in KHz ). |
@description This function tunes desired frequency value.
uint8_t amfm_tune_up | ( | amfm_t * | ctx | ) |
Function for tune up current frequency.
ctx | Click object. |
@description This function increments current frequency for 10 KHz.
uint8_t amfm_unmute | ( | amfm_t * | ctx | ) |
Function for unmuting device.
ctx | Click object. |
@description This function returns 0 for succesful unmute and returns 1 for unsuccesful unmute.