From e59dc278bca480f5e567bcfbc43ed84edc517828 Mon Sep 17 00:00:00 2001 From: Bertho Stultiens Date: Tue, 25 Aug 2026 15:03:33 +0200 Subject: [PATCH] docs: Update HAL API documentation - remove legacy API docs --- docs/po4a.cfg | 21 +- docs/src/hal/components.adoc | 258 +++++++++++------- docs/src/man/man3/hal_param_new-legacy.3.adoc | 62 ----- docs/src/man/man3/hal_pin_new-legacy.3.adoc | 74 ----- docs/src/man/man3/hal_type_t-legacy.3.adoc | 66 ----- 5 files changed, 181 insertions(+), 300 deletions(-) delete mode 100644 docs/src/man/man3/hal_param_new-legacy.3.adoc delete mode 100644 docs/src/man/man3/hal_pin_new-legacy.3.adoc delete mode 100644 docs/src/man/man3/hal_type_t-legacy.3.adoc diff --git a/docs/po4a.cfg b/docs/po4a.cfg index 61308113169..85f3cf55eef 100644 --- a/docs/po4a.cfg +++ b/docs/po4a.cfg @@ -252,23 +252,43 @@ [type: AsciiDoc_def] src/man/man1/xyzac-trt-gui.1.adoc $lang:build/adoc/$lang/man/man1/xyzac-trt-gui.1.adoc [type: AsciiDoc_def] src/man/man1/xyzbc-trt-gui.1.adoc $lang:build/adoc/$lang/man/man1/xyzbc-trt-gui.1.adoc [type: AsciiDoc_def] src/man/man3/PM_ROTATION_VECTOR.3.adoc $lang:build/adoc/$lang/man/man3/PM_ROTATION_VECTOR.3.adoc +[type: AsciiDoc_def] src/man/man3/hal.3.adoc $lang:build/adoc/$lang/man/man3/hal.3.adoc [type: AsciiDoc_def] src/man/man3/hal_add_funct_to_thread.3.adoc $lang:build/adoc/$lang/man/man3/hal_add_funct_to_thread.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_comp_by_name.3.adoc $lang:build/adoc/$lang/man/man3/hal_comp_by_name.3.adoc [type: AsciiDoc_def] src/man/man3/hal_create_thread.3.adoc $lang:build/adoc/$lang/man/man3/hal_create_thread.3.adoc [type: AsciiDoc_def] src/man/man3/hal_exit.3.adoc $lang:build/adoc/$lang/man/man3/hal_exit.3.adoc [type: AsciiDoc_def] src/man/man3/hal_export_funct.3.adoc $lang:build/adoc/$lang/man/man3/hal_export_funct.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_get_p.3.adoc $lang:build/adoc/$lang/man/man3/hal_get_p.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_get_realtime_type.3.adoc $lang:build/adoc/$lang/man/man3/hal_get_realtime_type.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_get_s.3.adoc $lang:build/adoc/$lang/man/man3/hal_get_s.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_getter.3.adoc $lang:build/adoc/$lang/man/man3/hal_getter.3.adoc [type: AsciiDoc_def] src/man/man3/hal_init.3.adoc $lang:build/adoc/$lang/man/man3/hal_init.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_init_funct_to_thread.3.adoc $lang:build/adoc/$lang/man/man3/hal_init_funct_to_thread.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_list_comp.3.adoc $lang:build/adoc/$lang/man/man3/hal_list_comp.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_list_funct.3.adoc $lang:build/adoc/$lang/man/man3/hal_list_funct.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_list_p.3.adoc $lang:build/adoc/$lang/man/man3/hal_list_p.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_list_p_s.3.adoc $lang:build/adoc/$lang/man/man3/hal_list_p_s.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_list_s.3.adoc $lang:build/adoc/$lang/man/man3/hal_list_s.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_list_thread.3.adoc $lang:build/adoc/$lang/man/man3/hal_list_thread.3.adoc [type: AsciiDoc_def] src/man/man3/hal_malloc.3.adoc $lang:build/adoc/$lang/man/man3/hal_malloc.3.adoc [type: AsciiDoc_def] src/man/man3/hal_param_alias.3.adoc $lang:build/adoc/$lang/man/man3/hal_param_alias.3.adoc [type: AsciiDoc_def] src/man/man3/hal_param_new.3.adoc $lang:build/adoc/$lang/man/man3/hal_param_new.3.adoc [type: AsciiDoc_def] src/man/man3/hal_parport.3.adoc $lang:build/adoc/$lang/man/man3/hal_parport.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_pdir_t.3.adoc $lang:build/adoc/$lang/man/man3/hal_pdir_t.3.adoc [type: AsciiDoc_def] src/man/man3/hal_pin_alias.3.adoc $lang:build/adoc/$lang/man/man3/hal_pin_alias.3.adoc [type: AsciiDoc_def] src/man/man3/hal_pin_new.3.adoc $lang:build/adoc/$lang/man/man3/hal_pin_new.3.adoc [type: AsciiDoc_def] src/man/man3/hal_port.3.adoc $lang:build/adoc/$lang/man/man3/hal_port.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_query_t.3.adoc $lang:build/adoc/$lang/man/man3/hal_query_t.3.adoc [type: AsciiDoc_def] src/man/man3/hal_ready.3.adoc $lang:build/adoc/$lang/man/man3/hal_ready.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_refs_u.3.adoc $lang:build/adoc/$lang/man/man3/hal_refs_u.3.adoc [type: AsciiDoc_def] src/man/man3/hal_set_constructor.3.adoc $lang:build/adoc/$lang/man/man3/hal_set_constructor.3.adoc [type: AsciiDoc_def] src/man/man3/hal_set_lock.3.adoc $lang:build/adoc/$lang/man/man3/hal_set_lock.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_set_p.3.adoc $lang:build/adoc/$lang/man/man3/hal_set_p.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_set_s.3.adoc $lang:build/adoc/$lang/man/man3/hal_set_s.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_setter.3.adoc $lang:build/adoc/$lang/man/man3/hal_setter.3.adoc [type: AsciiDoc_def] src/man/man3/hal_signal_new.3.adoc $lang:build/adoc/$lang/man/man3/hal_signal_new.3.adoc [type: AsciiDoc_def] src/man/man3/hal_start_threads.3.adoc $lang:build/adoc/$lang/man/man3/hal_start_threads.3.adoc +[type: AsciiDoc_def] src/man/man3/hal_statistics.3.adoc $lang:build/adoc/$lang/man/man3/hal_statistics.3.adoc [type: AsciiDoc_def] src/man/man3/hal_stream.3.adoc $lang:build/adoc/$lang/man/man3/hal_stream.3.adoc [type: AsciiDoc_def] src/man/man3/hal_type_t.3.adoc $lang:build/adoc/$lang/man/man3/hal_type_t.3.adoc [type: AsciiDoc_def] src/man/man3/hm2_allocate_bspi_tram.3.adoc $lang:build/adoc/$lang/man/man3/hm2_allocate_bspi_tram.3.adoc @@ -283,7 +303,6 @@ [type: AsciiDoc_def] src/man/man3/hm2_uart_read.3.adoc $lang:build/adoc/$lang/man/man3/hm2_uart_read.3.adoc [type: AsciiDoc_def] src/man/man3/hm2_uart_send.3.adoc $lang:build/adoc/$lang/man/man3/hm2_uart_send.3.adoc [type: AsciiDoc_def] src/man/man3/hm2_uart_setup.3.adoc $lang:build/adoc/$lang/man/man3/hm2_uart_setup.3.adoc -[type: AsciiDoc_def] src/man/man3/hal.3.adoc $lang:build/adoc/$lang/man/man3/hal.3.adoc [type: AsciiDoc_def] src/man/man3/rtapi.3.adoc $lang:build/adoc/$lang/man/man3/rtapi.3.adoc [type: AsciiDoc_def] src/man/man3/rtapi_app_exit.3.adoc $lang:build/adoc/$lang/man/man3/rtapi_app_exit.3.adoc [type: AsciiDoc_def] src/man/man3/rtapi_app_main.3.adoc $lang:build/adoc/$lang/man/man3/rtapi_app_main.3.adoc diff --git a/docs/src/hal/components.adoc b/docs/src/hal/components.adoc index 8e04a648a93..e613c18749c 100644 --- a/docs/src/hal/components.adoc +++ b/docs/src/hal/components.adoc @@ -448,104 +448,168 @@ Limit its slew rate to less than maxv per second. Limit its second derivative to include::components_gen.adoc[] == HAL API calls -.... -hal_add_funct_to_thread.3 -hal_bit_t.3 -hal_create_thread.3 -hal_del_funct_from_thread.3 -hal_exit.3 -hal_export_funct.3 -hal_export_functf.3 -hal_float_t.3 -hal_get_lock.3 -hal_init.3 -hal_link.3 -hal_malloc.3 -hal_param_bit_new.3 -hal_param_bit_newf.3 -hal_param_float_new.3 -hal_param_float_newf.3 -hal_param_new.3 -hal_param_s32_new.3 -hal_param_s32_newf.3 -hal_param_u32_new.3 -hal_param_u32_newf.3 -hal_parport.3 -hal_pin_bit_new.3 -hal_pin_bit_newf.3 -hal_pin_float_new.3 -hal_pin_float_newf.3 -hal_pin_new.3 -hal_pin_s32_new.3 -hal_pin_s32_newf.3 -hal_pin_u32_new.3 -hal_pin_u32_newf.3 -hal_ready.3 -hal_s32_t.3 -hal_set_constructor.3 -hal_set_lock.3 -hal_signal_delete.3 -hal_signal_new.3 -hal_start_threads.3 -hal_type_t.3 -hal_u32_t.3 -hal_unlink.3 -hal.3 -.... + +* hal(3) +* hal_add_funct_to_thread(3) +* hal_bool_t(3) +* hal_comp_by_id(3) +* hal_comp_by_name(3) +* hal_create_thread(3) +* hal_del_funct_from_thread(3) +* hal_exit(3) +* hal_export_funct(3) +* hal_export_functf(3) +* hal_get_bool(3) +* hal_get_lock(3) +* hal_get_p(3) +* hal_get_real(3) +* hal_get_realtime_type(3) +* hal_getref_p(3) +* hal_getref_s(3) +* hal_get_s(3) +* hal_get_si32(3) +* hal_get_si32_clamped(3) +* hal_get_sint(3) +* hal_getter(3) +* hal_get_ui32(3) +* hal_get_ui32_clamped(3) +* hal_get_uint(3) +* hal_init(3) +* hal_init_funct_to_thread(3) +* hal_link(3) +* hal_list_comp(3) +* hal_list_funct(3) +* hal_list_p(3) +* hal_list_p_s(3) +* hal_list_s(3) +* hal_list_thread(3) +* hal_malloc(3) +* hal_param_alias(3) +* hal_param_new(3) +* hal_param_new_bool(3) +* hal_param_new_fake(3) +* hal_param_new_real(3) +* hal_param_new_sint(3) +* hal_param_new_uint(3) +* hal_parport(3) +* hal_pdir_t(3) +* hal_pin_alias(3) +* hal_pin_new(3) +* hal_pin_new_bool(3) +* hal_pin_new_port(3) +* hal_pin_new_real(3) +* hal_pin_new_sint(3) +* hal_pin_new_uint(3) +* hal_port(3) +* hal_port_buffer_size(3) +* hal_port_clear(3) +* hal_port_peek(3) +* hal_port_peek_commit(3) +* hal_port_read(3) +* hal_port_readable(3) +* hal_port_t(3) +* hal_port_writable(3) +* hal_port_write(3) +* hal_query_t(3) +* hal_ready(3) +* hal_real_t(3) +* hal_refs_u(3) +* hal_set_bool(3) +* hal_set_constructor(3) +* hal_set_lock(3) +* hal_set_p(3) +* hal_set_real(3) +* hal_set_s(3) +* hal_set_si32(3) +* hal_set_sint(3) +* hal_setter(3) +* hal_set_ui32(3) +* hal_set_uint(3) +* hal_signal_delete(3) +* hal_signal_new(3) +* hal_sint_t(3) +* hal_start_threads(3) +* hal_statistics(3) +* hal_stream(3) +* hal_type_t(3) +* hal_uint_t(3) +* hal_unlink(3) +* hal_unready(3) == RTAPI calls -.... -EXPORT_FUNCTION.3 -MODULE_AUTHOR.3 -MODULE_DESCRIPTION.3 -MODULE_LICENSE.3 -RTAPI_MP_ARRAY_INT.3 -RTAPI_MP_ARRAY_LONG.3 -RTAPI_MP_ARRAY_STRING.3 -RTAPI_MP_INT.3 -RTAPI_MP_LONG.3 -RTAPI_MP_STRING.3 -rtapi.3 -rtapi_app_exit.3 -rtapi_app_main.3 -rtapi_clock_set_period.3 -rtapi_delay.3 -rtapi_delay_max.3 -rtapi_exit.3 -rtapi_get_msg_level.3 -rtapi_get_time.3 -rtapi_inb.3 -rtapi_init.3 -rtapi_module_param.3 -RTAPI_MP_ARRAY_INT.3 -RTAPI_MP_ARRAY_LONG.3 -RTAPI_MP_ARRAY_STRING.3 -RTAPI_MP_INT.3 -RTAPI_MP_LONG.3 -RTAPI_MP_STRING.3 -rtapi_mutex.3 -rtapi_outb.3 -rtapi_print.3 -rtapi_prio.3 -rtapi_prio_highest.3 -rtapi_prio_lowest.3 -rtapi_prio_next_higher.3 -rtapi_prio_next_lower.3 -rtapi_region.3 -rtapi_release_region.3 -rtapi_request_region.3 -rtapi_set_msg_level.3 -rtapi_shmem.3 -rtapi_shmem_delete.3 -rtapi_shmem_getptr.3 -rtapi_shmem_new.3 -rtapi_snprintf.3 -rtapi_task_delete.3 -rtapi_task_new.3 -rtapi_task_pause.3 -rtapi_task_resume.3 -rtapi_task_start.3 -rtapi_task_wait.3 -.... + +Helpers: + +* EXPORT_FUNCTION(3) +* MODULE_AUTHOR(3) +* MODULE_DESCRIPTION(3) +* MODULE_LICENSE(3) +* RTAPI_MP_ARRAY_INT(3) +* RTAPI_MP_ARRAY_LONG(3) +* RTAPI_MP_ARRAY_STRING(3) +* RTAPI_MP_INT(3) +* RTAPI_MP_LONG(3) +* RTAPI_MP_STRING(3) + +API calls: + +* rtapi(3) +* rtapi_app_exit(3) +* rtapi_app_main(3) +* rtapi_atomic(3) +* rtapi_bool(3) +* rtapi_byteorder(3) +* rtapi_clock_set_period(3) +* rtapi_delay(3) +* rtapi_delay_max(3) +* rtapi_device(3) +* rtapi_div_s64(3) +* rtapi_div_s64_rem(3) +* rtapi_div_u64(3) +* rtapi_div_u64_rem(3) +* rtapi_exit(3) +* rtapi_firmware(3) +* rtapi_get_msg_level(3) +* rtapi_get_time(3) +* rtapi_gfp(3) +* rtapi_inb(3) +* rtapi_init(3) +* rtapi_io(3) +* rtapi_is(3) +* rtapi_list(3) +* rtapi_module_param(3) +* rtapi_mutex(3) +* rtapi_open_as_root(3) +* rtapi_outb(3) +* rtapi_parport(3) +* rtapi_pci(3) +* rtapi_print(3) +* rtapi_print_msg(3) +* rtapi_prio(3) +* rtapi_prio_highest(3) +* rtapi_prio_lowest(3) +* rtapi_prio_next_higher(3) +* rtapi_prio_next_lower(3) +* rtapi_region(3) +* rtapi_release_region(3) +* rtapi_request_region(3) +* rtapi_set_msg_level(3) +* rtapi_shmem(3) +* rtapi_shmem_delete(3) +* rtapi_shmem_getptr(3) +* rtapi_shmem_new(3) +* rtapi_slab(3) +* rtapi_snprintf(3) +* rtapi_stdint(3) +* rtapi_string(3) +* rtapi_strlcpy(3) +* rtapi_task_delete(3) +* rtapi_task_new(3) +* rtapi_task_pause(3) +* rtapi_task_resume(3) +* rtapi_task_self(3) +* rtapi_task_start(3) +* rtapi_task_wait(3) +* rtapi_vsnprintf(3) // vim: set syntax=asciidoc: diff --git a/docs/src/man/man3/hal_param_new-legacy.3.adoc b/docs/src/man/man3/hal_param_new-legacy.3.adoc deleted file mode 100644 index 7f9e4bcae64..00000000000 --- a/docs/src/man/man3/hal_param_new-legacy.3.adoc +++ /dev/null @@ -1,62 +0,0 @@ -:manvolnum: 3 - -= hal_param_new-legacy(3) - -== NAME - -hal_param_new-legacy, hal_param_bit_new-legacy, hal_param_float_new-legacy, hal_param_u32_new-legacy, -hal_param_s32_new-legacy, hal_param_bit_newf-legacy, hal_param_float_newf-legacy, hal_param_u32_newf-legacy, -hal_param_s32_newf-legacy - creates a HAL parameter - -== SYNTAX - -int hal_param_bit_new(const char* _name_, hal_param_dir_t _dir_, hal_bit_t* _data_addr_, int _comp_id_) - -int hal_param_float_new(const char* _name_, hal_param_dir_t _dir_, hal_float_t* _data_addr_, int _comp_id_) - -int hal_param_u32_new(const char* _name_, hal_param_dir_t _dir_, hal_u32_t* _data_addr_, int _comp_id_) - -int hal_param_s32_new(const char* _name_, hal_param_dir_t _dir_, hal_s32_t* _data_addr_, int _comp_id_) - -int hal_param_bit_newf(hal_param_dir_t _dir_, hal_bit_t* _data_addr_, int _comp_id_, const char* _fmt_, _..._) - -int hal_param_float_newf(hal_param_dir_t _dir_, hal_float_t* _data_addr_, int _comp_id_, const char* _fmt_, _..._) - -int hal_param_u32_newf(hal_param_dir_t _dir_, hal_u32_t * _data_addr_, int _comp_id_, const char* _fmt_, _..._) - -int hal_param_s32_newf(hal_param_dir_t _dir_, hal_s32_t * _data_addr_, int _comp_id_, const char* _fmt_, _..._) - -int hal_param_new(const char* _name_, hal_type_t _type_, hal_param_dir_t _dir_, void* _data_addr_, int _comp_id_) - -== ARGUMENTS - -_name_:: - The name to give to the created parameter. -_dir_:: - The direction of the parameter, from the viewpoint of the component. - It may be one of *HAL_RO*, or *HAL_RW*. - A component may assign a value to any parameter, - but other programs (such as halcmd) may only assign a value to a parameter that is *HAL_RW*. -_data_addr_:: - The address of the data, which must lie within memory allocated by *hal_malloc*. -_comp_id_:: - A HAL component identifier returned by an earlier call to *hal_init*. -_fmt, ..._:: - A printf-style format string and arguments. -_type_:: - The type of the parameter, as specified in *hal_type_t(3)*. - -== DESCRIPTION - -The *hal_param_new* family of functions create a new _param_ object. - -There are functions for each of the data types that the HAL supports. -Pins may only be linked to signals of the same type. - -== RETURN VALUE - -Returns a HAL status code. - -== SEE ALSO - -hal_type_t(3) diff --git a/docs/src/man/man3/hal_pin_new-legacy.3.adoc b/docs/src/man/man3/hal_pin_new-legacy.3.adoc deleted file mode 100644 index 82a4cbce2a2..00000000000 --- a/docs/src/man/man3/hal_pin_new-legacy.3.adoc +++ /dev/null @@ -1,74 +0,0 @@ -:manvolnum: 3 - -= hal_pin_new-legacy(3) - -== NAME - -hal_pin_new-legacy, hal_pin_bit_new-legacy, hal_pin_float_new-legacy, hal_pin_u32_new-legacy, -hal_pin_s32_new-legacy, hal_pin_port_new-legacy, hal_pin_bit_newf-legacy, -hal_pin_float_newf-legacy, hal_pin_u32_newf-legacy, hal_pin_s32_newf-legacy, -hal_pin_port_newf-legacy - creates a HAL pin - -== SYNTAX - -int hal_pin_bit_new(const char* _name_, hal_pin_dir_t _dir_, hal_bit_t** _data_ptr_addr_, int _comp_id_) - -int hal_pin_float_new(const char* _name_, hal_pin_dir_t _dir_, hal_float_t** _data_ptr_addr_, int _comp_id_) - -int hal_pin_u32_new(const char* _name_, hal_pin_dir_t _dir_, hal_u32_t** _data_ptr_addr_, int _comp_id_) - -int hal_pin_s32_new(const char* _name_, hal_pin_dir_t _dir_, hal_s32_t** _data_ptr_addr_, int _comp_id_) - -int hal_pin_port_new(const char* _name_, hal_pin_dir_t _dir_, hal_port_t** _data_ptr_addr_, int _comp_id_) - -int hal_pin_bit_newf(hal_pin_dir_t _dir_, hal_bit_t** _data_ptr_addr_, int _comp_id_, const char* _fmt_, _..._) - -int hal_pin_float_newf(hal_pin_dir_t _dir_, hal_float_t** _data_ptr_addr_, int _comp_id_, const char* _fmt_, _..._) - -int hal_pin_u32_newf(hal_pin_dir_t _dir_, hal_u32_t** _data_ptr_addr_, int _comp_id_, const char* _fmt_, _..._) - -int hal_pin_s32_newf(hal_pin_dir_t _dir_, hal_s32_t** _data_ptr_addr_, int _comp_id_, const char* _fmt_, _..._) - -int hal_pin_port_newf(hal_pin_dir_t _dir_, hal_port_t** _data_ptr_addr_, int _comp_id_, const char* _fmt_, _..._) - -int hal_pin_new(const char* _name_, hal_type_t _type_, hal_pin_dir_t _dir_, void** _data_ptr_addr_, int _comp_id_) - -== ARGUMENTS - -name:: - Name of the pin. -dir:: - The direction of the pin, from the viewpoint of the component. - It may be one of *HAL_IN*, *HAL_OUT*, or *HAL_IO*. - Any number of *HAL_IN* or *HAL_IO* pins may be connected to the same signal, - but at most one *HAL_OUT* pin is permitted. - A component may assign a value to a pin that is *HAL_OUT* or *HAL_IO*, - but may not assign a value to a pin that is *HAL_IN*. -data_ptr_addr:: - The address of the pointer-to-data, which must lie within memory - allocated by *hal_malloc*. -comp_id:: - HAL component identifier returned by an earlier call to *hal_init*. -fmt,:: - printf-style format string and arguments -type:: - The type of the param, as specified in *hal_type_t(3)*. - -== DESCRIPTION - -The *hal_pin_new* family of functions create a new _pin_ object. -Once a pin has been created, it can be linked to a signal object using *hal_link*. -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. - -== RETURN VALUE - -Returns 0 on success, or a negative errno value on failure. - -== SEE ALSO - -hal_type_t(3), hal_link(3) diff --git a/docs/src/man/man3/hal_type_t-legacy.3.adoc b/docs/src/man/man3/hal_type_t-legacy.3.adoc deleted file mode 100644 index 3973cc75fd6..00000000000 --- a/docs/src/man/man3/hal_type_t-legacy.3.adoc +++ /dev/null @@ -1,66 +0,0 @@ -:manvolnum: 3 - -= hal_type_t-legacy(3) - -== NAME - -hal_type_t-legacy, hal_bool-legacy, hal_bit_t-legacy, hal_s32_t-legacy, hal_u32_t-legacy, -hal_port_t-legacy, hal_float_t-legacy, real_t-legacy, ireal_t-legacy - typedefs for HAL datatypes - -== DESCRIPTION - -typedef ... *hal_bool;*:: - A type which may have a value of 0 or nonzero. -typedef ... *hal_bit_t;*:: - A volatile type which may have a value of 0 or nonzero. -typedef ... *hal_s32_t*;:: - A volatile type which may have a value from -2147483648 to 2147483647. -typedef ... *hal_u32_t*;:: - A volatile type which may have a value from 0 to 4294967295. -typedef ... *hal_port_t*;:: - A volatile handle to a port object. Used with hal_port* functions. -typedef ... *hal_float_t*;:: - A volatile floating-point type, which typically has the same precision - and range as the C type *double*. -typedef ... *real_t*;:: - A nonvolatile floating-point type with at least as much precision as - *hal_float_t*. -typedef ... *ireal_t*;:: - A nonvolatile unsigned integral type the same size as *hal_float_t*. -typedef enum *hal_type_t*;:: - - *HAL_BIT*;; - Corresponds to the type *hal_bit_t*. - *HAL_FLOAT*;; - Corresponds to the type *hal_float_t*. - *HAL_S32*;; - Corresponds to the type *hal_s32_t*. - *HAL_U32*;; - 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: - -hal_bit_t:: int -hal_s32_t:: __s32 -hal_u32_t:: __u32 -hal_float_t:: hal_real_t -hal_port_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 uspace realtime. - -== SEE ALSO - -hal_pin_new(3), hal_param_new(3)