- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

# at90usb162_quickstart_drv.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | Enable_external_clock() (CKSEL0 |= (1<<EXTE))
#define | Disable_external_clock() (CKSEL0 &= ~(1<<EXTE))
#define | Enable_RC_clock() (CKSEL0 |= (1<<RCE))
#define | Disable_RC_clock() (CKSEL0 &= ~(1<<RCE))
#define | External_clock_ready() (((CKSTA&(1<<EXTON)) != 0) ? TRUE : FALSE)
#define | RC_clock_ready() (((CKSTA&(1<<RCON)) != 0) ? TRUE : FALSE)
#define | Select_external_clock() (CKSEL0 |= (1<<CLKS))
#define | Select_RC_clock() (CKSEL0 &= ~(1<<CLKS))
#define | Load_ext_clock_config(cfg) (CKSEL1 &= ~0x0F, CKSEL1 |= (cfg&0x0F))
#define | Load_RC_clock_config(cfg) (CKSEL1 &= ~0xF0, CKSEL1 |= (cfg&0xF0))
#define | EXTCLK_8MHZ_AND_MORE 0x0F
#define | INTRC_8MHZ 0x20
#define | Clock_switch_external()
#define | Clock_switch_internal()
#define | Usart_spi_hard_init() (PORTD |= 0x2C, DDRD |= 0x28, DDRD &= ~0x04)
#define | Usart_hard_init_without_ctrl() (PORTD |= 0x0C, DDRD |= 0x08, DDRD &= ~0x04)
#define | Usart_hard_init_with_ctrl() (PORTD |= 0xCC, DDRD |= 0x48, DDRD &= ~0x84)
#define | Usart_spi_soft_init()
#define | Usart_soft_init_with_ctrl()
#define | Usart_soft_init_without_ctrl()
#define | Usart_write_byte(dt) (UDR1 = dt)
#define | Usart_read_byte() (UDR1)
#define | Is_usart_byte_sent() (((UCSR1A&(1<<TXC1)) != 0) ? TRUE : FALSE)
#define | Usart_clear_flag_send() (UCSR1A |= (1<<TXC1))
#define | Is_usart_byte_received() (((UCSR1A&(1<<RXC1)) != 0) ? TRUE : FALSE)
#define | Usart_clear_flag_receive() (UCSR1A |= (1<<RXC1))
#define | Is_usart_data_reg_empty() (((UCSR1A&(1<<UDRE1)) != 0) ? TRUE : FALSE)
#define | USE_TIMER16 TIMER16_1
#define | Delay_config_ms(ms)
#define | Delay_config_us(us)
#define | Delay_reset() (Timer16_set_counter(0x0000), Timer16_clear_compare_a_it())
#define | Is_delay_end() (Timer16_get_compare_a_it())
#define | Is_not_delay_end() (!(Timer16_get_compare_a_it()))
#define | Bp_delay_debounce() { Delay_config_ms(20); Delay_reset(); while (Is_not_delay_end());}

## Define Documentation

#define Enable_external_clock | ( |  | ) | (CKSEL0 |= (1<<EXTE))

Definition at line 8 of file at90usb162_quickstart_drv.h.

#define Disable_external_clock | ( |  | ) | (CKSEL0 &= ~(1<<EXTE))

Definition at line 9 of file at90usb162_quickstart_drv.h.

#define Enable_RC_clock | ( |  | ) | (CKSEL0 |= (1<<RCE))

Definition at line 10 of file at90usb162_quickstart_drv.h.

#define Disable_RC_clock | ( |  | ) | (CKSEL0 &= ~(1<<RCE))

Definition at line 11 of file at90usb162_quickstart_drv.h.

#define External_clock_ready | ( |  | ) | (((CKSTA&(1<<EXTON)) != 0) ? TRUE : FALSE)

Definition at line 12 of file at90usb162_quickstart_drv.h.

#define RC_clock_ready | ( |  | ) | (((CKSTA&(1<<RCON)) != 0) ? TRUE : FALSE)

Definition at line 13 of file at90usb162_quickstart_drv.h.

#define Select_external_clock | ( |  | ) | (CKSEL0 |= (1<<CLKS))

Definition at line 14 of file at90usb162_quickstart_drv.h.

#define Select_RC_clock | ( |  | ) | (CKSEL0 &= ~(1<<CLKS))

Definition at line 15 of file at90usb162_quickstart_drv.h.

#define Load_ext_clock_config | ( | cfg |  | ) | (CKSEL1 &= ~0x0F, CKSEL1 |= (cfg&0x0F))

Definition at line 18 of file at90usb162_quickstart_drv.h.

#define Load_RC_clock_config | ( | cfg |  | ) | (CKSEL1 &= ~0xF0, CKSEL1 |= (cfg&0xF0))

Definition at line 19 of file at90usb162_quickstart_drv.h.

#define EXTCLK_8MHZ_AND_MORE 0x0F

Definition at line 21 of file at90usb162_quickstart_drv.h.

#define INTRC_8MHZ 0x20

Definition at line 22 of file at90usb162_quickstart_drv.h.

#define Clock_switch_external | ( |  | ) |

Value:

    { Enable_external_clock(); while (!External_clock_ready()); \
                                              Select_external_clock(); Disable_RC_clock(); }

Definition at line 25 of file at90usb162_quickstart_drv.h.

