amfm 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ amfm_an_get()

uint8_t amfm_an_get ( amfm_t * ctx)

Function for checking AN pin state.

Parameters
ctxClick object.

@description This function returns AN pin state.

◆ amfm_cfg_setup()

void amfm_cfg_setup ( amfm_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ amfm_cs_set()

void amfm_cs_set ( amfm_t * ctx,
uint8_t pin_state )

Function for setting CS pin state.

Parameters
ctxClick object.
pin_statePin state ( 0 or 1 ).

@description This function sets CS pin state.

◆ amfm_default_cfg()

void amfm_default_cfg ( amfm_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for AmFm click.

◆ amfm_generic_read()

void amfm_generic_read ( amfm_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf.
lenNumber of the bytes to be read.

@description This function reads data from the desired register.

◆ amfm_generic_write()

void amfm_generic_write ( amfm_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ amfm_get_channel()

uint16_t amfm_get_channel ( amfm_t * ctx)

Function for getting current channel value.

Parameters
ctxClick object.

@description This function returns current channel value in KHz.

◆ amfm_get_cts()

uint8_t amfm_get_cts ( amfm_t * ctx)

Function for checking CTS bit.

Parameters
ctxClick object.

@description This function checks CTS bit state.

◆ amfm_get_rds()

uint8_t amfm_get_rds ( amfm_t * ctx)

Function for checking RDS bit.

Parameters
ctxClick object.

@description This function checks RDS bit state.

◆ amfm_get_response()

uint8_t amfm_get_response ( amfm_t * ctx,
uint8_t * resp_buf,
uint8_t n_bytes )

Function for getting device response.

Parameters
ctxClick object.
resp_bufBuffer to wich the response bytes will be stored.
n_bytesNumber of response bytes.

@description This function returns a device response into a resp_buf.

◆ amfm_get_rsq()

uint8_t amfm_get_rsq ( amfm_t * ctx)

Function for checking RSQ bit.

Parameters
ctxClick object.

@description This function checks RSQ bit state.

◆ amfm_get_stc()

uint8_t amfm_get_stc ( amfm_t * ctx)

Function for checking STC bit.

Parameters
ctxClick object.

@description This function checks STC bit state.

◆ amfm_init()

err_t amfm_init ( amfm_t * ctx,
amfm_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ amfm_init_device()

uint8_t amfm_init_device ( amfm_t * ctx)

Device initialization.

Parameters
ctxClick object.

@description This function returns 0 for succesful initialization of a device and returns 1 for unsucessful initialization of a device.

◆ amfm_int_get()

uint8_t amfm_int_get ( amfm_t * ctx)

Function for checking INT pin state.

Parameters
ctxClick object.

@description This function returns INT pin state.

◆ amfm_mute()

uint8_t amfm_mute ( amfm_t * ctx)

Function for muting device.

Parameters
ctxClick object.

@description This function returns 0 for succesful mute and returns 1 for unsuccesful mute.

◆ amfm_rst_set()

void amfm_rst_set ( amfm_t * ctx,
uint8_t pin_state )

Function for setting RST pin state.

Parameters
ctxClick object.
pin_statePin state ( 0 or 1 ).

@description This function sets RST pin state.

◆ amfm_seek()

uint8_t amfm_seek ( amfm_t * ctx)

Function for seeking next station.

Parameters
ctxClick object.

@description This function returns 0 for succesful seek and returns 1 for unsucessful seek.

◆ amfm_send_command()

uint8_t amfm_send_command ( amfm_t * ctx,
uint8_t * cmd_and_args_buf )

Function for sending command and command arguments to device.

Parameters
ctxClick object.
cmd_and_args_bufPointer to buffer that contains command and command arguments to send.

@description This function sends command and command arguments to device.

◆ amfm_set_volume()

uint8_t amfm_set_volume ( amfm_t * ctx,
uint8_t volume )

Function for setting volume level.

Parameters
ctxClick object.
volumevolume level ( range: 0 - 63 ).

@description This function sets volume level in range: 0 - 63.

◆ amfm_tune_down()

uint8_t amfm_tune_down ( amfm_t * ctx)

Function for tune down current frequency.

Parameters
ctxClick object.

@description This function decrements current frequency for 10 KHz.

◆ amfm_tune_frequency()

uint8_t amfm_tune_frequency ( amfm_t * ctx,
uint16_t frequency )

Function for tuning frequency.

Parameters
ctxClick object.
frequencyFrequency value to be tuned ( frequency value in KHz ).

@description This function tunes desired frequency value.

◆ amfm_tune_up()

uint8_t amfm_tune_up ( amfm_t * ctx)

Function for tune up current frequency.

Parameters
ctxClick object.

@description This function increments current frequency for 10 KHz.

◆ amfm_unmute()

uint8_t amfm_unmute ( amfm_t * ctx)

Function for unmuting device.

Parameters
ctxClick object.

@description This function returns 0 for succesful unmute and returns 1 for unsuccesful unmute.