summaryrefslogtreecommitdiff
path: root/docs/man/man3/hal_pin_new.3hal
blob: 8dc1a2c780f428d7e5346a92e20fdcf05ad6aea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.TH hal_pin_new "3hal" "2006-10-12" "LinuxCNC Documentation" "HAL"
.SH NAME

hal_pin_new \- Create a HAL pin

.SH SYNTAX

.HP
 int hal_pin_bit_new(const char *\fIname\fR, hal_pin_dir_t \fIdir\fR, hal_bit_t ** \fIdata_ptr_addr\fR, int \fIcomp_id\fR)

.HP
 int hal_pin_float_new(const char *\fIname\fR, hal_pin_dir_t \fIdir\fR, hal_float_t ** \fIdata_ptr_addr\fR, int \fIcomp_id\fR)

.HP
 int hal_pin_u32_new(const char *\fIname\fR, hal_pin_dir_t \fIdir\fR, hal_u32_t ** \fIdata_ptr_addr\fR, int \fIcomp_id\fR)

.HP
 int hal_pin_s32_new(const char *\fIname\fR, hal_pin_dir_t \fIdir\fR, hal_s32_t ** \fIdata_ptr_addr\fR, int \fIcomp_id\fR)

.HP
 int hal_pin_bit_newf(hal_pin_dir_t \fIdir\fR, hal_bit_t ** \fIdata_ptr_addr\fR, int \fIcomp_id\fR, const char *\fIfmt\fR, \fI...\fR)

.HP
 int hal_pin_float_newf(hal_pin_dir_t \fIdir\fR, hal_float_t ** \fIdata_ptr_addr\fR, int \fIcomp_id\fR, const char *\fIfmt\fR, \fI...\fR)

.HP
 int hal_pin_u32_newf(hal_pin_dir_t \fIdir\fR, hal_u32_t ** \fIdata_ptr_addr\fR, int \fIcomp_id\fR, const char *\fIfmt\fR, \fI...\fR)

.HP
 int hal_pin_s32_newf(hal_pin_dir_t \fIdir\fR, hal_s32_t ** \fIdata_ptr_addr\fR, int \fIcomp_id\fR, const char *\fIfmt\fR, \fI...\fR)

.HP
 int hal_pin_new(const char *\fIname\fR, hal_type_t \fItype\fR, hal_in_dir_t \fIdir\fR, void **\fIdata_ptr_addr\fR, int \fIcomp_id\fR)

.SH  ARGUMENTS
.IP \fIname\fR
The name of the pin
.IP \fIdir\fR

The direction of the pin, from the viewpoint of the component.  It may be one
of \fBHAL_IN\fR, \fBHAL_OUT\fR, or \fBHAL_IO\fR.  Any number of \fBHAL_IN\fR or
\fBHAL_IO\fR pins may be connected to the same signal, but at most one
\fBHAL_OUT\fR pin is permitted.  A component may assign a value to a pin that
is \fBHAL_OUT\fR or \fBHAL_IO\fR, but may not assign a value to a pin that is
\fBHAL_IN\fR.

.IP \fIdata_ptr_addr\fR
The address of the pointer-to-data, which must lie within memory allocated by
\fBhal_malloc\fR.

.IP \fIcomp_id\fR
A HAL component identifier returned by an earlier call to \fBhal_init\fR.

.IP \fIfmt, ...\fR
A printf-style format string and arguments

.IP \fItype\fR
The type of the param, as specified in \fBhal_type_t(3hal)\fR.

.SH DESCRIPTION
The \fBhal_pin_new\fR family of functions create a new \fIpin\fR object.  Once
a pin has been created, it can be linked to a signal object using
\fBhal_link\fR.  A pin contains a pointer, and the component that owns the pin
can dereference the pointer to access whatever signal is linked to the pin.
(If no signal is linked, it points to a dummy signal.)

There are functions for each of the data types that the HAL supports.  Pins may
only be linked to signals of the same type.

.SH RETURN VALUE
Returns a HAL status code.
.SH SEE ALSO
\fBhal_type_t(3hal)\fR, \fBhal_link(3hal)\fR