#define Clock_switch_internal | ( |  | ) |

Value:

    { Enable_RC_clock(); while (!RC_clock_ready()); \
                                              Select_RC_clock(); Disable_external_clock(); }

Definition at line 27 of file at90usb162_quickstart_drv.h.

#define Usart_spi_hard_init | ( |  | ) | (PORTD |= 0x2C, DDRD |= 0x28, DDRD &= ~0x04)

Definition at line 35 of file at90usb162_quickstart_drv.h.

#define Usart_hard_init_without_ctrl | ( |  | ) | (PORTD |= 0x0C, DDRD |= 0x08, DDRD &= ~0x04)

Definition at line 36 of file at90usb162_quickstart_drv.h.

#define Usart_hard_init_with_ctrl | ( |  | ) | (PORTD |= 0xCC, DDRD |= 0x48, DDRD &= ~0x84)

Definition at line 37 of file at90usb162_quickstart_drv.h.

#define Usart_spi_soft_init | ( |  | ) |

Value:

    (UBRR1  = 0, \
                                              UCSR1C = (1<<7)|(1<<6)|(1<<1)|(1<<0), \
                                              UCSR1B = (1<<3)|(1<<4), \
                                              UBRR1 = 4)

Definition at line 40 of file at90usb162_quickstart_drv.h.

#define Usart_soft_init_with_ctrl | ( |  | ) |

Value:

    (UBRR1 = 0, \
                                              UCSR1C = (1<<UCSZ11) | (1<<UCSZ10), \
                                              UCSR1D = (1<<CTSEN) | (1<<RTSEN), \
                                              UCSR1B = (1<<RXEN1) | (1<<TXEN1), \
                                              UBRR1 = 9)

Definition at line 44 of file at90usb162_quickstart_drv.h.

#define Usart_soft_init_without_ctrl | ( |  | ) |

Value:

    (UBRR1 = 0, \
                                              UCSR1C = (1<<UCSZ11) | (1<<UCSZ10), \
                                              UCSR1D &= ~((1<<CTSEN) | (1<<RTSEN)), \
                                              UCSR1B = (1<<RXEN1) | (1<<TXEN1), \
                                              UBRR1 = 4)

Definition at line 51 of file at90usb162_quickstart_drv.h.

#define Usart_write_byte | ( | dt |  | ) | (UDR1 = dt)

Definition at line 57 of file at90usb162_quickstart_drv.h.

#define Usart_read_byte | ( |  | ) | (UDR1)

Definition at line 58 of file at90usb162_quickstart_drv.h.

#define Is_usart_byte_sent | ( |  | ) | (((UCSR1A&(1<<TXC1)) != 0) ? TRUE : FALSE)

Definition at line 59 of file at90usb162_quickstart_drv.h.

#define Usart_clear_flag_send | ( |  | ) | (UCSR1A |= (1<<TXC1))

Definition at line 60 of file at90usb162_quickstart_drv.h.

#define Is_usart_byte_received | ( |  | ) | (((UCSR1A&(1<<RXC1)) != 0) ? TRUE : FALSE)

Definition at line 61 of file at90usb162_quickstart_drv.h.

#define Usart_clear_flag_receive | ( |  | ) | (UCSR1A |= (1<<RXC1))

Definition at line 62 of file at90usb162_quickstart_drv.h.

#define Is_usart_data_reg_empty | ( |  | ) | (((UCSR1A&(1<<UDRE1)) != 0) ? TRUE : FALSE)

Definition at line 63 of file at90usb162_quickstart_drv.h.

#define USE_TIMER16 TIMER16_1

Definition at line 67 of file at90usb162_quickstart_drv.h.

#define Delay_config_ms | ( | ms |  | ) |

Value:

    (Timer16_set_clock(TIMER16_CLKIO_BY_256), \
                                      Timer16_set_mode_output_a(TIMER16_COMP_MODE_NORMAL), \
                                      Timer16_set_waveform_mode(TIMER16_WGM_CTC_OCR), \
                                      Timer16_set_compare_a((U16)(31)*(U16)(ms)))

Definition at line 71 of file at90usb162_quickstart_drv.h.

#define Delay_config_us | ( | us |  | ) |

Value:

    (Timer16_set_clock(TIMER16_CLKIO_BY_8), \
                                      Timer16_set_mode_output_a(TIMER16_COMP_MODE_NORMAL), \
                                      Timer16_set_waveform_mode(TIMER16_WGM_CTC_OCR), \
                                      Timer16_set_compare_a((U16)(us)))

Definition at line 75 of file at90usb162_quickstart_drv.h.

#define Delay_reset | ( |  | ) | (Timer16_set_counter(0x0000), Timer16_clear_compare_a_it())

Definition at line 80 of file at90usb162_quickstart_drv.h.

#define Is_delay_end | ( |  | ) | (Timer16_get_compare_a_it())

Definition at line 81 of file at90usb162_quickstart_drv.h.

#define Is_not_delay_end | ( |  | ) | (!(Timer16_get_compare_a_it()))

Definition at line 82 of file at90usb162_quickstart_drv.h.

#define Bp_delay_debounce | ( |  | ) | { Delay_config_ms(20); Delay_reset(); while (Is_not_delay_end());}

Definition at line 87 of file at90usb162_quickstart_drv.h.