Last update: 19.08.2006 | © 2024 Julian von Mendel | Datenschutz
/* (C) 2006 Julian von Mendel */
#include <avr/io.h>
#include "config.h"
/* GENERAL */
extern inline void pause (uint16_t ms );
/* IOs */
extern uint8_t io_info(uint8_t ionr, uint8_t var);
extern void io_set_(volatile uint8_t *ddr, volatile uint8_t *port, uint8_t pinnr, uint8_t status);
extern void io_set (uint8_t ionr, uint8_t status);
extern inline uint8_t io_get_(volatile uint8_t *pin, uint8_t pinnr);
extern uint8_t io_get (uint8_t ionr);
/* ADC */
extern uint16_t adc (uint8_t ionr );
/* UART */
#define UART_UBRR_CALC(BAUD_,FREQ_) ((FREQ_)/((BAUD_)*16L)-1)
extern inline void uart_init(uint8_t tx, uint8_t rx );
extern void uart_putc(uint8_t c );
extern void uart_puti(uint16_t data );
extern void uart_putf(float data );
extern void uart_puts(uint8_t *data );
#ifdef UART_BUFFER
extern uint8_t uart_getc(void );
#endif
/* SERVOS */
#ifdef SERVOS
#define MAXPULSFREQ 500 // 2ms => 500HZ
#define TIMER_MAXPULS F_CPU/MAXPULSFREQ // Timer1 value for a 2ms Puls
#define MINPULS TIMER_MAXPULS/2 // min pulslength = 1ms
#define MAXPULS TIMER_MAXPULS // max pulslength=2ms
extern inline void servo_init(void );
extern void servo_set (uint8_t ionr, uint8_t value);
#endif
© 2009 Julian von Mendel (http://derjulian.net) | Datum: 07.12.2024