71 lines
974 B
C
71 lines
974 B
C
|
#pragma once
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
#include <util/list.h>
|
||
|
#include <sys/systick.h>
|
||
|
|
||
|
#include <io/usart.h>
|
||
|
|
||
|
|
||
|
/***********************************
|
||
|
rb2/link.h
|
||
|
|
||
|
RegisteredBus2 Interface Definitions
|
||
|
|
||
|
Paketorientierte Kommunikation via Serielle Verbindungen mit Adressierung
|
||
|
|
||
|
***********************************/
|
||
|
|
||
|
struct _rb2_link
|
||
|
{
|
||
|
list_t list;
|
||
|
|
||
|
uint8_t ring:1;
|
||
|
uint8_t identrx:2;
|
||
|
|
||
|
uint16_t axmask;
|
||
|
uint16_t idmask;
|
||
|
|
||
|
avrWAIT timeoutIdent;
|
||
|
void *ptr;
|
||
|
|
||
|
rb2_telegram_buffer_t *
|
||
|
(*receive) (RB2_LINK *link);
|
||
|
uint8_t (*send) (RB2_LINK *link,rb2_telegram_buffer_t *telegram);
|
||
|
};
|
||
|
|
||
|
struct _rb2_listed_link {
|
||
|
list_t list;
|
||
|
RB2_LINK *link;
|
||
|
};
|
||
|
|
||
|
struct rb2_stream_link {
|
||
|
RB2_LINK link;
|
||
|
FILE *stream;
|
||
|
list_t
|
||
|
txqueue;
|
||
|
|
||
|
uint8_t rxptr;
|
||
|
rb2_telegram_buffer_t *telegram;
|
||
|
};
|
||
|
|
||
|
struct rb2_usart_link {
|
||
|
RB2_LINK link;
|
||
|
|
||
|
uint8_t usart;
|
||
|
|
||
|
rb2_telegram_buffer_t *rx,
|
||
|
*tx;
|
||
|
|
||
|
int rxptr;
|
||
|
|
||
|
list_t received;
|
||
|
list_t send;
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
|