|
Hospital Analyser
1.0
|
#include "stm32l4xx_hal.h"

Go to the source code of this file.
Classes | |
| struct | MCP3425_ConfigTypeDef |
| ADC configuration structure definition. More... | |
Macros | |
| #define | MCP3425_I2C_ADDRESS (0b11010000) |
| #define | MCP3425_I2C_TIMEOUT (3200U) |
Enumerations | |
| enum | MCP3425_GainTypeDef { MCP3425_Gain8 = 8, MCP3425_Gain4 = 4, MCP3425_Gain2 = 2, MCP3425_Gain1 = 1 } |
| enum | MCP3425_ResolutionTypeDef { MCP3425_Resolution16 = 0, MCP3425_Resolution14 = 1, MCP3425_Resolution12 = 2 } |
| enum | MCP3425_Conversion_ModeTypeDef { MCP3425_Continuous = 0, MCP3425_OneShot = 1 } |
| enum | MCP3425_StatusTypeDef { MCP3425_Status_OK = 0, MCP3425_Status_ERROR = 1, MCP3425_Status_NO_CONFIG = 2 } |
Functions | |
| MCP3425_StatusTypeDef | MCP3425_SetConfiguration (I2C_HandleTypeDef *hi2c, MCP3425_GainTypeDef gain, MCP3425_ResolutionTypeDef resolution) |
| MCP3425_SetConfiguration Sets up ADC according to configuration. More... | |
| MCP3425_StatusTypeDef | MCP3425_GetRawValue (I2C_HandleTypeDef *hi2c, int16_t *value) |
| MCP3425_GetRawValue Reads raw value from ADC. More... | |
| MCP3425_StatusTypeDef | MCP3425_GetVoltageFromRawValue (uint16_t rawValue, float *voltage) |
| MCP3425_GetVoltageFromRawValue Converts raw value to voltage according to current configuration. More... | |
| MCP3425_StatusTypeDef | MCP3425_GetVoltageValue (I2C_HandleTypeDef *hi2c, float *voltage) |
| MCP3425_GetVoltageValue Gets voltage value directly from ADC (overloaded function) More... | |
| #define MCP3425_I2C_ADDRESS (0b11010000) |
I2C device address
| #define MCP3425_I2C_TIMEOUT (3200U) |
I2C Comunication timeout
| MCP3425_StatusTypeDef MCP3425_GetRawValue | ( | I2C_HandleTypeDef * | hi2c, |
| int16_t * | value | ||
| ) |
MCP3425_GetRawValue Reads raw value from ADC.
| hi2c | Pointer to I2C handle |
| value | Pointer where raw value will be saved |
| MCP3425_StatusTypeDef MCP3425_GetVoltageFromRawValue | ( | uint16_t | rawValue, |
| float * | voltage | ||
| ) |
MCP3425_GetVoltageFromRawValue Converts raw value to voltage according to current configuration.
| rawValue | Current raw value from ADC |
| voltage | Pointer where converted value will be stored |
| MCP3425_StatusTypeDef MCP3425_GetVoltageValue | ( | I2C_HandleTypeDef * | hi2c, |
| float * | voltage | ||
| ) |
MCP3425_GetVoltageValue Gets voltage value directly from ADC (overloaded function)
| hi2c | Pointer to I2C handle |
| voltage | Pointer where voltage value will be stored |
| MCP3425_StatusTypeDef MCP3425_SetConfiguration | ( | I2C_HandleTypeDef * | hi2c, |
| MCP3425_GainTypeDef | gain, | ||
| MCP3425_ResolutionTypeDef | resolution | ||
| ) |
MCP3425_SetConfiguration Sets up ADC according to configuration.
| hi2c | Pointer to I2C handle |
| gain | Gain to set up |
| resolution | Resolution to set up |
1.8.11