tsic.h


1
#ifndef tsic_H
2
#define tsic_H
3
#include "Main.h"
4
/******************************************************************************/
5
// TSIC Signal-Pin
6
#define TSIC_PORT             PORTA  // Port to use
7
#define TSIC_PIN              PINA
8
#define TSIC_PORT_DDR         DDRA
9
#define TSIC_SIGNAL_PIN       (1<<PIN1)
10
11
// TSIC VCC
12
#define TSIC_PORT_Power       PORTE
13
#define TSIC_PORT_DDR_Power   DDRE
14
#define TSCI_POWER_PIN        (1<<PIN6)
15
/******************************************************************************/
16
17
#define TSIC_SIGNAL_HIGH  TSIC_PIN & TSIC_SIGNAL_PIN        // High Signal of the TSIC-Sensor
18
#define TSIC_SIGNAL_LOW    !( TSIC_PIN & TSIC_SIGNAL_PIN)      // Low Signal of the TSIC-Sensor
19
#define TSIC_ON()      TSIC_PORT_Power |=  TSCI_POWER_PIN    // Power up the TSIC-Sensor
20
#define TSIC_OFF()      TSIC_PORT_Power &= ~TSCI_POWER_PIN    // Power down the TSIC-Sensor
21
#define Abbruch()      if (timeout==0){return 0;}        // Abbruch, falls der sensor abgezogen wird
22
23
void TSIC_INIT(void);
24
uint8_t getTSicTemp(uint16_t *temp_value16);
25
uint8_t readSens(uint16_t *temp_value);
26
uint8_t checkParity(uint16_t *temp_value);
27
28
29
30
#endif