INA234 HAL Based Library 1.0.1
This library is a software library that works with the INA234 current, voltage, and power monitor chip. This library provides a convenient and efficient way to access the I2C interfaces of the chip, allowing developers to easily integrate this power meter into their systems.
Loading...
Searching...
No Matches
main.c File Reference

: Main program body More...

#include "main.h"
#include "i2c.h"
#include "usb_device.h"
#include "gpio.h"
#include "ina234.h"
#include "stdarg.h"
#include "string.h"
#include "stdlib.h"
#include "usbd_cdc_if.h"

Macros

#define SAMPLES_PER_BATCH   500
 
#define TIME_CALC   0
 
#define DEBUG_ENABLE   1
 
#define USB_DEBUG   1
 
#define DEBUG_UART   (&huart1)
 

Functions

void SystemClock_Config (void)
 System Clock Configuration.
 
void DEBUG (const char *_str,...)
 
int main (void)
 The application entry point.
 
void Error_Handler (void)
 This function is executed in case of error occurrence.
 

Variables

INA234 ina234
 
uint8_t raw [2]
 
uint8_t TxBuffer [SAMPLES_PER_BATCH *2]
 

Detailed Description

: Main program body

Attention

Copyright (c) 2024 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Macro Definition Documentation

◆ DEBUG_ENABLE

#define DEBUG_ENABLE   1

◆ DEBUG_UART

#define DEBUG_UART   (&huart1)

◆ SAMPLES_PER_BATCH

#define SAMPLES_PER_BATCH   500

◆ TIME_CALC

#define TIME_CALC   0

◆ USB_DEBUG

#define USB_DEBUG   1

Function Documentation

◆ DEBUG()

void DEBUG ( const char * _str,
... )

◆ Error_Handler()

void Error_Handler ( void )

This function is executed in case of error occurrence.

Return values
None

◆ main()

int main ( void )

The application entry point.

Return values
int

◆ SystemClock_Config()

void SystemClock_Config ( void )

System Clock Configuration.

Return values
None

Configure the main internal regulator output voltage

Initializes the RCC Oscillators according to the specified parameters in the RCC_OscInitTypeDef structure.

Initializes the CPU, AHB and APB buses clocks

Variable Documentation

◆ ina234

INA234 ina234

◆ raw

uint8_t raw[2]

◆ TxBuffer

uint8_t TxBuffer[SAMPLES_PER_BATCH *2]