Scroll to navigation

hal_type_t(3hal) HAL hal_type_t(3hal)

NAME

hal_type_t - typedefs for HAL datatypes

DESCRIPTION

A type which may have a value of 0 or nonzero.
A volatile type which may have a value of 0 or nonzero.
A volatile type which may have a value from -2147483648 to 2147483647.
A volatile type which may have a value from 0 to 4294967295.
A volatile handle to a port object. Used with hal_port* functions.
A volatile floating-point type, which typically has the same precision and range as the C type double.
A nonvolatile floating-point type with at least as much precision as hal_float_t.
A nonvolatile unsigned integral type the same size as hal_float_t.
Corresponds to the type hal_bit_t.
Corresponds to the type hal_float_t.
Corresponds to the type hal_s32_t.
Corresponds to the type hal_u32_t.

NOTES

hal_bit_t is typically a typedef to an integer type whose range is larger than just 0 and 1. When testing the value of a hal_bit_t, never compare it to 1. Prefer one of the following:

  • if(b)
  • if(b != 0)

It is often useful to refer to a type that can represent all the values as a HAL type, but without the volatile qualifier. The following types correspond with the HAL types:

int

__s32

__u32

hal_real_t

int

Take care not to use the types s32 and u32. These will compile in kernel modules but not in userspace, and not for "realtime components" when using simulated (userspace) realtime.

SEE ALSO

hal_pin_new(3hal), hal_param_new(3hal)

2006-10-12 LinuxCNC Documentation