smartbuck 2.0.0.0
main.c File Reference

SMARTBUCK Click example. More...

#include "board.h"
#include "log.h"
#include "smartbuck.h"

Functions

void channel_log ()
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

float voltage_res [4]
 
float current_res [4]
 
float power_res [4]
 
uint8_t check_byte
 
uint8_t cnt
 
uint8_t idx
 
char text [50]
 

Detailed Description

SMARTBUCK Click example.

Description

This application reads voltage, current, and power from all available channels.

The demo application is composed of two sections :

Application Init

Initializes I2C interface and logger and peforms the click default configuration.

Application Task

Sends command for updating data registers with new converted data, then waits 500ms and after that reads new data from data registers. In this way we can get voltage, current and power data from activated channels. Results are being logged on USB UART.

Author
MikroE Team

Function Documentation

◆ application_init()

void application_init ( void )

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 LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ channel_log()

void channel_log ( )

◆ main()

int main ( void )

Variable Documentation

◆ check_byte

uint8_t check_byte

◆ cnt

uint8_t cnt

◆ current_res

float current_res[4]

◆ idx

uint8_t idx

◆ power_res

float power_res[4]

◆ text

char text[50]

◆ voltage_res

float voltage_res[4]