Projet

Général

Profil

Feature #12061 » CGline.h

Anonyme, 04/01/2020 22:37

 
#include "stdbool.h"

#ifndef CGLINE_H
#define CGLINE_H

//Physical values

#define OUT_VALUE_0 DALI_TX_PIN //Send value must be logically inverted//L'envoi de la valeur doit ?tre invers? logiquement
#define OUT_VALUE_1 0x00

//Logical Values
#define CGL1_REC_ACTIVE 0x01 // True if reception has started
#define CGL2_REC_ACTIVE 0x02 // True if reception has started
#define CGL1_REC_ANSWER_ACTIVE 0x04 // True if transfer has started
#define CGL2_REC_ANSWER_ACTIVE 0x08 // True if transfer has started
#define CGL1_WAIT_ANSWER_ACTIVE 0x10 // True if Command was send and Waiting for Answer start-bit
#define CGL2_WAIT_ANSWER_ACTIVE 0x20 // True if Command was send and Waiting for Answer start-bit
#define CGL1_WAIT_END 0x1000
#define CGL2_WAIT_END 0x2000

#define CCB1_REC_ACTIVE 0x40 // True if reception has started
#define CCB2_REC_ACTIVE 0x80 // True if reception has started
#define CCB1_WAIT_ANSWER_ACTIVE 0x100
#define CCB2_WAIT_ANSWER_ACTIVE 0x200

#define CCB1_CHECKSUM_RECEIVED 0x400
#define CCB2_CHECKSUM_RECEIVED 0x800

#define CGL1_Start_RX 0x01 // True if RX prcess is able to start
#define CGL2_Start_RX 0x02 // True if RX prcess is able to start

//Events
#define IN_NEW_DATA 0x0001 // Set when new data has arrived
#define IN_SEND_ANSWER 0x0002 // Set when an answer is to be sent
#define IN_SIGNAL_ERROR 0x0004 // Set when the DALI signal level has been low for more than 500 ms


#define OUT_NEW_DATA 0x10 // Set when new data has arrived
#define OUT_SEND_DATA 0x20 // Set when an instruction is to be sent
#define OUT_ERROR_EVENT 0x40 // Set when the DALI signal level has been low for more than 500 ms
#define OUT_ANSWER_EVENT 0x80 //
#define OUT_ANSWER_DETECTED 0x08 // Set if the device has answered
#define OUT_BUS_QUALETY_OK 0x04 // Set if the bus qualety is IO

#define DEFAULT_NR_LINES 4
#define DEFAULT_MAX_LAMPS 200 //Set max amount of lamps per line
#define DEFAULT_MAX_ZONE 4
#define SCAN_REPETITION_10MIN 60
#define MAX_100_LUMS_LINE 200

void ReceiveDaliMessage();
void RX_Interrupt_Handler(uint8 ui8_Line);

#endif
(1-1/10)