Paparazzi UAS  v5.15_devel-81-gd13dafb
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
humid_pcap01.h File Reference

ACAM Picocap Single-chip Solution for Capacitance Measurement. More...

#include "std.h"
+ Include dependency graph for humid_pcap01.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PCAP01VALUE
 

Macros

#define PCAP01_200HZ
 
#define PCAP01_ADDR   0xA0
 
#define PCAP01_IDLE   0
 
#define PCAP01_GET_HUMID   1
 
#define PCAP01_GET_TEMP   2
 
#define PCAP01_PU_RESET   0x88
 
#define PCAP01_IN_RESET   0x8a
 
#define PCAP01_START   0x8c
 
#define PCAP01_TERM   0x84
 
#define PCAP01_WRITE_REG   0xC0
 
#define PCAP01_READ_REG   0x40
 
#define PCAP01_READ_STAT   0x48
 
#define PCAP01_WRITE_SRAM   0x90
 
#define PCAP01_WRITE_OTP   0xA0
 
#define PCAP01_REG0   0x00
 
#define PCAP01_REG1   0x01
 
#define PCAP01_REG2   0x02
 
#define PCAP01_REG3   0x03
 
#define PCAP01_REG4   0x04
 
#define PCAP01_REG5   0x05
 
#define PCAP01_REG6   0x06
 
#define PCAP01_REG7   0x07
 
#define PCAP01_REG8   0x08
 
#define PCAP01_REG9   0x09
 
#define PCAP01_REG10   0x0A
 
#define PCAP01_REG11   0x0B
 
#define PCAP01_REG12   0x0C
 
#define PCAP01_REG13   0x0D
 
#define PCAP01_REG14   0x0E
 
#define PCAP01_REG15   0x0F
 
#define PCAP01_REG16   0x10
 
#define PCAP01_REG17   0x11
 
#define PCAP01_REG18   0x12
 
#define PCAP01_REG19   0x13
 
#define PCAP01_REG20   0x14
 
#define PCAP01_REG0_VALUE   0x420F0F
 
#define PCAP01_REG1_VALUE   0x201004
 
#define PCAP01_REG2_VALUE   0x1F460A
 
#define PCAP01_REG3_VALUE   0x090004
 
#define PCAP01_REG4_VALUE   0x08040D
 
#define PCAP01_REG5_VALUE   0xC0001E
 
#define PCAP01_REG6_VALUE   0x000C40
 
#define PCAP01_REG7_VALUE   0x1F0000
 
#define PCAP01_REG8_VALUE   0x800053
 
#define PCAP01_REG9_VALUE   0x00A88F
 
#define PCAP01_REG10_VALUE   0x18004B
 
#define PCAP01_REG11_VALUE   0x000000
 
#define PCAP01_REG12_VALUE   0x000000
 
#define PCAP01_REG13_VALUE   0x000000
 
#define PCAP01_REG14_VALUE   0x000000
 
#define PCAP01_REG15_VALUE   0x000000
 
#define PCAP01_REG16_VALUE   0x000000
 
#define PCAP01_REG17_VALUE   0x000006
 
#define PCAP01_REG18_VALUE   0x0000A6
 
#define PCAP01_REG19_VALUE   0x000001
 
#define PCAP01_REG20_VALUE   0x000001
 

Functions

void writePCAP01_SRAM (uint8_t data, uint16_t s_add)
 
uint8_t readPCAP01_SRAM (uint16_t s_add)
 
void PCAP01_Control (uint8_t control)
 PCAP01_Control. More...
 
void pcap01readRegister (uint8_t reg)
 
void pcap01writeRegister (uint8_t reg, uint32_t value)
 
void writePCAP01_firmware (void)
 
void pcap01_init (void)
 
void pcap01_periodic (void)
 pcap01_readData More...
 
void pcap01_event (void)
 

Detailed Description

ACAM Picocap Single-chip Solution for Capacitance Measurement.

This reads the values for temperature and humidity from the ACAM capacitance and resistance measurement unit through I2C.

Definition in file humid_pcap01.h.


Data Structure Documentation

struct PCAP01VALUE

Definition at line 39 of file humid_pcap01.h.

Data Fields
uint32_t C_ratio
uint32_t hum
uint32_t hum_t
uint32_t NV_temp
uint32_t R_ratio
uint32_t status
uint32_t temp
uint32_t V_rh

Macro Definition Documentation

#define PCAP01_200HZ

Definition at line 37 of file humid_pcap01.h.

#define PCAP01_ADDR   0xA0
#define PCAP01_GET_HUMID   1

Definition at line 53 of file humid_pcap01.h.

Referenced by pcap01_event(), and pcap01_periodic().

#define PCAP01_GET_TEMP   2

Definition at line 54 of file humid_pcap01.h.

Referenced by pcap01_event().

#define PCAP01_IDLE   0

Definition at line 52 of file humid_pcap01.h.

Referenced by pcap01_event(), and pcap01_init().

#define PCAP01_IN_RESET   0x8a

Definition at line 58 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_PU_RESET   0x88

Definition at line 57 of file humid_pcap01.h.

#define PCAP01_READ_REG   0x40

Definition at line 63 of file humid_pcap01.h.

#define PCAP01_READ_STAT   0x48

Definition at line 64 of file humid_pcap01.h.

#define PCAP01_REG0   0x00

Definition at line 69 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG0_VALUE   0x420F0F

Definition at line 93 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG1   0x01

