Power MUX 3 Click
Power MUX 3 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Click Library
- Author : Stefan Filipovic
- Date : Apr 2025.
- Type : GPIO type
Software Support
Example Description
This example demonstrates the use of the Power MUX 3 Click board. It enables automatic selection between three power sources, selecting the highest voltage as the input source. The demo toggles the output ON and OFF at regular intervals, allowing observation of the output control functionality.
Example Libraries
- MikroSDK.Board
- MikroSDK.Log
- Click.PowerMUX3
Example Key Functions
- powermux3_cfg_setup This function initializes Click configuration structure to initial values.
void powermux3_cfg_setup(powermux3_cfg_t *cfg)
Power MUX 3 configuration object setup function.
Power MUX 3 Click configuration object.
Definition powermux3.h:95
- powermux3_init This function initializes all necessary pins and peripherals used for this Click board.
err_t powermux3_init(powermux3_t *ctx, powermux3_cfg_t *cfg)
Power MUX 3 initialization function.
Power MUX 3 Click context object.
Definition powermux3.h:84
- powermux3_enable_device This function enables the device by setting the SHD pin to HIGH on the Power MUX 3 Click board.
void powermux3_enable_device(powermux3_t *ctx)
Power MUX 3 enable device function.
- powermux3_disable_device This function disables the device by setting the SHD pin to LOW on the Power MUX 3 Click board.
void powermux3_disable_device(powermux3_t *ctx)
Power MUX 3 disable device function.
- powermux3_enable_output This function enables the output by setting the EN pin to HIGH on the Power MUX 3 Click board.
void powermux3_enable_output(powermux3_t *ctx)
Power MUX 3 enable output function.
- powermux3_disable_output This function disables the output by setting the EN pin to LOW on the Power MUX 3 Click board.
void powermux3_disable_output(powermux3_t *ctx)
Power MUX 3 disable output function.
Application Init
Initializes the logger and the Power MUX 3 Click driver, then enables the device.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( DIGITAL_OUT_UNSUPPORTED_PIN ==
powermux3_init( &powermux3, &powermux3_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define POWERMUX3_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition powermux3.h:72
void application_init(void)
Definition main.c:30
Application Task
Alternates enabling and disabling the output in 5-second intervals while logging the status.
{
log_printf( &logger, " Output enabled\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " Output disabled\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
void application_task(void)
Definition main.c:62
Application Output
This Click board can be interfaced and monitored in two ways:
- Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
- UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Additional Notes and Information
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.