Projet

Général

Profil

Feature #12061 » print.h

Anonyme, 04/01/2020 22:37

 
#ifndef PRINT_H
#define PRINT_H

#ifndef _AVR_C
#define _AVR_C
#endif

#include "include.h"
#include "stdbool.h"

typedef enum
{
SEARCH_MASK_HIGH,
SEARCH_MASK_MIDDLE,
SEARCH_MASK_LOW
} SearchMaskTypeEnum;

typedef enum
{
UNIT_RAW,
UNIT_LAMP_LEVEL,
UNIT_HALF_MINUTES,
UNIT_15_MINUTES,
UNIT_MINUTE,
UNIT_HOUR,
UNIT_DAY,
UNIT_WEEK,
UNIT_VOLT,
UNIT_AMPERE,
UNIT_PERCENT,
UNIT_DEGREE_CELSIUS,
UNIT_RPM,
} UnitTypeEnum;

//Bit Defines

//Special function register (ui8_Spezial_Funktion_Reg)//Fonction sp?ciale onglet

#define INIT_ON 0x01 // initialization bit for the addressing commands //
#define INIT_ON_TMP 0x02 // buffer for two calls
#define WITHDRAW 0x04 // Withdrawn! //
#define RANDOMIZE 0x08 // Random must be sent 3 times //
#define ADR2LEDSTART 0x10 // Starts the output of the address on the LEDs //
#define CARRY 0x20 // transfer of the FiFo // Report de la FIFO
#define BATT_CONNECTED 0x80 // battery not connected ///

//Emergency Mode (ui8_EmergencyMode)
#define REST_MODE 0x01 //rest mode; ?0? = No
#define STANDBY_MODE 0x02 //emergency standby mode (std operation) ?0? = No
#define OPERATION_MODE 0x04 //emergency operation mode; ?0? = No
#define EMC_AFTER_PWRON 0x08 //extended emergency after mains power return?0? = No
#define FT 0x10 //function test in progress; ?0? = No
#define BT 0x20 //duration test in progress; ?0? = No
#define HW_INHIBIT 0x40 //hardwired inhibit active ?0? = Not active / not present
#define HW_PWR_ON 0x80 //hardwired switched mains power on. ?0? = Off

//Emergency Failure Status (ui8_FailureStatus)
#define CIRCUIT_FAIL 0x01 //circuit failure; ?0? = No
#define BATT_FAIL 0x02 //battery duration failure; ?0? = No
#define BATT_CHARGEFAIL 0x04 //battery charge failure; ?0? = No
#define LAMP_FAIL 0x08 //emergency lamp failure; ?0? = No
#define FT_DELAY_FAIL 0x10 //function test max. delay exceeded failure; ?0? = No
#define BT_DELAY_FAIL 0x20 //duration test max. delay exceeded failure; ?0? = No
#define FT_FAIL 0x40 //function test failed; ?0? = No
#define BT_FAIL 0x80 //duration test failed; ?0? = No

// Emergency Status (ui8_EmergencyStatus)
#define INHIBIT_MODE 0x01 //inhibit mode; ?0? = No
#define FT_DONE 0x02 //function test done; ?0? = No
#define BT_DONE 0x04 //duration test done and result valid; ?0? = No
#define CHARGING_OK 0x08 //battery charging ready; ?0? = In progress
#define FT_REQUEST 0x10 //function test request pending; ?0? = No
#define BT_REQUEST 0x20 //duration test request pending; ?0? = No
#define CC_FLAG_SET 0x40 //communication control flag set; ?0? = Reset
#define SELECTED 0x80 //selected (pointed); ?0? = No


extern uint8 ui8_switch_state;
extern TimestampStruct s_Time;

extern void PrintValueWithUnit(UnitTypeEnum e_value_type, uint16 ui16_value);
extern bool b_AnswerIsAvailable(DaliMessageStruct* p_s_message);
extern uint16 ui16_ExtractShortAddress(uint8 ui8_address, uint8 ui8_ext_address);
extern void PrintDaliMessage(DaliMessageStruct* p_s_message);
extern void PrintTimestamp(TimestampStruct p_s_Time);
extern void PrintTemperatureInCelsius(void);
extern void Print_Config(void);

#endif
(8-8/10)