Definition at line 70 of file humid_pcap01.h.

Referenced by pcap01_init(), and pcap01_periodic().

#define PCAP01_REG10   0x0A

Definition at line 79 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG10_VALUE   0x18004B

Definition at line 103 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG11   0x0B

Definition at line 80 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG11_VALUE   0x000000

Definition at line 104 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG12   0x0C

Definition at line 81 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG12_VALUE   0x000000

Definition at line 105 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG13   0x0D

Definition at line 82 of file humid_pcap01.h.

Referenced by pcap01_event(), and pcap01_init().

#define PCAP01_REG13_VALUE   0x000000

Definition at line 106 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG14   0x0E

Definition at line 83 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG14_VALUE   0x000000

Definition at line 107 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG15   0x0F

Definition at line 84 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG15_VALUE   0x000000

Definition at line 108 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG16   0x10

Definition at line 85 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG16_VALUE   0x000000

Definition at line 109 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG17   0x11

Definition at line 86 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG17_VALUE   0x000006

Definition at line 110 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG18   0x12

Definition at line 87 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG18_VALUE   0x0000A6

Definition at line 111 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG19   0x13

Definition at line 88 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG19_VALUE   0x000001

Definition at line 112 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG1_VALUE   0x201004

Definition at line 94 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG2   0x02

Definition at line 71 of file humid_pcap01.h.

Referenced by pcap01_init(), and pcap01_periodic().

#define PCAP01_REG20   0x14

Definition at line 89 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG20_VALUE   0x000001

Definition at line 113 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG2_VALUE   0x1F460A

Definition at line 95 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG3   0x03

Definition at line 72 of file humid_pcap01.h.

Referenced by pcap01_event(), and pcap01_init().

#define PCAP01_REG3_VALUE   0x090004

Definition at line 96 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG4   0x04

Definition at line 73 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG4_VALUE   0x08040D

Definition at line 97 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG5   0x05

Definition at line 74 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG5_VALUE   0xC0001E

Definition at line 98 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG6   0x06

Definition at line 75 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG6_VALUE   0x000C40

Definition at line 99 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG7   0x07

Definition at line 76 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG7_VALUE   0x1F0000

Definition at line 100 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG8   0x08

Definition at line 77 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG8_VALUE   0x800053

Definition at line 101 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG9   0x09

Definition at line 78 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_REG9_VALUE   0x00A88F

Definition at line 102 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_START   0x8c

Definition at line 59 of file humid_pcap01.h.

Referenced by pcap01_init().

#define PCAP01_TERM   0x84

Definition at line 60 of file humid_pcap01.h.

#define PCAP01_WRITE_OTP   0xA0

Definition at line 66 of file humid_pcap01.h.

#define PCAP01_WRITE_REG   0xC0

Definition at line 62 of file humid_pcap01.h.

Referenced by pcap01writeRegister().

#define PCAP01_WRITE_SRAM   0x90

Definition at line 65 of file humid_pcap01.h.

Function Documentation

void PCAP01_Control ( uint8_t  control)

PCAP01_Control.

Function to send control commands to the PCAP01

Parameters
controlControl command possible commands: PCAP01_PU_RESET : Hard reset of the device PCAP01_IN_RESET : Software reset PCAP01_START : Start measurement PCAP01_START : Start measurement PCAP01_TERM : Stop measurement

Definition at line 85 of file humid_pcap01.c.

References i2c_transaction::buf, i2c_transmit(), I2CTransPending, PCAP01_ADDR, PCAP01_I2C_DEV, pcap01_trans, and i2c_transaction::status.

Referenced by pcap01_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void pcap01_periodic ( void  )

pcap01_readData

function where current measurement data from pcap01 is read into global sensor variable

Definition at line 197 of file humid_pcap01.c.

References PCAP01_GET_HUMID, PCAP01_REG1, PCAP01_REG2, pcap01readRegister(), and PCAP01VALUE::status.

+ Here is the call graph for this function:

void pcap01readRegister ( uint8_t  reg)

Definition at line 184 of file humid_pcap01.c.

References i2c_transaction::buf, i2c_transceive(), PCAP01_ADDR, PCAP01_I2C_DEV, and pcap01_trans.

Referenced by pcap01_event(), and pcap01_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void pcap01writeRegister ( uint8_t  reg,
uint32_t  value 
)

Definition at line 96 of file humid_pcap01.c.

References i2c_transaction::buf, i2c_transmit(), I2CTransPending, PCAP01_ADDR, PCAP01_I2C_DEV, pcap01_trans, PCAP01_WRITE_REG, and i2c_transaction::status.

Referenced by pcap01_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t readPCAP01_SRAM ( uint16_t  s_add)

Definition at line 61 of file humid_pcap01.c.

References i2c_transaction::buf, i2c_transceive(), I2CTransPending, PCAP01_ADDR, PCAP01_I2C_DEV, pcap01_trans, and i2c_transaction::status.

+ Here is the call graph for this function:

void writePCAP01_firmware ( void  )

Referenced by pcap01_init().

+ Here is the caller graph for this function:

void writePCAP01_SRAM ( uint8_t  data,
uint16_t  s_add 
)

Definition at line 51 of file humid_pcap01.c.

References i2c_transaction::buf, i2c_transmit(), I2CTransPending, PCAP01_ADDR, PCAP01_I2C_DEV, pcap01_trans, and i2c_transaction::status.

+ Here is the call graph for this function: