TOP Contributors

  1. MIKROE (2654 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136742 times)
  2. FAT32 Library (69952 times)
  3. Network Ethernet Library (55942 times)
  4. USB Device Library (46267 times)
  5. Network WiFi Library (41887 times)
  6. FT800 Library (41173 times)
  7. GSM click (28983 times)
  8. PID Library (26413 times)
  9. mikroSDK (26361 times)
  10. microSD click (25376 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

RF Switch click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.9

mikroSDK Library: 2.0.0.0

Category: Port expander

Downloaded: 80 times

Not followed.

License: MIT license  

RF Switch Click is a Click board™ equipped with the MASWSS0115, a GaAs PHEMT MMIC single-pole, double-throw (SPDT) switch developed by Macom for switching between small signal components such as filter banks, single-band LNAs, converters, etc. The MASWSS0115 is ideally suited for applications where a very small size and low cost are required.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "RF Switch click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "RF Switch click" changes.

Do you want to report abuse regarding "RF Switch click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


RF Switch click

RF Switch Click is a Click board™ equipped with the MASWSS0115, a GaAs PHEMT MMIC single-pole, double-throw (SPDT) switch developed by Macom for switching between small signal components such as filter banks, single-band LNAs, converters, etc. The MASWSS0115 is ideally suited for applications where a very small size and low cost are required.

rfswitch_click.png

click Product page


Click library

  • Author : Stefan Ilic
  • Date : Sep 2021.
  • Type : GPIO type

Software Support

We provide a library for the RFSwitch Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for RFSwitch Click driver.

Standard key functions :

  • rfswitch_cfg_setup Config Object Initialization function.

    void rfswitch_cfg_setup ( rfswitch_cfg_t *cfg );
  • rfswitch_init Initialization function.

    err_t rfswitch_init ( rfswitch_t *ctx, rfswitch_cfg_t *cfg );

Example key functions :

  • rfswitch_power_on RF Switch power on function.

    void rfswitch_power_on ( rfswitch_t *ctx );
  • rfswitch_switch_channel RF Switch switch channel function.

    void rfswitch_switch_channel ( rfswitch_t *ctx );
  • rfswitch_select_channel RF Switch select channel function.

    void rfswitch_select_channel ( rfswitch_t *ctx, uint8_t select_channel );

Example Description

This is an example that demonstrates the use of the RF Switch Click board.

The demo application is composed of two sections :

Application Init

Initialization driver enable's - GPIO, also write log and powers on device.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    rfswitch_cfg_t rfswitch_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    rfswitch_cfg_setup( &rfswitch_cfg );
    RFSWITCH_MAP_MIKROBUS( rfswitch_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == rfswitch_init( &rfswitch, &rfswitch_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    log_printf( &logger, "------------------------\r\n" );
    log_printf( &logger, "   Powering device on   \r\n" );
    rfswitch_power_on( &rfswitch );
    Delay_ms ( 100 );
    log_printf( &logger, "------------------------\r\n" );
    log_printf( &logger, "   Select option to     \r\n" );
    log_printf( &logger, "    select channel      \r\n" );
    log_printf( &logger, "------------------------\r\n" );
    log_printf( &logger, " 1. Channel 1 selected  \r\n" );
    log_printf( &logger, " 2. Channel 2 selected  \r\n" );
    log_printf( &logger, " 3. Switching channel   \r\n" );
    log_printf( &logger, "------------------------\r\n" );
}

Application Task

Waiting for valid user input and executes functions based on set of valid commands. Results are being sent to the Usart Terminal where you can track their changes.


void application_task ( void ) 
{
    uint8_t tx_buf;
    if ( log_read( &logger, &tx_buf, 1 ) ) {
        switch ( tx_buf ) {
            case '1' : {
                rfswitch_select_channel( &rfswitch, RFSWITCH_SELECT_CHANNEL_1 );
                log_printf( &logger, " Switching to RF port 1 \r\n" );
                log_printf( &logger, "------------------------\r\n" );
                break;
            }
            case '2' : {
                rfswitch_select_channel( &rfswitch, RFSWITCH_SELECT_CHANNEL_2 );
                log_printf( &logger, " Switching to RF port 2 \r\n" );
                log_printf( &logger, "------------------------\r\n" );
                break;
            }
            case '3' : {
                rfswitch_switch_channel( &rfswitch );
                log_printf( &logger, "   Switching RF port    \r\n" );
                log_printf( &logger, "------------------------\r\n" );
                break;
            }
            default : {
                log_printf( &logger, "   Select option to     \r\n" );
                log_printf( &logger, "    select channel      \r\n" );
                log_printf( &logger, "------------------------\r\n" );
                log_printf( &logger, " 1. Channel 1 selected  \r\n" );
                log_printf( &logger, " 2. Channel 2 selected  \r\n" );
                log_printf( &logger, " 3. Switching channel   \r\n" );
                log_printf( &logger, "------------------------\r\n" );
            }
        }
    }
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.RFSwitch

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

Joystick 3 click

0

Joystick 3 Click is a compact add-on board that can fulfill your directional analog input needs. This board features 2765, a high-quality mini 2-axis analog output thumbstick from Adafruit Industries. This small joystick is a 'self-centering' analog-type with a black rocker cap similar to the PSP joysticks. It comprises two 10kΩ potentiometers, one for up/down and another for left/right direction. Knowing that this joystick represents an analog type, it connects with mikroBUS™ through the SPI interface through the MCP3204 12-bit A/D converter.

[Learn More]

3D Hall 10 click

0

3D Hall 10 Click is a compact add-on board used to detect the strength of a magnetic field in all three dimensions. This board features the TMAG5170, a high-precision linear 3D Hall effect sensor from Texas Instruments. The TMAG5170 features an SPI interface for configuration by MCU. The measurement data is provided in digital format of 12-bits corresponding to the magnetic field measured in each X, Y, and Z axes. It can achieve ultra-high precision at speeds up to 20kSPS for faster and more accurate real-time control and offers multiple diagnostics features to detect and report both system and device-level failures.

[Learn More]

2x30W Amp click

0

2x30W Amp click is a class-D audio amplifier with a tremendous output power, considering its size and lack of huge heatsinks, usually associated with the audio amplifiers.

[Learn More]