| Solar panel
    | 
#include <stdint.h>#include <stdbool.h>Go to the source code of this file.
| Functions | |
| void | TMR2_Initialize (void) | 
| void | TMR2_StartTimer (void) | 
| void | TMR2_StopTimer (void) | 
| uint8_t | TMR2_ReadTimer (void) | 
| void | TMR2_WriteTimer (uint8_t timerVal) | 
| void | TMR2_LoadPeriodRegister (uint8_t periodVal) | 
| bool | TMR2_HasOverflowOccured (void) | 
| bool TMR2_HasOverflowOccured | ( | void | ) | 
@Summary Boolean routine to poll or to check for the match flag on the fly.
@Description This function is called to check for the timer match flag. This function is used in timer polling method.
@Preconditions Initialize the TMR2 module before calling this routine.
@Param None
@Returns true - timer match has occurred. false - timer match has not occurred.
@Example  while(1) { check the match flag if(TMR2_HasOverflowOccured()) { Do something else...
Reload the TMR2 value TMR2_Reload(); } }  
| void TMR2_Initialize | ( | void | ) | 
TMR2 Generated Driver API Header File
@Company Microchip Technology Inc.
@File Name tmr2.h
@Summary This is the generated header file for the TMR2 driver using PIC10 / PIC12 / PIC16 / PIC18 MCUs
@Description This header file provides APIs for TMR2. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 Device : PIC18F97J60 Driver Version : 2.01 The generated drivers are tested against the following: Compiler : XC8 2.36 and above MPLAB : MPLAB X 6.00 Section: Included Files Section: Macro Declarations Section: TMR2 APIs @Summary Initializes the TMR2 module.
@Description This function initializes the TMR2 Registers. This function must be called before any other TMR2 function is called.
@Preconditions None
@Param None
@Returns None
@Comment
@Example  main() { Initialize TMR2 module TMR2_Initialize();
Do something else... } 
TMR2 Generated Driver File
@Company Microchip Technology Inc.
@File Name tmr2.c
@Summary This is the generated driver implementation file for the TMR2 driver using PIC10 / PIC12 / PIC16 / PIC18 MCUs
@Description This source file provides APIs for TMR2. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 Device : PIC18F97J60 Driver Version : 2.01 The generated drivers are tested against the following: Compiler : XC8 2.36 and above MPLAB : MPLAB X 6.00 Section: Included Files Section: Global Variables Definitions Section: TMR2 APIs
| void TMR2_LoadPeriodRegister | ( | uint8_t | periodVal | ) | 
@Summary Load value to Period Register.
@Description This function writes the value to PR2 register. This function must be called after the initialization of TMR2.
@Preconditions Initialize the TMR2 before calling this function.
@Param periodVal - Value to load into TMR2 register.
@Returns None
@Example  #define PERIOD1 0x80 #define PERIOD2 0x40 #define ZERO 0x00
 while(1) { Read the TMR2 register if(ZERO == TMR2_ReadTimer()) { Do something else... 
        if(flag)
        {
            flag = 0;
Load Period 1 value TMR2_LoadPeriodRegister(PERIOD1); } else { flag = 1;
Load Period 2 value TMR2_LoadPeriodRegister(PERIOD2); } }
Do something else... }  
| uint8_t TMR2_ReadTimer | ( | void | ) | 
@Summary Reads the TMR2 register.
@Description This function reads the TMR2 register value and return it.
@Preconditions Initialize the TMR2 before calling this function.
@Param None
@Returns This function returns the current value of TMR2 register.
@Example  Initialize TMR2 module
Start TMR2 TMR2_StartTimer();
Read the current value of TMR2 if(0 == TMR2_ReadTimer()) { Do something else...
Reload the TMR value TMR2_Reload(); }  
| void TMR2_StartTimer | ( | void | ) | 
@Summary This function starts the TMR2.
@Description This function starts the TMR2 operation. This function must be called after the initialization of TMR2.
@Preconditions Initialize the TMR2 before calling this function.
@Param None
@Returns None
@Example  Initialize TMR2 module
Start TMR2 TMR2_StartTimer();
Do something else...  
| void TMR2_StopTimer | ( | void | ) | 
@Summary This function stops the TMR2.
@Description This function stops the TMR2 operation. This function must be called after the start of TMR2.
@Preconditions Initialize the TMR2 before calling this function.
@Param None
@Returns None
@Example  Initialize TMR2 module
Start TMR2 TMR2_StartTimer();
Do something else...
Stop TMR2; TMR2_StopTimer();  
| void TMR2_WriteTimer | ( | uint8_t | timerVal | ) | 
@Summary Writes the TMR2 register.
@Description This function writes the TMR2 register. This function must be called after the initialization of TMR2.
@Preconditions Initialize the TMR2 before calling this function.
@Param timerVal - Value to write into TMR2 register.
@Returns None
@Example  #define PERIOD 0x80 #define ZERO 0x00
 while(1) { Read the TMR2 register if(ZERO == TMR2_ReadTimer()) { Do something else...
Write the TMR2 register TMR2_WriteTimer(PERIOD); }
Do something else... }