1 |
/** |
---|
2 |
CMP1 Generated Driver File |
---|
3 |
|
---|
4 |
@Company |
---|
5 |
Microchip Technology Inc. |
---|
6 |
|
---|
7 |
@File Name |
---|
8 |
cmp1.c |
---|
9 |
|
---|
10 |
@Summary |
---|
11 |
This is the generated driver implementation file for the CMP1 driver using PIC10 / PIC12 / PIC16 / PIC18 MCUs |
---|
12 |
|
---|
13 |
@Description |
---|
14 |
This source file provides implementations for driver APIs for CMP1. |
---|
15 |
Generation Information : |
---|
16 |
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65.2 |
---|
17 |
Device : PIC16F1579 |
---|
18 |
Driver Version : 2.11 |
---|
19 |
The generated drivers are tested against the following: |
---|
20 |
Compiler : XC8 1.45 or later |
---|
21 |
MPLAB : MPLAB X 4.15 |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
/* |
---|
25 |
(c) 2018 Microchip Technology Inc. and its subsidiaries. |
---|
26 |
|
---|
27 |
Subject to your compliance with these terms, you may use Microchip software and any |
---|
28 |
derivatives exclusively with Microchip products. It is your responsibility to comply with third party |
---|
29 |
license terms applicable to your use of third party software (including open source software) that |
---|
30 |
may accompany Microchip software. |
---|
31 |
|
---|
32 |
THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER |
---|
33 |
EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY |
---|
34 |
IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS |
---|
35 |
FOR A PARTICULAR PURPOSE. |
---|
36 |
|
---|
37 |
IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, |
---|
38 |
INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND |
---|
39 |
WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP |
---|
40 |
HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO |
---|
41 |
THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL |
---|
42 |
CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT |
---|
43 |
OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS |
---|
44 |
SOFTWARE. |
---|
45 |
*/ |
---|
46 |
|
---|
47 |
/** |
---|
48 |
Section: Included Files |
---|
49 |
*/ |
---|
50 |
|
---|
51 |
|
---|
52 |
#include <xc.h> |
---|
53 |
#include "cmp1.h" |
---|
54 |
#include "pin_manager.h" |
---|
55 |
/** |
---|
56 |
Section: CMP1 APIs |
---|
57 |
*/ |
---|
58 |
|
---|
59 |
void CMP1_Initialize(void) |
---|
60 |
{ |
---|
61 |
|
---|
62 |
// C1HYS enabled; C1SP lo_speed; C1ON enabled; C1POL not inverted; C1SYNC asynchronous; |
---|
63 |
CM1CON0 = 0x82; |
---|
64 |
|
---|
65 |
// C1INTN intFlag_neg; C1INTP no_intFlag; C1PCH DAC; C1NCH CIN2-; |
---|
66 |
CM1CON1 = 0x52; |
---|
67 |
|
---|
68 |
} |
---|
69 |
|
---|
70 |
bool CMP1_GetOutputStatus(void) |
---|
71 |
{ |
---|
72 |
return (CMOUTbits.MC1OUT); |
---|
73 |
} |
---|
74 |
|
---|
75 |
|
---|
76 |
/** |
---|
77 |
End of File |
---|
78 |
*/ |
---|