fg004_a1/TriacOut.c

57 lines
1.0 KiB
C
Raw Normal View History

/*
* Author: username
* Date: todays_date
* filename: TriacOut.c
* description: module_purpose
*/
#ifndef __AVR_ATtiny404__
#define __AVR_ATtiny404__
#endif
#include <avr/io.h>
#include "TriacOut.h"
#include "RegEdit.h"
void Delay_MicroSeconds_impl(double us){
return;
}
//Delay_MicroSeconds =
//void (*Delay_MicroSeconds)(double us) = Delay_MicroSeconds_impl;
void (*Delay_MicroSecnds)(double us) = Delay_MicroSeconds_impl;
void TriacOut_InitTimerA(void)
{
}
void TriacOut_SetupPins(void)
{
RegEdit_SetBit((void *) &PORTA.DIR, G1);
RegEdit_SetBit((void *) &PORTB.DIR, G2);
RegEdit_SetBit((void *) &PORTB.DIR, G3);
}
void TriacOut_SetAllHigh(void)
{
RegEdit_SetBit((void *) &PORTA.OUT, G1);
RegEdit_SetBit((void *) &PORTB.OUT, G2);
RegEdit_SetBit((void *) &PORTB.OUT, G3);
}
void TriacOut_PulsePins(uint16_t pulse_time)
{
Delay_MicroSeconds(pulse_time);
RegEdit_ClearBit((void *) &PORTA.OUT, G1);
RegEdit_ClearBit((void *) &PORTB.OUT, G2);
RegEdit_ClearBit((void *) &PORTB.OUT, G3);
}