Hospital Analyser  1.0
MCP3425.h
Go to the documentation of this file.
1 #ifndef __MCP3425_H
2 #define __MCP3425_H
3 
4 #include "stm32l4xx_hal.h"
5 
12 typedef enum
13 {
27 typedef enum
28 {
41 typedef enum
42 {
54 typedef enum
55 {
68 typedef struct
69 {
86 
93 MCP3425_StatusTypeDef MCP3425_GetRawValue(I2C_HandleTypeDef *hi2c, int16_t *value);
94 
95 
102 MCP3425_StatusTypeDef MCP3425_GetVoltageFromRawValue(uint16_t rawValue, float *voltage);
103 
110 MCP3425_StatusTypeDef MCP3425_GetVoltageValue(I2C_HandleTypeDef *hi2c, float *voltage);
111 
112 #define MCP3425_I2C_ADDRESS (0b11010000)
113 #define MCP3425_I2C_TIMEOUT (3200U)
115 #endif /* __MCP3425_H */
116 
MCP3425_StatusTypeDef MCP3425_GetVoltageValue(I2C_HandleTypeDef *hi2c, float *voltage)
MCP3425_GetVoltageValue Gets voltage value directly from ADC (overloaded function) ...
MCP3425_GainTypeDef
Definition: MCP3425.h:12
MCP3425_StatusTypeDef MCP3425_GetVoltageFromRawValue(uint16_t rawValue, float *voltage)
MCP3425_GetVoltageFromRawValue Converts raw value to voltage according to current configuration...
Definition: MCP3425.h:58
MCP3425_ResolutionTypeDef
Definition: MCP3425.h:27
Definition: MCP3425.h:31
MCP3425_StatusTypeDef MCP3425_GetRawValue(I2C_HandleTypeDef *hi2c, int16_t *value)
MCP3425_GetRawValue Reads raw value from ADC.
Definition: MCP3425.h:57
Definition: MCP3425.h:16
Definition: MCP3425.h:14
Definition: MCP3425.h:30
ADC configuration structure definition.
Definition: MCP3425.h:68
Definition: MCP3425.h:17
Definition: MCP3425.h:43
Definition: MCP3425.h:15
MCP3425_StatusTypeDef MCP3425_SetConfiguration(I2C_HandleTypeDef *hi2c, MCP3425_GainTypeDef gain, MCP3425_ResolutionTypeDef resolution)
MCP3425_SetConfiguration Sets up ADC according to configuration.
Definition: MCP3425.h:29
MCP3425_GainTypeDef gain
Definition: MCP3425.h:70
Definition: MCP3425.h:56
MCP3425_Conversion_ModeTypeDef mode
Definition: MCP3425.h:72
MCP3425_StatusTypeDef
Definition: MCP3425.h:54
Definition: MCP3425.h:44
MCP3425_Conversion_ModeTypeDef
Definition: MCP3425.h:41
MCP3425_ResolutionTypeDef res
Definition: MCP3425.h:71