Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
ACAM Picocap Single-chip Solution for Capacitance Measurement. More...
#include "std.h"
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) |
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.
struct PCAP01VALUE |
#define PCAP01_200HZ |
Definition at line 37 of file humid_pcap01.h.
#define PCAP01_ADDR 0xA0 |
Definition at line 50 of file humid_pcap01.h.
#define PCAP01_GET_HUMID 1 |
Definition at line 53 of file humid_pcap01.h.
#define PCAP01_GET_TEMP 2 |
Definition at line 54 of file humid_pcap01.h.
#define PCAP01_IDLE 0 |
Definition at line 52 of file humid_pcap01.h.
#define PCAP01_IN_RESET 0x8a |
Definition at line 58 of file humid_pcap01.h.
#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.
#define PCAP01_REG0_VALUE 0x420F0F |
Definition at line 93 of file humid_pcap01.h.
#define PCAP01_REG1 0x01 |
Definition at line 70 of file humid_pcap01.h.
#define PCAP01_REG10 0x0A |
Definition at line 79 of file humid_pcap01.h.
#define PCAP01_REG10_VALUE 0x18004B |
Definition at line 103 of file humid_pcap01.h.
#define PCAP01_REG11 0x0B |
Definition at line 80 of file humid_pcap01.h.
#define PCAP01_REG11_VALUE 0x000000 |
Definition at line 104 of file humid_pcap01.h.
#define PCAP01_REG12 0x0C |
Definition at line 81 of file humid_pcap01.h.
#define PCAP01_REG12_VALUE 0x000000 |
Definition at line 105 of file humid_pcap01.h.
#define PCAP01_REG13 0x0D |
Definition at line 82 of file humid_pcap01.h.
#define PCAP01_REG13_VALUE 0x000000 |
Definition at line 106 of file humid_pcap01.h.
#define PCAP01_REG14 0x0E |
Definition at line 83 of file humid_pcap01.h.
#define PCAP01_REG14_VALUE 0x000000 |
Definition at line 107 of file humid_pcap01.h.
#define PCAP01_REG15 0x0F |
Definition at line 84 of file humid_pcap01.h.
#define PCAP01_REG15_VALUE 0x000000 |
Definition at line 108 of file humid_pcap01.h.
#define PCAP01_REG16 0x10 |
Definition at line 85 of file humid_pcap01.h.
#define PCAP01_REG16_VALUE 0x000000 |
Definition at line 109 of file humid_pcap01.h.
#define PCAP01_REG17 0x11 |
Definition at line 86 of file humid_pcap01.h.
#define PCAP01_REG17_VALUE 0x000006 |
Definition at line 110 of file humid_pcap01.h.
#define PCAP01_REG18 0x12 |
Definition at line 87 of file humid_pcap01.h.
#define PCAP01_REG18_VALUE 0x0000A6 |
Definition at line 111 of file humid_pcap01.h.
#define PCAP01_REG19 0x13 |
Definition at line 88 of file humid_pcap01.h.
#define PCAP01_REG19_VALUE 0x000001 |
Definition at line 112 of file humid_pcap01.h.
#define PCAP01_REG1_VALUE 0x201004 |
Definition at line 94 of file humid_pcap01.h.
#define PCAP01_REG2 0x02 |
Definition at line 71 of file humid_pcap01.h.
#define PCAP01_REG20 0x14 |
Definition at line 89 of file humid_pcap01.h.
#define PCAP01_REG20_VALUE 0x000001 |
Definition at line 113 of file humid_pcap01.h.
#define PCAP01_REG2_VALUE 0x1F460A |
Definition at line 95 of file humid_pcap01.h.
#define PCAP01_REG3 0x03 |
Definition at line 72 of file humid_pcap01.h.
#define PCAP01_REG3_VALUE 0x090004 |
Definition at line 96 of file humid_pcap01.h.
#define PCAP01_REG4 0x04 |
Definition at line 73 of file humid_pcap01.h.
#define PCAP01_REG4_VALUE 0x08040D |
Definition at line 97 of file humid_pcap01.h.
#define PCAP01_REG5 0x05 |
Definition at line 74 of file humid_pcap01.h.
#define PCAP01_REG5_VALUE 0xC0001E |
Definition at line 98 of file humid_pcap01.h.
#define PCAP01_REG6 0x06 |
Definition at line 75 of file humid_pcap01.h.
#define PCAP01_REG6_VALUE 0x000C40 |
Definition at line 99 of file humid_pcap01.h.
#define PCAP01_REG7 0x07 |
Definition at line 76 of file humid_pcap01.h.
#define PCAP01_REG7_VALUE 0x1F0000 |
Definition at line 100 of file humid_pcap01.h.
#define PCAP01_REG8 0x08 |
Definition at line 77 of file humid_pcap01.h.
#define PCAP01_REG8_VALUE 0x800053 |
Definition at line 101 of file humid_pcap01.h.
#define PCAP01_REG9 0x09 |
Definition at line 78 of file humid_pcap01.h.
#define PCAP01_REG9_VALUE 0x00A88F |
Definition at line 102 of file humid_pcap01.h.
#define PCAP01_START 0x8c |
Definition at line 59 of file humid_pcap01.h.
#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.
#define PCAP01_WRITE_SRAM 0x90 |
Definition at line 65 of file humid_pcap01.h.
void PCAP01_Control | ( | uint8_t | control | ) |
PCAP01_Control.
Function to send control commands to the PCAP01
control | Control 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().
void pcap01_event | ( | void | ) |
Definition at line 208 of file humid_pcap01.c.
References i2c_transaction::buf, PCAP01VALUE::C_ratio, DefaultChannel, DefaultDevice, I2CTransDone, I2CTransSuccess, PCAP01_GET_HUMID, PCAP01_GET_TEMP, PCAP01_IDLE, PCAP01_REG13, PCAP01_REG3, pcap01_trans, pcap01readRegister(), pcap01Value, PCAP01VALUE::R_ratio, i2c_transaction::status, and PCAP01VALUE::status.
void pcap01_init | ( | void | ) |
Definition at line 151 of file humid_pcap01.c.
References I2CTransDone, PCAP01_Control(), PCAP01_IDLE, PCAP01_IN_RESET, PCAP01_REG0, PCAP01_REG0_VALUE, PCAP01_REG1, PCAP01_REG10, PCAP01_REG10_VALUE, PCAP01_REG11, PCAP01_REG11_VALUE, PCAP01_REG12, PCAP01_REG12_VALUE, PCAP01_REG13, PCAP01_REG13_VALUE, PCAP01_REG14, PCAP01_REG14_VALUE, PCAP01_REG15, PCAP01_REG15_VALUE, PCAP01_REG16, PCAP01_REG16_VALUE, PCAP01_REG17, PCAP01_REG17_VALUE, PCAP01_REG18, PCAP01_REG18_VALUE, PCAP01_REG19, PCAP01_REG19_VALUE, PCAP01_REG1_VALUE, PCAP01_REG2, PCAP01_REG20, PCAP01_REG20_VALUE, PCAP01_REG2_VALUE, PCAP01_REG3, PCAP01_REG3_VALUE, PCAP01_REG4, PCAP01_REG4_VALUE, PCAP01_REG5, PCAP01_REG5_VALUE, PCAP01_REG6, PCAP01_REG6_VALUE, PCAP01_REG7, PCAP01_REG7_VALUE, PCAP01_REG8, PCAP01_REG8_VALUE, PCAP01_REG9, PCAP01_REG9_VALUE, PCAP01_START, pcap01_trans, pcap01Value, pcap01writeRegister(), i2c_transaction::status, PCAP01VALUE::status, sys_time_usleep(), and writePCAP01_firmware().
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(), pcap01Value, and PCAP01VALUE::status.
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().
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().
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.
void writePCAP01_firmware | ( | void | ) |
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.