#include #include #include #include #include #include #include #include //#include //#include //#include //#include /* D4 PD4: Set input relay 5 output */ void relaytx_init(void) { REG_SETUP_BIT(DDRD, PD4); } void relaytx_on(void) { REG_SETUP_BIT(PORTD, PD4); } void relaytx_off(void) { REG_SETDOWN_BIT(PORTD, PD4); } void relaytx_onoff(void) { if (REG_BIT_VALUE(PIND, PD4)) { relaytx_off(); } else { relaytx_on(); } } /* D6 PD6: Set 10M relay 1 output */ void relay10m_init(void) { REG_SETUP_BIT(DDRD, PD6); } void relay10m_on(void) { REG_SETUP_BIT(PORTD, PD6); } void relay10m_off(void) { REG_SETDOWN_BIT(PORTD, PD6); } /* D7 PD7: Set 20M relay 2 output */ void relay20m_init(void) { REG_SETUP_BIT(DDRD, PD7); } void relay20m_on(void) { REG_SETUP_BIT(PORTD, PD7); } void relay20m_off(void) { REG_SETDOWN_BIT(PORTD, PD7); } /* D8 PB0: Set 40M relay 3 output */ void relay40m_init(void) { REG_SETUP_BIT(DDRB, PB0); } void relay40m_on(void) { REG_SETUP_BIT(PORTB, PB0); } void relay40m_off(void) { REG_SETDOWN_BIT(PORTB, PB0); } /* D9 PB1: Set 80M relay 4 output */ void relay80m_init(void) { REG_SETUP_BIT(DDRB, PB1); } void relay80m_on(void) { REG_SETUP_BIT(PORTB, PB1); } void relay80m_off(void) { REG_SETDOWN_BIT(PORTB, PB1); } /* D10 PB2: Set buzzer output */ void buzzer_init(void) { REG_SETUP_BIT(DDRB, PB2); } void buzzer_on(void) { REG_SETUP_BIT(PORTB, PB2); } void buzzer_off(void) { REG_SETDOWN_BIT(PORTB, PB2); } void buzzer_onoff(void) { if (REG_BIT_VALUE(PINB, PB2)) { buzzer_off(); } else { buzzer_on(); } } /* D12 PB4: Set fan output */ void fan_init(void) { REG_SETUP_BIT(DDRB, PB4); } void fan_on(void) { REG_SETUP_BIT(PORTB, PB4); } void fan_off(void) { REG_SETDOWN_BIT(PORTB, PB4); } void fan_onoff(void) { if (REG_BIT_VALUE(PINB, PB4)) { fan_off(); } else { fan_on(); } } bool fan_is_on(void) { if (REG_BIT_VALUE(PINB, PB4)) { return true; } return false; } /* D13 PB5: Set attenuator relay output */ void atten_init(void) { REG_SETUP_BIT(DDRB, PB5); } void atten_on(void) { REG_SETUP_BIT(PORTB, PB5); } void atten_off(void) { REG_SETDOWN_BIT(PORTB, PB5); }