Subversion Repositories idreammicro-avr

Rev

Rev 3 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 jlesech 1
/**************************************************************************//**
2
 * \file helloworld.c
3
 ******************************************************************************/
4
 
5
/******************************************************************************
6
 * Header file inclusions.
7
 ******************************************************************************/
8
 
9
#include <digital_io/digital_io.h>
10
 
11
#include <avr/io.h>
12
#include <util/delay.h>
13
 
14
/******************************************************************************
15
 * Public function definitions.
16
 ******************************************************************************/
17
 
18
/**************************************************************************//**
19
 * \fn int main(void)
20
 *
21
 * \brief Main function.
22
 ******************************************************************************/
23
int
24
main
25
(
26
    void
27
){
28
    // Declare pin.
29
    digital_io__pin_position_t pin = DIGITAL_IO__PORT_B | DIGITAL_IO__PIN_5;
30
 
31
    // Configure pin as output.
32
    digital_io__configure_pin(pin, DIGITAL_IO__DIRECTION__OUTPUT);
33
 
24 jlesech 34
    for (;;)
2 jlesech 35
    {
36
        // Set pin level.
37
        digital_io__set_pin_level(pin, DIGITAL_IO__LEVEL__HIGH);
38
        _delay_ms(1000);
39
 
40
        // Reset pin level.
41
        digital_io__set_pin_level(pin, DIGITAL_IO__LEVEL__LOW);
42
        _delay_ms(1000);
43
    }
44
 
45
    return 0;
46
}