94 lines
1.8 KiB
C
94 lines
1.8 KiB
C
|
/**
|
||
|
* @file config.h
|
||
|
* @author Jake G
|
||
|
* @date 15 June 2024
|
||
|
* @brief File contains the project configuration values
|
||
|
*
|
||
|
* This file contains the user changable parameters. Most the values are
|
||
|
* constants that will change the behavior of the system.
|
||
|
*
|
||
|
* For these changes to take affect you must recompile/rebuild the project
|
||
|
* after you have changed the values.
|
||
|
*/
|
||
|
|
||
|
#ifndef CONFIG_H
|
||
|
#define CONFIG_H
|
||
|
|
||
|
|
||
|
//#define __AVR_ATtiny404__
|
||
|
|
||
|
#include <stdint.h>
|
||
|
//#include <avr/io.h>
|
||
|
|
||
|
//#define ZC_PORT_DIR &PORTA.DIR
|
||
|
|
||
|
//*ZCP_DIR = &PORTA.DIR;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @brief Result type for the returned values from functions
|
||
|
*
|
||
|
*/
|
||
|
typedef enum ResultEnum{
|
||
|
OK,
|
||
|
Err
|
||
|
}ResultEnum;
|
||
|
|
||
|
/**
|
||
|
* @brief The type for Triac gate duration(micro seconds)
|
||
|
*
|
||
|
*/
|
||
|
typedef uint16_t DurationUs_t;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @brief Positive Zero Crossing Trigger Value
|
||
|
* The 10 bit value at which the program triggers the ISR to handle
|
||
|
* the zero crossing event.
|
||
|
*
|
||
|
* You can adjust this to change when the program will start the timer.
|
||
|
*/
|
||
|
const uint16_t TriggerValue = 512;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @brief Triac Gate Pulse Quantity
|
||
|
*
|
||
|
* Contains the number of pulses that the micro-controller will send to the
|
||
|
* gates of the triac.
|
||
|
*
|
||
|
* This number should match the quantity of timings inside the pulse/duration
|
||
|
* array.
|
||
|
*/
|
||
|
const int GatePulsesQty = 5;
|
||
|
|
||
|
/**
|
||
|
* @brief Gate Pulses Array
|
||
|
*
|
||
|
* The gate pulses array holds the duration of pulses in microseconds for the
|
||
|
* triacs gates. The length of the array must be matched with the
|
||
|
* GatePulsesQuantity parameter.
|
||
|
*/
|
||
|
const uint16_t GatePulses[5] = {250, 500, 750, 1000, 1250};
|
||
|
|
||
|
/**
|
||
|
* @brief Low Threshold
|
||
|
*
|
||
|
*/
|
||
|
const uint16_t LowThresh = 527;
|
||
|
|
||
|
/**
|
||
|
* @brief High Threshold
|
||
|
*
|
||
|
*/
|
||
|
const uint16_t HighThresh = 1000;
|
||
|
|
||
|
/**
|
||
|
* @brief The time constant.
|
||
|
*/
|
||
|
const double Tau = 8250;
|
||
|
|
||
|
|
||
|
|
||
|
#endif //CONFIG_H
|