00001
00008 #ifndef TEMU_MIL_STD_1553_H
00009 #define TEMU_MIL_STD_1553_H
00010
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014
00015 #include "temu-c/Support/Objsys.h"
00016
00017 #include <assert.h>
00018 #include <stdbool.h>
00019 #include <stdint.h>
00020
00021 typedef enum temu_Mil1553Error {
00022 teME_NoError = 0,
00023 teME_ParityError = 1,
00024 teME_SyncError = 1 << 1
00025 } temu_Mil1553Error;
00026
00027 typedef enum temu_Mil1553MsgType {
00028 teMT_BcToRt,
00029 teMT_RtToBc,
00030 teMT_RtToRtCmd,
00031 teMT_ModeCode
00032 } temu_Mil1553MsgType;
00033
00034
00035 typedef struct temu_Mil1553Msg {
00036 temu_Mil1553MsgType MsgTyp;
00037 struct {
00038 uint16_t Rt:5;
00039 uint16_t TR:1;
00040 uint16_t SaMode:5;
00041 uint16_t CountModeCode:5;
00042 } Cmd;
00043 uint16_t *Data;
00044 } temu_Mil1553Msg;
00045
00046 typedef struct temu_Mil1553DevIface {
00047 void (*send)(void *Device, temu_Mil1553Msg *Msg);
00048 } temu_Mil1553DevIface;
00049
00050 OBJSYS_OBJ_TYPE(temu_Mil1553Dev);
00051
00052
00053 typedef struct temu_Mil1553BusIface {
00054 void (*connect)(void *Bus, int Subaddr, temu_Mil1553DevObj Device);
00055 void (*send)(void *Bus, void *Sender, temu_Mil1553Msg *Msg);
00056 } temu_Mil1553BusIface;
00057
00058 OBJSYS_OBJ_TYPE(temu_Mil1553Bus);
00059
00060
00061 #ifdef __cplusplus
00062 }
00063 #endif
00064
00065
00066 #endif