I2C_Drivers (ARM) 1.1
SMFSW collection of HAL I2C Drivers for ARM
Loading...
Searching...
No Matches
MCP9808_proc.h File Reference

MCP9808 Driver procedures. More...

#include "sarmfsw.h"
#include "MCP9808.h"
Include dependency graph for MCP9808_proc.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  MCP9808_t
 MCP9808 user interface struct. More...
 

Macros

#define MCP9808_MANUFACTURER_ID   0x0054U
 MCP9808 Manufacturer ID to check against.
 
#define MCP9808_CHIP_ID   0x0400U
 MCP9808 Chip ID to check against.
 

Enumerations

enum  MCP9808_alert { MCP9808__ALERT_HIGH = 0U , MCP9808__ALERT_LOW , MCP9808__ALERT_CRIT }
 Alerts enum of MCP9808. More...
 

Functions

FctERR MCP9808_Init_Sequence (MCP9808_t *const pCpnt)
 Initialization Sequence of the MCP9808 peripheral.
 
FctERR MCP9808_Set_AlertTemp (MCP9808_t *const pCpnt, const float temp, const MCP9808_alert alt)
 Set the high/low/crit Alert temperature.
 
FctERR MCP9808_Get_AlertTemp (MCP9808_t *const pCpnt, float *temp, MCP9808_alert alt)
 Get the high/low/crit Alert temperature.
 
FctERR MCP9808_Get_Temperature (MCP9808_t *const pCpnt, float *temp)
 Get the temperature.
 
FctERR MCP9808_handler (MCP9808_t *const pCpnt)
 Handler for MCP9808 peripheral.
 
FctERR MCP9808_handler_it (MCP9808_t *const pCpnt)
 Handler for MCP9808 peripheral GPIO interrupt.
 
FctERR MCP9808_handler_all (void)
 Handler for all MCP9808 peripherals.
 
FctERR MCP9808_handler_it_all (void)
 Handler for all MCP9808 peripherals GPIO interrupt.
 

Variables

MCP9808_t MCP9808 [I2C_MCP9808_NB]
 MCP9808 User structure.
 

Detailed Description

MCP9808 Driver procedures.

Author
SMFSW

MCP9808: +/-0.5C Maximum Accuracy Digital Temperature Sensor

Macro Definition Documentation

◆ MCP9808_CHIP_ID

#define MCP9808_CHIP_ID   0x0400U

MCP9808 Chip ID to check against.

◆ MCP9808_MANUFACTURER_ID

#define MCP9808_MANUFACTURER_ID   0x0054U

MCP9808 Manufacturer ID to check against.

Enumeration Type Documentation

◆ MCP9808_alert

Alerts enum of MCP9808.

Enumerator
MCP9808__ALERT_HIGH 

High temperature alert.

MCP9808__ALERT_LOW 

Low temperature alert.

MCP9808__ALERT_CRIT 

Critical temperature alert.

Function Documentation

◆ MCP9808_Get_AlertTemp()

FctERR MCP9808_Get_AlertTemp ( MCP9808_t *const pCpnt,
float * temp,
MCP9808_alert alt )

Get the high/low/crit Alert temperature.

Parameters
[in]pCpnt- Pointer to MCP9808 component
[in,out]temp- pointer to temperature to read to (in Celsius degrees)
[in]alt- Alert type
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MCP9808_Get_Temperature()

FctERR MCP9808_Get_Temperature ( MCP9808_t *const pCpnt,
float * temp )

Get the temperature.

Parameters
[in]pCpnt- Pointer to MCP9808 component
[in,out]temp- pointer to temperature to read to (in Celsius degrees)
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MCP9808_handler()

FctERR MCP9808_handler ( MCP9808_t *const pCpnt)

Handler for MCP9808 peripheral.

Weak Functions
MCP9808 handler may be user implemented to suit custom needs
Note
Should be called periodically to handle MCP9808 tasks (or by calling MCP9808_handler_it instead)
Parameters
[in]pCpnt- Pointer to MCP9808 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MCP9808_handler_all()

FctERR MCP9808_handler_all ( void )

Handler for all MCP9808 peripherals.

Note
May be called periodically to handle all MCP9808 tasks
Returns
FctERR - error code
Here is the call graph for this function:

◆ MCP9808_handler_it()

FctERR MCP9808_handler_it ( MCP9808_t *const pCpnt)

Handler for MCP9808 peripheral GPIO interrupt.

Note
MCP9808_Alert_GPIO_Init has to be called at init before using interrupt handler function
Weak Functions
MCP9808 GPIO interrupt handler may be user implemented to suit custom needs
Note
May be called periodically to handle MCP9808 tasks through interrupts
Parameters
[in]pCpnt- Pointer to MCP9808 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MCP9808_handler_it_all()

FctERR MCP9808_handler_it_all ( void )

Handler for all MCP9808 peripherals GPIO interrupt.

Note
MCP9808_Alert_GPIO_Init has to be called at init before using interrupt handler function
May be called periodically to handle all MCP9808 tasks
Returns
FctERR - error code
Here is the call graph for this function:

◆ MCP9808_Init_Sequence()

FctERR MCP9808_Init_Sequence ( MCP9808_t *const pCpnt)

Initialization Sequence of the MCP9808 peripheral.

Weak Functions
MCP9808 handler may be user implemented to suit custom needs
Parameters
[in]pCpnt- Pointer to MCP9808 component
Returns
FctERR - error code
if (err != ERROR_OK) { goto ret; }
if (err != ERROR_OK) { goto ret; }
if (err != ERROR_OK) { goto ret; }
// Checking if Set Alert works properly
if (err != ERROR_OK) { goto ret; }
if (err != ERROR_OK) { goto ret; }
if (err != ERROR_OK) { goto ret; }
FctERR MCP9808_Set_AlertTemp(MCP9808_t *const pCpnt, const float temp, const MCP9808_alert alt)
Set the high/low/crit Alert temperature.
Definition MCP9808_proc.c:66
FctERR MCP9808_Get_AlertTemp(MCP9808_t *const pCpnt, float *temp, MCP9808_alert alt)
Get the high/low/crit Alert temperature.
Definition MCP9808_proc.c:94
@ MCP9808__ALERT_CRIT
Critical temperature alert.
Definition MCP9808_proc.h:38
@ MCP9808__ALERT_LOW
Low temperature alert.
Definition MCP9808_proc.h:37
@ MCP9808__ALERT_HIGH
High temperature alert.
Definition MCP9808_proc.h:36
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MCP9808_Set_AlertTemp()

FctERR MCP9808_Set_AlertTemp ( MCP9808_t *const pCpnt,
const float temp,
const MCP9808_alert alt )

Set the high/low/crit Alert temperature.

Parameters
[in]pCpnt- Pointer to MCP9808 component
[in,out]temp- temperature (in Celsius degrees)
[in]alt- Alert type
Returns
FctERR - error code
Here is the call graph for this function:

Variable Documentation

◆ MCP9808

MCP9808_t MCP9808[I2C_MCP9808_NB]
extern

MCP9808 User structure.