We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-10-21
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: FM
Downloaded: 3962 times
Not followed.
License: MIT license
AM/FM Click is a RADIO RECEIVER click board that can be used to listen to music from the AM and FM radio bands.
Do you want to subscribe in order to receive notifications regarding "AM/FM click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "AM/FM click" changes.
Do you want to report abuse regarding "AM/FM click".
Library Description
Library contains function for sending commands and command arguments to device Library contains function for checking states of INT, AND, RST and CS pins Library contains function for receiving status byte of a device Library contains functions for checking states of specific interrupt bits in status byte Library contains function for receiving response bytes from a device Library contains function for device initialization Library contains function for seeking channels Library contains function for setting volume Library contains function for muting/unmuting device Library contains function for tuning frequency up/down Library contains function for getting current channel value Library contains constants for commands, arguments and properties.
Key functions:
uint8_t amfm_sendCommand( uint8_t * cmdAndArgsBuf_ )
- sends command and command arguments to deviceuint8_t amfm_getCts( void )
- checks CTS bit state and returns 0/1 if CTS bit did/did not go HIGH in less than 500 cyclesuint8_t amfm_getResponse( uint8_t * respBuf_, uint8_t nBytes_ )
- returns a device response into a respBuf_ after receiving CTSExamples description
The application is composed of three sections :
void applicationTask( )
{
dataReady = UART_Rdy_Ptr( );
if (dataReady != 0)
{
receivedData = UART_Rd_Ptr( );
switch (receivedData)
{
case 's' :
{
amfm_caseSeek( );
break;
}
case '+' :
{
amfm_casePlus( );
break;
}
case '-' :
{
amfm_caseMinus( );
break;
}
case 'm' :
{
amfm_caseMemorize( );
break;
}
case 'i' :
{
amfm_caseMute( );
break;
}
case 'u' :
{
amfm_caseTuneUp( );
break;
}
case 'd' :
{
amfm_caseTuneDown( );
break;
}
case '1' :
{
amfm_caseStation1( );
break;
}
case '2' :
{
amfm_caseStation2( );
break;
}
case '3' :
{
amfm_caseStation3( );
break;
}
case '4' :
{
amfm_caseStation4( );
break;
}
case '5' :
{
amfm_caseStation5( );
break;
}
default :
{
mikrobus_logWrite( "> > > > > !!! WRONG COMMAND !!! < < < < <", _LOG_LINE );
break;
}
}
}
}
Additional Functions :
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.