current 2.0.0.0
main.c File Reference

Current Click example. More...

#include "board.h"
#include "log.h"
#include "current.h"

Functions

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

Detailed Description

Current Click example.

Description

This is an example that shows the capabilities of the Current click board by measuring current in miliampers. Current click board can be used to safely measure DC current in the range of 2-2048mA depending on shunt resistor.

The demo application is composed of two sections :

Application Init

Initalizes SPI, LOG and click drivers.

Application Task

Measures DC current and displays the results on USB UART each second.

Note
Shunt resistor used in the example covers 4 default values (0.05 Ohm, 0.2 Ohm, 1 Ohm, 10 Ohm). To operate in linear range of INA196 check table bellow for shunt selection. |---------------------------------—| | Rshunt | Imin [mA] | Imax [mA] | |---------------------------------—| | 0.05 | 400 | 2048 | | 0.2 | 100 | 512 | | 1 | 20 | 102 |

| 10 | 2 | 10 |

Author
Jovan Stajkovic

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 )

◆ main()

int main ( void )