Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
humid_pcap01.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011 Norman Wildmann, Martin Mueller
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
22 
31 #ifndef PCAP01_H
32 #define PCAP01_H
33 
34 #include "std.h"
35 
36 //#define PCAP01_STANDARD
37 #define PCAP01_200HZ
38 
39 typedef struct {
48 } PCAP01VALUE;
49 
50 #define PCAP01_ADDR 0xA0
51 
52 #define PCAP01_IDLE 0
53 #define PCAP01_GET_HUMID 1
54 #define PCAP01_GET_TEMP 2
55 
56 //OpCodes für PCap Programmierung
57 #define PCAP01_PU_RESET 0x88
58 #define PCAP01_IN_RESET 0x8a
59 #define PCAP01_START 0x8c
60 #define PCAP01_TERM 0x84
61 
62 #define PCAP01_WRITE_REG 0xC0
63 #define PCAP01_READ_REG 0x40
64 #define PCAP01_READ_STAT 0x48
65 #define PCAP01_WRITE_SRAM 0x90
66 #define PCAP01_WRITE_OTP 0xA0
67 
68 // Configuration Registers
69 #define PCAP01_REG0 0x00
70 #define PCAP01_REG1 0x01
71 #define PCAP01_REG2 0x02
72 #define PCAP01_REG3 0x03
73 #define PCAP01_REG4 0x04
74 #define PCAP01_REG5 0x05
75 #define PCAP01_REG6 0x06
76 #define PCAP01_REG7 0x07
77 #define PCAP01_REG8 0x08
78 #define PCAP01_REG9 0x09
79 #define PCAP01_REG10 0x0A
80 #define PCAP01_REG11 0x0B
81 #define PCAP01_REG12 0x0C
82 #define PCAP01_REG13 0x0D
83 #define PCAP01_REG14 0x0E
84 #define PCAP01_REG15 0x0F
85 #define PCAP01_REG16 0x10
86 #define PCAP01_REG17 0x11
87 #define PCAP01_REG18 0x12
88 #define PCAP01_REG19 0x13
89 #define PCAP01_REG20 0x14
90 
91 #ifdef PCAP01_200HZ
92 // Register configuration values
93 #define PCAP01_REG0_VALUE 0x420F0F
94 #define PCAP01_REG1_VALUE 0x201004
95 #define PCAP01_REG2_VALUE 0x1F460A
96 #define PCAP01_REG3_VALUE 0x090004
97 #define PCAP01_REG4_VALUE 0x08040D
98 #define PCAP01_REG5_VALUE 0xC0001E
99 #define PCAP01_REG6_VALUE 0x000C40
100 #define PCAP01_REG7_VALUE 0x1F0000
101 #define PCAP01_REG8_VALUE 0x800053
102 #define PCAP01_REG9_VALUE 0x00A88F
103 #define PCAP01_REG10_VALUE 0x18004B
104 #define PCAP01_REG11_VALUE 0x000000
105 #define PCAP01_REG12_VALUE 0x000000
106 #define PCAP01_REG13_VALUE 0x000000
107 #define PCAP01_REG14_VALUE 0x000000
108 #define PCAP01_REG15_VALUE 0x000000
109 #define PCAP01_REG16_VALUE 0x000000
110 #define PCAP01_REG17_VALUE 0x000006
111 #define PCAP01_REG18_VALUE 0x0000A6
112 #define PCAP01_REG19_VALUE 0x000001
113 #define PCAP01_REG20_VALUE 0x000001
114 #endif
115 #ifdef PCAP01_STANDARD
116 // Register configuration values
117 #define PCAP01_REG0_VALUE 0x4200FF
118 #define PCAP01_REG1_VALUE 0x201022
119 #define PCAP01_REG2_VALUE 0x0F460B
120 #define PCAP01_REG3_VALUE 0x070010
121 #define PCAP01_REG4_VALUE 0x080000
122 #define PCAP01_REG5_VALUE 0x000000
123 #define PCAP01_REG6_VALUE 0x000040
124 #define PCAP01_REG7_VALUE 0x1F0000
125 #define PCAP01_REG8_VALUE 0xA00010
126 #define PCAP01_REG9_VALUE 0xFF000F
127 #define PCAP01_REG10_VALUE 0x180047
128 #define PCAP01_REG11_VALUE 0x000000
129 #define PCAP01_REG12_VALUE 0x000000
130 #define PCAP01_REG13_VALUE 0x000000
131 #define PCAP01_REG14_VALUE 0x000000
132 #define PCAP01_REG15_VALUE 0x000000
133 #define PCAP01_REG16_VALUE 0x000000
134 #define PCAP01_REG17_VALUE 0x000000
135 #define PCAP01_REG18_VALUE 0x000000
136 #define PCAP01_REG19_VALUE 0x200000
137 #define PCAP01_REG20_VALUE 0x000001
138 #endif
139 
140 void writePCAP01_SRAM(uint8_t data, uint16_t s_add);
142 void PCAP01_Control(uint8_t control);
143 void pcap01readRegister(uint8_t reg);
144 void pcap01writeRegister(uint8_t reg, uint32_t value);
145 void writePCAP01_firmware(void);
146 void pcap01_init(void);
147 void pcap01_periodic(void);
148 void pcap01_event(void);
149 
150 #endif
unsigned short uint16_t
Definition: types.h:16
uint32_t temp
Definition: humid_pcap01.h:40
uint32_t status
Definition: humid_pcap01.h:47
void PCAP01_Control(uint8_t control)
PCAP01_Control.
Definition: humid_pcap01.c:85
void pcap01_periodic(void)
pcap01_readData
Definition: humid_pcap01.c:197
uint32_t C_ratio
Definition: humid_pcap01.h:44
uint32_t hum
Definition: humid_pcap01.h:42
unsigned long uint32_t
Definition: types.h:18
void writePCAP01_firmware(void)
uint32_t R_ratio
Definition: humid_pcap01.h:43
void pcap01_init(void)
Definition: humid_pcap01.c:151
unsigned char uint8_t
Definition: types.h:14
uint32_t hum_t
Definition: humid_pcap01.h:41
void pcap01readRegister(uint8_t reg)
Definition: humid_pcap01.c:184
uint32_t NV_temp
Definition: humid_pcap01.h:45
void pcap01_event(void)
Definition: humid_pcap01.c:208
void pcap01writeRegister(uint8_t reg, uint32_t value)
Definition: humid_pcap01.c:96
void writePCAP01_SRAM(uint8_t data, uint16_t s_add)
Definition: humid_pcap01.c:51
uint8_t readPCAP01_SRAM(uint16_t s_add)
Definition: humid_pcap01.c:61
uint32_t V_rh
Definition: humid_pcap01.h:46