/****************************************************************************/
/* Copyright 2004 MBARI.                                                    */
/* Monterey Bay Aquarium Research Institute Proprietary Information.        */
/* All rights reserved.                                                     */
/****************************************************************************/
#ifndef FREQ_GEN_H
#define FREQ_GEN_H

#define FREQ_GEN_VERSION 0
#define FREQ_GEN_SUB_VERSION 30

/*
    The ticks per second is based on an 8-bit counter over flowing that
    is driven by a 4 Mhz ocsillator prescaled by 4 and postscaled by 64.

    TICKS_PER_SEC = (OSC_CLK) / (PRESCALE) / (POSTSCALE) / (8_BIT_OVERFLOW)
                  = 3580000   /     4      /      64     /      256
                  = 54.626
*/
#define TICKS_PER_SEC           55
#define FREQ_DURATION           TICKS_PER_SEC

#define PORTC_CLEAR_ALL         0b00000000

#define PORTB_LED_ON            0b00000010
#define PORTB_LED_OFF           0b00000000

#define PORTC_CURRENT_ON        0b00001100
#define PORTC_CURRENT_OFF       0b00000100

#define PORTC_1000HZ_FREQ_UP    0b00000001
#define PORTC_1000HZ_FREQ       0b00000000
#define PORTC_1000HZ_FREQ_DN    0b00000010

#define PORTC_316HZ_FREQ_UP     0b00100001
#define PORTC_316HZ_FREQ        0b00100000
#define PORTC_316HZ_FREQ_DN     0b00100010

#define PORTC_100HZ_FREQ_UP     0b00110001
#define PORTC_100HZ_FREQ        0b00110000
#define PORTC_100HZ_FREQ_DN     0b00110010

#define PORTC_DRAIN_CAPS        0b00110000

#endif
