#include <stdint.h>
#include <stdbool.h>
typedef enum { sleepMode_idle = 0,
sleepMode_adc = 1,
sleepMode_pwrDown = 2,
sleepMode_pwrSave = 3,
sleepMode_standby = 6,
sleepMode_extStandby = 7 } sleepMode;
typedef enum { resetFlag_wd = 4,
resetFlag_bo = 3,
resetFlag_ext = 2,
resetFlag_po = 1 } resetFlag;
typedef enum { lowLevel = 0,
accueringFront = 2,
fallingDownFront = 3 } intTerm;
typedef enum { ioPortB = 0x18,
ioPortC = 0x15,
ioPortD = 0x12 } ioPort;
typedef enum { ioPin0 = 0,
ioPin1 = 1,
ioPin2 = 2,
ioPin3 = 3,
ioPin4 = 4,
ioPin5 = 5,
ioPin6 = 6,
ioPin7 = 7} ioPin;
typedef enum { prescTimer_clk = 1,
prescTimer_8 = 2,
prescTimer_64 = 3,
prescTimer_256 = 4,
prescTimer_1024 = 5 } prescTimer;
typedef enum { outputTimer1_A = 6,
outputTimer1_B = 4 } outputTimer1;
typedef enum { outputTimer1_disable = 0,
outputTimer1_invert = 1,
outputTimer1_down = 2,
outputTimer1_up = 3 } outputCompareModeTimer1;
typedef enum { modeTimer1_normal = 0,
modeTimer1_pwm8 = 1,
modeTimer1_pwm9 = 2,
modeTimer1_pwm10 = 3,
modeTimer1_ctc = 4,
modeTimer1_fpwm8 = 5,
modeTimer1_fpwm9 = 6,
modeTimer1_fpwm10 = 7 } modeTimer1;
typedef enum { intTimer1_overflow = 3,
intTimer1_compareA = 4,
intTimer1_compareB = 5,
intTimer1_interception = 6 } intTimer1;
typedef enum { wdtTime_16ms = 0,
wdtTime_33ms = 1,
wdtTime_65ms = 2,
wdtTime_130ms = 3,
wdtTime_260ms = 4,
wdtTime_520ms = 5,
wdtTime_1000ms = 6,
wdtTime_2100ms = 7 } wdtTime;
typedef enum { adcReference_aref = 0,
adcReference_avcc = 1,
adcReference_internal = 3 } adcReference;
typedef enum { adcChannel_0 = 0,
adcChannel_1 = 1,
adcChannel_2 = 2,
adcChannel_3 = 3,
adcChannel_4 = 4,
adcChannel_5 = 5,
adcChannel_6 = 6,
adcChannel_7 = 7 } adcChannel;
typedef enum { adcPresc_2 = 1,
adcPresc_4 = 2,
adcPresc_8 = 3,
adcPresc_16 = 4,
adcPresc_32 = 5,
adcPresc_64 = 6,
adcPresc_128 = 7 } adcPresc;
typedef enum { usartError_fe = -1,
usartError_ovf = -2,
usartError_pe = -4} usartError;
void chip_eeprom_write( uint16_t address, uint8_t data );
uint8_t chip_eeprom_read( uint16_t address );
void chip_set_sleep_mode( sleepMode mode );
void chip_sleep_enable( void );
void chip_sleep_disable( void );
void chip_sleep( void );
resetFlag chip_get_reset_flag( void );
void chip_int0_enable( intTerm term );
void chip_int1_enable( intTerm term );
void chip_int0_disable( void );
void chip_int1_disable( void );
void chip_set_input( ioPort port, ioPin pin, bool pullup );
void chip_set_output( ioPort port, ioPin pin, bool value );
void chip_invert_pin_value( ioPort port, ioPin pin );
void chip_set_pin_value( ioPort port, ioPin pin, bool value );
bool chip_get_pin_value( ioPort port, ioPin pin );
void chip_timer0_enable( prescTimer presc );
void chip_timer0_disable( void );
void chip_timer0_interrupt_enable( void );
void chip_timer0_interrupt_disable( void );
void chip_timer0_set_tcnt( uint8_t tcnt );
void chip_timer1_enable( prescTimer presc, modeTimer1 mode, bool supression_block, bool active_front );
void chip_timer1_set_compare_block( outputTimer1 output, outputCompareModeTimer1 mode );
void chip_timer1_interrupt_enable( intTimer1 ie );
void chip_timer1_interrupt_disable( intTimer1 ie );
void chip_timer1_interrupt_disable_all( void );
void chip_timer1_set_tcnt( uint16_t tcnt );
void chip_timer1_set_ocrA( uint16_t ocr );
void chip_timer1_set_ocrB( uint16_t ocr );
void chip_timer1_set_icr( uint16_t icr );
void chip_wdt_enable( wdtTime time );
void chip_wdt_disable( void );
void chip_adc_enable( adcPresc presc, bool interrupt_enable, bool single_mode );
void chip_adc_disable( void );
void chip_adc_set_channel( adcChannel channel, adcReference ref );
void chip_adc_start( void );
uint16_t chip_adc_process( void );
usartError chip_usart0_get_error( void );
void chip_usart0_enable( uint32_t baudrate, uint32_t f_cpu );
void chip_usart0_rx_int_enable( void );
void chip_usart0_rx_int_disable( void );
void chip_usart0_tx_int_enable( void );
void chip_usart0_tx_int_disable( void );
void chip_usart0_transmit( uint8_t data );
uint8_t chip_usart0_receive( void );