blob: e9bf54b6201e379364156b6154133860fece2433 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/* Microchip MCP4912 10-bit DAC
*
* Device: PIC16F1459
* Compiler: XC8 v3.00
*
* Usage:
*
* #include <xc.h>
* #include <stdint.h>
* #include "types.h"
* #include "dac.h"
*/
// Pin mapping
#define DAC1_CS_TRIS TRISBbits.TRISB7
#define DAC1_CS LATBbits.LATB7
#define DAC2_CS_TRIS TRISBbits.TRISB5
#define DAC2_CS LATBbits.LATB5
void dacInit(void);
// Set DAC1 VOUTA.
// Mv is the desired voltage in millivolts.
void dacSet1a(U16 mv);
// Set DAC1 VOUTB.
// Mv is the desired voltage in millivolts.
void dacSet1b(U16 mv);
// Set DAC2 VOUTA.
// Mv is the desired voltage in millivolts.
void dacSet2a(U16 mv);
// Set DAC2 VOUTB.
// Mv is the desired voltage in millivolts.
void dacSet2b(U16 mv);
|