powermux3 2.2.0
Loading...
Searching...
No Matches
powermux3


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

Application Init

Initializes the logger and the Power MUX 3 Click driver, then enables the device.

void application_init ( void )
{
log_cfg_t log_cfg;
powermux3_cfg_t powermux3_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
powermux3_cfg_setup( &powermux3_cfg );
POWERMUX3_MAP_MIKROBUS( powermux3_cfg, MIKROBUS_1 );
if ( DIGITAL_OUT_UNSUPPORTED_PIN == powermux3_init( &powermux3, &powermux3_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
powermux3_enable_device ( &powermux3 );
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.

void application_task ( void )
{
log_printf( &logger, " Output enabled\r\n\n" );
powermux3_enable_output ( &powermux3 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " Output disabled\r\n\n" );
powermux3_disable_output ( &powermux3 );
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.