Welcome to the EyeBot  Version 7 - RPi1
A Controller For Various Hardware IO
hdt.h
Go to the documentation of this file.
1 
7 #ifndef HDT_H_
8 #define HDT_H_
9 
10 #include "types.h"
11 #include <stdio.h> /* FILE */
12 #include <stdlib.h> /* malloc() */
13 #include <string.h> /* strstr() */
14 
15 #define HDT_IDX_TABLE 0
16 #define HDT_IDX_PSD 1
17 #define HDT_IDX_SERVO 2
18 #define HDT_IDX_MOTOR 3
19 #define HDT_IDX_ENCODER 4
20 #define HDT_IDX_DRIVE 5
21 #define HDT_IDX_COMPASS 6
22 #define HDT_IDX_IRTV 7
23 #define HDT_IDX_CAM 8
24 #define HDT_IDX_ADC 9
25 #define HDT_IDX_COM 10
26 #define HDT_MAX_COUNT 11
27 
28 #define DIFFERENTIAL_DRIVE 0
29 #define ACKERMAN_DRIVE 1
30 #define ACKERMANN_DRIVE 1
31 #define SYNCHRO_DRIVE 2
32 #define TRICYCLE_DRIVE 3
33 #define OMNI_DRIVE 4
34 
35 #define HDT_DIFF_STR "DIFFERENTIAL"
36 #define HDT_ACKM_STR "ACKERMANN"
37 #define HDT_OMNI_STR "OMNI"
38 
39 int HDTValidate(char *filename);
40 int HDTListEntry(char *filename, HDT_ENTRY *deventry, int count);
41 int HDTFindEntry(void *hdtfile, char *devname, HDT_ENTRY *deventry);
42 int HDTFindTable(void *hdtfile, char *tabname, HDT_TABLE *tabentry);
43 HDT_TABLE* HDTLoadTable(char *filename, HDT_DEVICE *pdevices);
44 int HDTClearTable(HDT_TABLE *ptables);
45 HDT_CAM* HDTLoadCAM(char *filename, char *devname);
46 int HDTClearCAM(HDT_CAM *pdevs);
47 HDT_MOTOR* HDTLoadMOTOR(char *filename, char *devname);
48 int HDTClearMOTOR(HDT_MOTOR *pdevs);
49 HDT_ENCODER* HDTLoadENCODER(char *filename, char *devname);
50 int HDTClearENCODER(HDT_ENCODER *pdevs);
51 int HDTLinkENC2MOT(HDT_ENCODER *pencoders, HDT_MOTOR *pmotors);
52 HDT_PSD* HDTLoadPSD(char *filename, char *devname);
53 int HDTClearPSD(HDT_PSD *pdevs);
54 HDT_SERVO* HDTLoadSERVO(char *filename, char *devname);
55 int HDTClearSERVO(HDT_SERVO *pdevs);
56 HDT_DRIVE* HDTLoadDRIVE(char *filename, char *devname);
57 int HDTClearDRIVE(HDT_DRIVE *pdevs);
58 int HDTLinkDRV2ENC(HDT_DRIVE *pdrives, HDT_ENCODER *pencoders);
59 HDT_IRTV* HDTLoadIRTV(char *filename, char *devname);
60 int HDTClearIRTV(HDT_IRTV *pdevs);
61 HDT_ADC* HDTLoadADC(char *filename, char *devname);
62 int HDTClearADC(HDT_ADC *pdevs);
63 HDT_COM* HDTLoadCOM(char *filename, char *devname);
64 int HDTClearCOM(HDT_COM *pdevs);
65 
66 #endif /* HDT_H_ */
int HDTClearCAM(HDT_CAM *pdevs)
Free the allocated resources for the created by HDTLoad.
Definition: hdt.c:467
HDT_SERVO * HDTLoadSERVO(char *filename, char *devname)
load all entry found in the hdt file if devname is null. else, load only the requested devic...
Definition: hdt.c:873
Structure defining a HDT drive.
Definition: types.h:386
HDT_ADC * HDTLoadADC(char *filename, char *devname)
load all entry found in the hdt file if devname is null. else, load only the requested devic...
Definition: hdt.c:1560
Defines types used for the EyeBot 7.
int HDTListEntry(char *filename, HDT_ENTRY *deventry, int count)
Copy all entries to deventry. user need to free the allocated memory by using free(deventry->buffer)...
Definition: hdt.c:113
Structure defining a HDT Device.
Definition: types.h:308
int HDTFindTable(void *hdtfile, char *tabname, HDT_TABLE *tabentry)
finds a table in the hdt file that matches given name and copies the table data to given structure...
Definition: hdt.c:199
int HDTLinkDRV2ENC(HDT_DRIVE *pdrives, HDT_ENCODER *pencoders)
Link the drives to the encoders.
Definition: hdt.c:1290
int HDTClearIRTV(HDT_IRTV *pdevs)
Free the allocated resources for the created by HDTLoad.
Definition: hdt.c:1537
int HDTValidate(char *filename)
checks all HDT entries in given filename. will not check for specific entry (only check entry headers...
Definition: hdt.c:42
HDT_PSD * HDTLoadPSD(char *filename, char *devname)
load all entry found in the hdt file if devname is null. else, load only the requested devic...
Definition: hdt.c:757
HDT_DRIVE * HDTLoadDRIVE(char *filename, char *devname)
load all entry found in the hdt file if devname is null. else, load only the requested devic...
Definition: hdt.c:1008
int HDTClearPSD(HDT_PSD *pdevs)
Free the allocated resources for the created by HDTLoad.
Definition: hdt.c:850
Structure defining a HDT Motor.
Definition: types.h:331
int HDTFindEntry(void *hdtfile, char *devname, HDT_ENTRY *deventry)
finds an entry in the hdt file that matches given name and copies the entry to given structure...
Definition: hdt.c:169
HDT_COM * HDTLoadCOM(char *filename, char *devname)
load all entry found in the hdt file if devname is null. else, load only the requested devic...
Definition: hdt.c:1679
HDT_ENCODER * HDTLoadENCODER(char *filename, char *devname)
load all entry found in the hdt file if devname is null. else, load only the requested devic...
Definition: hdt.c:606
HDT_TABLE * HDTLoadTable(char *filename, HDT_DEVICE *pdevices)
load all tables needed by pdevices - if found. the return value is a pointer to the first table...
Definition: hdt.c:271
int HDTClearDRIVE(HDT_DRIVE *pdevs)
Free the allocated resources for the created by HDTLoad.
Definition: hdt.c:1270
Structure defining a HDT psd.
Definition: types.h:373
Structure defining a HDT ADC.
Definition: types.h:412
int HDTClearSERVO(HDT_SERVO *pdevs)
Free the allocated resources for the created by HDTLoad.
Definition: hdt.c:985
HDT_CAM * HDTLoadCAM(char *filename, char *devname)
load all entry found in the hdt file if devname is null. else, load only the requested devic...
Definition: hdt.c:351
int HDTClearMOTOR(HDT_MOTOR *pdevs)
Free the allocated resources for the created by HDTLoad.
Definition: hdt.c:583
HDT_MOTOR * HDTLoadMOTOR(char *filename, char *devname)
load all entry found in the hdt file if devname is null. else, load only the requested devic...
Definition: hdt.c:490
Structure defining a HDT encoder.
Definition: types.h:344
Structure defining a HDT Table.
Definition: types.h:296
int HDTLinkENC2MOT(HDT_ENCODER *pencoders, HDT_MOTOR *pmotors)
Link the encoders to the motors.
Definition: hdt.c:720
HDT_IRTV * HDTLoadIRTV(char *filename, char *devname)
load all entry found in the hdt file if devname is null. else, load only the requested devic...
Definition: hdt.c:1391
Structure defining a HDT servo.
Definition: types.h:358
int HDTClearENCODER(HDT_ENCODER *pdevs)
Free the allocated resources for the created by HDTLoad.
Definition: hdt.c:700
int HDTClearCOM(HDT_COM *pdevs)
Free the allocated resources for the created by HDTLoad.
Definition: hdt.c:1765
Structure defining a HDT entry.
Definition: types.h:286
Structure defining a HDT COM.
Definition: types.h:424
Structure defining a HDT Camera.
Definition: types.h:320
Structure defining a HDT IRTV.
Definition: types.h:401
int HDTClearTable(HDT_TABLE *ptables)
Free the allocated resources for the tables created by HDTLoadTable.
Definition: hdt.c:326
int HDTClearADC(HDT_ADC *pdevs)
Free the allocated resources for the created by HDTLoad.
Definition: hdt.c:1656