Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
humid_pcap01.h
Go to the documentation of this file.
1 #ifndef PCAP01_H
2 #define PCAP01_H
3 
4 #include "std.h"
5 
6 //#define PCAP01_STANDARD
7 #define PCAP01_200HZ
8 
9 typedef struct {
19 
20 #define PCAP01_ADDR 0xA0
21 
22 #define PCAP01_IDLE 0
23 #define PCAP01_GET_HUMID 1
24 #define PCAP01_GET_TEMP 2
25 
26 //OpCodes für PCap Programmierung
27 #define PCAP01_PU_RESET 0x88
28 #define PCAP01_IN_RESET 0x8a
29 #define PCAP01_START 0x8c
30 #define PCAP01_TERM 0x84
31 
32 #define PCAP01_WRITE_REG 0xC0
33 #define PCAP01_READ_REG 0x40
34 #define PCAP01_READ_STAT 0x48
35 #define PCAP01_WRITE_SRAM 0x90
36 #define PCAP01_WRITE_OTP 0xA0
37 
38 // Configuration Registers
39 #define PCAP01_REG0 0x00
40 #define PCAP01_REG1 0x01
41 #define PCAP01_REG2 0x02
42 #define PCAP01_REG3 0x03
43 #define PCAP01_REG4 0x04
44 #define PCAP01_REG5 0x05
45 #define PCAP01_REG6 0x06
46 #define PCAP01_REG7 0x07
47 #define PCAP01_REG8 0x08
48 #define PCAP01_REG9 0x09
49 #define PCAP01_REG10 0x0A
50 #define PCAP01_REG11 0x0B
51 #define PCAP01_REG12 0x0C
52 #define PCAP01_REG13 0x0D
53 #define PCAP01_REG14 0x0E
54 #define PCAP01_REG15 0x0F
55 #define PCAP01_REG16 0x10
56 #define PCAP01_REG17 0x11
57 #define PCAP01_REG18 0x12
58 #define PCAP01_REG19 0x13
59 #define PCAP01_REG20 0x14
60 
61 #ifdef PCAP01_200HZ
62 // Register configuration values
63 #define PCAP01_REG0_VALUE 0x420F0F
64 #define PCAP01_REG1_VALUE 0x201004
65 #define PCAP01_REG2_VALUE 0x1F460A
66 #define PCAP01_REG3_VALUE 0x090004
67 #define PCAP01_REG4_VALUE 0x08040D
68 #define PCAP01_REG5_VALUE 0xC0001E
69 #define PCAP01_REG6_VALUE 0x000C40
70 #define PCAP01_REG7_VALUE 0x1F0000
71 #define PCAP01_REG8_VALUE 0x800053
72 #define PCAP01_REG9_VALUE 0x00A88F
73 #define PCAP01_REG10_VALUE 0x18004B
74 #define PCAP01_REG11_VALUE 0x000000
75 #define PCAP01_REG12_VALUE 0x000000
76 #define PCAP01_REG13_VALUE 0x000000
77 #define PCAP01_REG14_VALUE 0x000000
78 #define PCAP01_REG15_VALUE 0x000000
79 #define PCAP01_REG16_VALUE 0x000000
80 #define PCAP01_REG17_VALUE 0x000006
81 #define PCAP01_REG18_VALUE 0x0000A6
82 #define PCAP01_REG19_VALUE 0x000001
83 #define PCAP01_REG20_VALUE 0x000001
84 #endif
85 #ifdef PCAP01_STANDARD
86 // Register configuration values
87 #define PCAP01_REG0_VALUE 0x4200FF
88 #define PCAP01_REG1_VALUE 0x201022
89 #define PCAP01_REG2_VALUE 0x0F460B
90 #define PCAP01_REG3_VALUE 0x070010
91 #define PCAP01_REG4_VALUE 0x080000
92 #define PCAP01_REG5_VALUE 0x000000
93 #define PCAP01_REG6_VALUE 0x000040
94 #define PCAP01_REG7_VALUE 0x1F0000
95 #define PCAP01_REG8_VALUE 0xA00010
96 #define PCAP01_REG9_VALUE 0xFF000F
97 #define PCAP01_REG10_VALUE 0x180047
98 #define PCAP01_REG11_VALUE 0x000000
99 #define PCAP01_REG12_VALUE 0x000000
100 #define PCAP01_REG13_VALUE 0x000000
101 #define PCAP01_REG14_VALUE 0x000000
102 #define PCAP01_REG15_VALUE 0x000000
103 #define PCAP01_REG16_VALUE 0x000000
104 #define PCAP01_REG17_VALUE 0x000000
105 #define PCAP01_REG18_VALUE 0x000000
106 #define PCAP01_REG19_VALUE 0x200000
107 #define PCAP01_REG20_VALUE 0x000001
108 #endif
109 
110 void writePCAP01_SRAM(uint8_t data, uint16_t s_add);
112 void PCAP01_Control(uint8_t control);
113 void pcap01readRegister(uint8_t reg);
114 void pcap01writeRegister(uint8_t reg,uint32_t value);
115 void writePCAP01_firmware(void);
116 void pcap01_init(void);
117 void pcap01_periodic(void);
118 void pcap01_event(void);
119 
120 #endif
unsigned short uint16_t
Definition: types.h:16
uint32_t V_rh
Definition: humid_pcap01.h:16
uint32_t hum
Definition: humid_pcap01.h:12
void PCAP01_Control(uint8_t control)
PCAP01_Control.
Definition: humid_pcap01.c:89
uint32_t hum_t
Definition: humid_pcap01.h:11
void pcap01_periodic(void)
pcap01_readData
Definition: humid_pcap01.c:211
unsigned long uint32_t
Definition: types.h:18
void writePCAP01_firmware(void)
uint32_t C_ratio
Definition: humid_pcap01.h:14
void pcap01_init(void)
Definition: humid_pcap01.c:158
uint32_t status
Definition: humid_pcap01.h:17
unsigned char uint8_t
Definition: types.h:14
uint32_t temp
Definition: humid_pcap01.h:10
uint32_t R_ratio
Definition: humid_pcap01.h:13
void pcap01readRegister(uint8_t reg)
Definition: humid_pcap01.c:190
void pcap01_event(void)
Definition: humid_pcap01.c:222
void pcap01writeRegister(uint8_t reg, uint32_t value)
Definition: humid_pcap01.c:100
void writePCAP01_SRAM(uint8_t data, uint16_t s_add)
Definition: humid_pcap01.c:55
uint32_t NV_temp
Definition: humid_pcap01.h:15
uint8_t readPCAP01_SRAM(uint16_t s_add)
Definition: humid_pcap01.c:65