3.14.1 HLVD
High/Low-Voltage Detect
3.14.1.1 Introduction
The High/Low-Voltage Detect (HLVD) module can be configured to monitor the device voltage. This is useful in battery monitoring applications.
3.14.1.2 Supported Device Families
PIC18F-K2x | PIC18F-K50 | PIC18F-K80 |
PIC18F-K90 |
3.14.1.3 Required header files
#include "mcc_generated_files/hlvd/hlvd.h"
3.14.1.5 File Documentation
3.14.1.5.1 source/hlvd.c File Reference
This file contains the API implementation for the HLVD driver.
#include "../hlvd.h"
Functions
static void HLVD_DefaultCallback (void)
void HLVD_Initialize (void)
Initializes the HLVD module. This is called only once before calling other HLVD APIs.
bool HLVD_IsReferenceVoltageStable (void)
Returns the status of the internal reference voltage.
bool HLVD_IsBandGapVoltageStable (void)
Returns the status of the band gap reference voltage.
void HLVD_Enable (void)
Enables the HLVD.
void HLVD_Disable (void)
Disables the HLVD.
void HLVD_TripPointSetup (HLVD_TRIP_DIRECTION trip_direction, HLVD_TRIP_POINTS trip_points)
Sets the voltage trip direction and trip point value.
void HLVD_Tasks (void)
Checks the status of the HLVD Interrupt Flag bit.
void HLVD_CallbackRegister (void(*CallbackHandler)(void))
Sets the callback handler for the HLVD interrupt events.
Variables
static void(* HLVD_Callback )(void)
Detailed Description
This file contains the API implementation for the HLVD driver.
HLVD Generated Driver File.
Function Documentation
HLVD_DefaultCallback()
static void HLVD_DefaultCallback (void )[static]
Variable Documentation
HLVD_Callback
void(* HLVD_Callback) (void)[static]
Section: Included Files
3.14.1.5.2 source/hlvd.h File Reference
#include <xc.h> #include <stdbool.h>
Functions
void HLVD_Initialize (void)
Initializes the HLVD module. This is called only once before calling other HLVD APIs.
void HLVD_Enable (void)
Enables the HLVD.
void HLVD_Disable (void)
Disables the HLVD.
bool HLVD_IsReferenceVoltageStable (void)
Returns the status of the internal reference voltage.
bool HLVD_IsBandGapVoltageStable (void)
Returns the status of the band gap reference voltage.
void HLVD_TripPointSetup (HLVD_TRIP_DIRECTION trip_direction, HLVD_TRIP_POINTS trip_points)
Sets the voltage trip direction and trip point value.
void HLVD_CallbackRegister (void(*CallbackHandler)(void))
Sets the callback handler for the HLVD interrupt events.
void HLVD_Tasks (void)
Checks the status of the HLVD Interrupt Flag bit.
Enumerations
enum HLVD_TRIP_POINTS { HLVD_TRIP_POINT_EXTERNAL = 15, HLVD_TRIP_POINT_4p64V = 14, HLVD_TRIP_POINT_4p33V = 13, HLVD_TRIP_POINT_4p06V = 12, HLVD_TRIP_POINT_3p82V = 11, HLVD_TRIP_POINT_3p61V = 10, HLVD_TRIP_POINT_3p42V = 9, HLVD_TRIP_POINT_3p24V = 8, HLVD_TRIP_POINT_2p95V = 7, HLVD_TRIP_POINT_2p82V = 6, HLVD_TRIP_POINT_2p70V = 5, HLVD_TRIP_POINT_2p50V = 4, HLVD_TRIP_POINT_2p40V = 3, HLVD_TRIP_POINT_2p24V = 2, HLVD_TRIP_POINT_2p03V = 1, HLVD_TRIP_POINT_1p80V = 0 }
Trip point values for the HLVD driver.
enum HLVD_TRIP_DIRECTION { BELOW_TRIP_POINT = 0, EXCEED_TRIP_POINT = 1 }
Voltage trip direction for the HLVD driver.
Detailed Description
HLVD Generated Driver API Header File.