libneoradio2
Functions
libneoradio2.h File Reference
#include <stdint.h>
#include "radio2_frames.h"
#include "libneoradio2common.h"

Go to the source code of this file.

Functions

LIBNEORADIO2_API void neoradio2_set_blocking (int blocking, long long ms_timeout)
 
LIBNEORADIO2_API int neoradio2_find (Neoradio2DeviceInfo *devices, unsigned int *device_count)
 
LIBNEORADIO2_API int neoradio2_is_blocking ()
 
LIBNEORADIO2_API int neoradio2_open (neoradio2_handle *handle, Neoradio2DeviceInfo *device)
 
LIBNEORADIO2_API int neoradio2_is_opened (neoradio2_handle *handle, int *is_opened)
 
LIBNEORADIO2_API int neoradio2_close (neoradio2_handle *handle)
 
LIBNEORADIO2_API int neoradio2_is_closed (neoradio2_handle *handle, int *is_closed)
 
LIBNEORADIO2_API int neoradio2_chain_is_identified (neoradio2_handle *handle, int *is_identified)
 
LIBNEORADIO2_API int neoradio2_chain_identify (neoradio2_handle *handle)
 
LIBNEORADIO2_API int neoradio2_app_is_started (neoradio2_handle *handle, int device, int bank, int *is_started)
 
LIBNEORADIO2_API int neoradio2_app_start (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_enter_bootloader (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_get_serial_number (neoradio2_handle *handle, int device, int bank, unsigned int *serial_number)
 
LIBNEORADIO2_API int neoradio2_get_manufacturer_date (neoradio2_handle *handle, int device, int bank, int *year, int *month, int *day)
 
LIBNEORADIO2_API int neoradio2_get_firmware_version (neoradio2_handle *handle, int device, int bank, int *major, int *minor)
 
LIBNEORADIO2_API int neoradio2_get_hardware_revision (neoradio2_handle *handle, int device, int bank, int *major, int *minor)
 
LIBNEORADIO2_API int neoradio2_get_device_type (neoradio2_handle *handle, int device, int bank, unsigned int *device_type)
 
LIBNEORADIO2_API int neoradio2_request_pcbsn (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_get_pcbsn (neoradio2_handle *handle, int device, int bank, char *pcb_sn)
 
LIBNEORADIO2_API int neoradio2_request_sensor_data (neoradio2_handle *handle, int device, int bank, int enable_cal)
 
LIBNEORADIO2_API int neoradio2_read_sensor_float (neoradio2_handle *handle, int device, int bank, float *value)
 
LIBNEORADIO2_API int neoradio2_read_sensor_array (neoradio2_handle *handle, int device, int bank, int *arr, int *arr_size)
 
LIBNEORADIO2_API int neoradio2_write_sensor (neoradio2_handle *handle, int device, int bank, int mask, int value)
 
LIBNEORADIO2_API int neoradio2_write_sensor_successful (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_request_settings (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_read_settings (neoradio2_handle *handle, int device, int bank, neoRADIO2_settings *settings)
 
LIBNEORADIO2_API int neoradio2_write_settings (neoradio2_handle *handle, int device, int bank, neoRADIO2_settings *settings)
 
LIBNEORADIO2_API int neoradio2_write_settings_successful (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_get_chain_count (neoradio2_handle *handle, int *count, int identify)
 
LIBNEORADIO2_API int neoradio2_request_calibration (neoradio2_handle *handle, int device, int bank, neoRADIO2frame_calHeader *header)
 
LIBNEORADIO2_API int neoradio2_read_calibration_array (neoradio2_handle *handle, int device, int bank, neoRADIO2frame_calHeader *header, float *arr, int *arr_size)
 
LIBNEORADIO2_API int neoradio2_request_calibration_points (neoradio2_handle *handle, int device, int bank, neoRADIO2frame_calHeader *header)
 
LIBNEORADIO2_API int neoradio2_read_calibration_points_array (neoradio2_handle *handle, int device, int bank, neoRADIO2frame_calHeader *header, float *arr, int *arr_size)
 
LIBNEORADIO2_API int neoradio2_write_calibration (neoradio2_handle *handle, int device, int bank, neoRADIO2frame_calHeader *header, float *arr, int arr_size)
 
LIBNEORADIO2_API int neoradio2_write_calibration_successful (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_write_calibration_points (neoradio2_handle *handle, int device, int bank, neoRADIO2frame_calHeader *header, float *arr, int arr_size)
 
LIBNEORADIO2_API int neoradio2_write_calibration_points_successful (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_store_calibration (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_is_calibration_stored (neoradio2_handle *handle, int device, int bank, int *stored)
 
LIBNEORADIO2_API int neoradio2_get_calibration_is_valid (neoradio2_handle *handle, int device, int bank, int *is_valid)
 
LIBNEORADIO2_API int neoradio2_request_calibration_info (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_read_calibration_info (neoradio2_handle *handle, int device, int bank, neoRADIO2frame_calHeader *header)
 
LIBNEORADIO2_API int neoradio2_toggle_led (neoradio2_handle *handle, int device, int bank, int ms)
 
LIBNEORADIO2_API int neoradio2_toggle_led_successful (neoradio2_handle *handle, int device, int bank)
 
LIBNEORADIO2_API int neoradio2_get_status (neoradio2_handle *handle, int device, int bank, int bitfield, StatusType type, CommandStatus *status)
 

Function Documentation

◆ neoradio2_app_is_started()

LIBNEORADIO2_API int neoradio2_app_is_started ( neoradio2_handle handle,
int  device,
int  bank,
int *  is_started 
)

Determines if the neoRAD-IO-2 Application code is started. This should be called on first connect to make sure we aren't in bootloader still. Chain needs to be identified first.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
devicedevice number in the chain to communicate with. First device is 0.
bankbank of the device to communicate with. This is a bitmask (0b00001001 - 0x09 = Bank 1 and 4).
is_started0 = false, 1 = true
See also
neoradio2_chain_identify
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure.

◆ neoradio2_app_start()

LIBNEORADIO2_API int neoradio2_app_start ( neoradio2_handle handle,
int  device,
int  bank 
)

Tells the neoRAD-IO-2 bootloader to start Application code. This should be called on first connect to make sure we aren't in bootloader still. Chain needs to be identified first.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
devicedevice number in the chain to communicate with. First device is 0.
bankbank of the device to communicate with. This is a bitmask (0b00001001 - 0x09 = Bank 1 and 4).
See also
neoradio2_chain_identify
neoradio2_app_is_started
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_chain_identify()

LIBNEORADIO2_API int neoradio2_chain_identify ( neoradio2_handle handle)

Identifies the neoRAD-IO-2 chain.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
See also
neoradio2_chain_is_identified
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_chain_is_identified()

LIBNEORADIO2_API int neoradio2_chain_is_identified ( neoradio2_handle handle,
int *  is_identified 
)

Determines if the neoRAD-IO-2 Chain is identified.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
is_identified0 = false, 1 = true
See also
neoradio2_chain_identify
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_close()

LIBNEORADIO2_API int neoradio2_close ( neoradio2_handle handle)

Determines if a neoRAD-IO2 Device is open.

Parameters
neoradio2_handlepointer to a valid neoradio2_handle.
is_opened0 = false, 1 = true
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure.

◆ neoradio2_enter_bootloader()

LIBNEORADIO2_API int neoradio2_enter_bootloader ( neoradio2_handle handle,
int  device,
int  bank 
)

Tells the neoRAD-IO-2 to enter bootloader. This is typically not needed. Chain needs to be identified first.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
devicedevice number in the chain to communicate with. First device is 0.
bankbank of the device to communicate with. This is a bitmask (0b00001001 - 0x09 = Bank 1 and 4).
See also
neoradio2_chain_identify
neoradio2_app_is_started
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_find()

LIBNEORADIO2_API int neoradio2_find ( Neoradio2DeviceInfo devices,
unsigned int *  device_count 
)

Finds all neoRAD-IO2 Devices.

Parameters
devicesArray of Neoradio2DeviceInfo
device_countSize of devices array, gets updated to device_count found.
See also
Neoradio2DeviceInfo
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure.

◆ neoradio2_get_calibration_is_valid()

LIBNEORADIO2_API int neoradio2_get_calibration_is_valid ( neoradio2_handle handle,
int  device,
int  bank,
int *  is_valid 
)

◆ neoradio2_get_chain_count()

LIBNEORADIO2_API int neoradio2_get_chain_count ( neoradio2_handle handle,
int *  count,
int  identify 
)

◆ neoradio2_get_device_type()

LIBNEORADIO2_API int neoradio2_get_device_type ( neoradio2_handle handle,
int  device,
int  bank,
unsigned int *  device_type 
)

Get the device type of the selected devices and banks. Chain needs to be identified first.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
devicedevice number in the chain to communicate with. First device is 0.
bankbank of the device to communicate with. This is a bitmask (0b00001001 - 0x09 = Bank 1 and 4).
See also
neoradio2_chain_identify
neoradio2_app_is_started
neoRADIO2_deviceTypes
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_get_firmware_version()

LIBNEORADIO2_API int neoradio2_get_firmware_version ( neoradio2_handle handle,
int  device,
int  bank,
int *  major,
int *  minor 
)

Get the firmware version of the selected devices and banks. Chain needs to be identified first.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
devicedevice number in the chain to communicate with. First device is 0.
bankbank of the device to communicate with. This is a bitmask (0b00001001 - 0x09 = Bank 1 and 4).
See also
neoradio2_chain_identify
neoradio2_app_is_started
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_get_hardware_revision()

LIBNEORADIO2_API int neoradio2_get_hardware_revision ( neoradio2_handle handle,
int  device,
int  bank,
int *  major,
int *  minor 
)

Get the hardware revision of the selected devices and banks. Chain needs to be identified first.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
devicedevice number in the chain to communicate with. First device is 0.
bankbank of the device to communicate with. This is a bitmask (0b00001001 - 0x09 = Bank 1 and 4).
See also
neoradio2_chain_identify
neoradio2_app_is_started
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_get_manufacturer_date()

LIBNEORADIO2_API int neoradio2_get_manufacturer_date ( neoradio2_handle handle,
int  device,
int  bank,
int *  year,
int *  month,
int *  day 
)

Get the manufacturing date of the selected devices and banks. Chain needs to be identified first.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
devicedevice number in the chain to communicate with. First device is 0.
bankbank of the device to communicate with. This is a bitmask (0b00001001 - 0x09 = Bank 1 and 4).
See also
neoradio2_chain_identify
neoradio2_app_is_started
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_get_pcbsn()

LIBNEORADIO2_API int neoradio2_get_pcbsn ( neoradio2_handle handle,
int  device,
int  bank,
char *  pcb_sn 
)

◆ neoradio2_get_serial_number()

LIBNEORADIO2_API int neoradio2_get_serial_number ( neoradio2_handle handle,
int  device,
int  bank,
unsigned int *  serial_number 
)

Gets the serial number (base10) on the selected devices and banks. Chain needs to be identified first. The serial number is generally displayed in base36.

Parameters
neoradio2_handlepointer to a neoradio2_handle.
devicedevice number in the chain to communicate with. First device is 0.
bankbank of the device to communicate with. This is a bitmask (0b00001001 - 0x09 = Bank 1 and 4).
serial_numberserial number in base10.
See also
neoradio2_chain_identify
neoradio2_app_is_started
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_get_status()

LIBNEORADIO2_API int neoradio2_get_status ( neoradio2_handle handle,
int  device,
int  bank,
int  bitfield,
StatusType  type,
CommandStatus status 
)

◆ neoradio2_is_blocking()

LIBNEORADIO2_API int neoradio2_is_blocking ( )

Determine if the API is setup in blocking mode

Parameters
devicesArray of Neoradio2DeviceInfo
device_countSize of devices array, gets updated to device_count found.
Returns
1 if blocking, 0 if not.

◆ neoradio2_is_calibration_stored()

LIBNEORADIO2_API int neoradio2_is_calibration_stored ( neoradio2_handle handle,
int  device,
int  bank,
int *  stored 
)

◆ neoradio2_is_closed()

LIBNEORADIO2_API int neoradio2_is_closed ( neoradio2_handle handle,
int *  is_closed 
)

Determines if a neoRAD-IO2 Device is closed.

Parameters
neoradio2_handlepointer to a valid neoradio2_handle.
is_closed0 = false, 1 = true
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure.

◆ neoradio2_is_opened()

LIBNEORADIO2_API int neoradio2_is_opened ( neoradio2_handle handle,
int *  is_opened 
)

Determines if a neoRAD-IO2 Device is open.

Parameters
neoradio2_handlepointer to a valid neoradio2_handle.
is_opened0 = false, 1 = true
See also
neoradio2_find
Neoradio2DeviceInfo
Returns
NEORADIO2_SUCCESS if or NEORADIO2_FAILURE on failure.

◆ neoradio2_open()

LIBNEORADIO2_API int neoradio2_open ( neoradio2_handle handle,
Neoradio2DeviceInfo device 
)

Open a neoRAD-IO2 Device.

Parameters
neoradio2_handlepointer to a neoradio2_handle. Needs to be allocated beforehand.
Neoradio2DeviceInfopointer to a Neoradio2DeviceInfo structure.
See also
neoradio2_find
Neoradio2DeviceInfo
Returns
NEORADIO2_SUCCESS if successful or NEORADIO2_FAILURE on failure. Returns NEORADIO2_ERR_WBLOCK in non-blocking mode

◆ neoradio2_read_calibration_array()

LIBNEORADIO2_API int neoradio2_read_calibration_array ( neoradio2_handle handle,
int  device,
int  bank,
neoRADIO2frame_calHeader header,
float *  arr,
int *  arr_size 
)

◆ neoradio2_read_calibration_info()

LIBNEORADIO2_API int neoradio2_read_calibration_info ( neoradio2_handle handle,
int  device,
int  bank,
neoRADIO2frame_calHeader header 
)

◆ neoradio2_read_calibration_points_array()

LIBNEORADIO2_API int neoradio2_read_calibration_points_array ( neoradio2_handle handle,
int  device,
int  bank,
neoRADIO2frame_calHeader header,
float *  arr,
int *  arr_size 
)

◆ neoradio2_read_sensor_array()

LIBNEORADIO2_API int neoradio2_read_sensor_array ( neoradio2_handle handle,
int  device,
int  bank,
int *  arr,
int *  arr_size 
)

◆ neoradio2_read_sensor_float()

LIBNEORADIO2_API int neoradio2_read_sensor_float ( neoradio2_handle handle,
int  device,
int  bank,
float *  value 
)

◆ neoradio2_read_settings()

LIBNEORADIO2_API int neoradio2_read_settings ( neoradio2_handle handle,
int  device,
int  bank,
neoRADIO2_settings settings 
)

◆ neoradio2_request_calibration()

LIBNEORADIO2_API int neoradio2_request_calibration ( neoradio2_handle handle,
int  device,
int  bank,
neoRADIO2frame_calHeader header 
)

◆ neoradio2_request_calibration_info()

LIBNEORADIO2_API int neoradio2_request_calibration_info ( neoradio2_handle handle,
int  device,
int  bank 
)

◆ neoradio2_request_calibration_points()

LIBNEORADIO2_API int neoradio2_request_calibration_points ( neoradio2_handle handle,
int  device,
int  bank,
neoRADIO2frame_calHeader header 
)

◆ neoradio2_request_pcbsn()

LIBNEORADIO2_API int neoradio2_request_pcbsn ( neoradio2_handle handle,
int  device,
int  bank 
)

◆ neoradio2_request_sensor_data()

LIBNEORADIO2_API int neoradio2_request_sensor_data ( neoradio2_handle handle,
int  device,
int  bank,
int  enable_cal 
)

◆ neoradio2_request_settings()

LIBNEORADIO2_API int neoradio2_request_settings ( neoradio2_handle handle,
int  device,
int  bank 
)

◆ neoradio2_set_blocking()

LIBNEORADIO2_API void neoradio2_set_blocking ( int  blocking,
long long  ms_timeout 
)

Sets the API to blocking or non-blocking mode.

Parameters
blocking1 = blocking, 0 = non-blocking
ms_timeouttimeout in milliseconds. Only matters in blocking mode.
Returns
void

◆ neoradio2_store_calibration()

LIBNEORADIO2_API int neoradio2_store_calibration ( neoradio2_handle handle,
int  device,
int  bank 
)

◆ neoradio2_toggle_led()

LIBNEORADIO2_API int neoradio2_toggle_led ( neoradio2_handle handle,
int  device,
int  bank,
int  ms 
)

◆ neoradio2_toggle_led_successful()

LIBNEORADIO2_API int neoradio2_toggle_led_successful ( neoradio2_handle handle,
int  device,
int  bank 
)

◆ neoradio2_write_calibration()

LIBNEORADIO2_API int neoradio2_write_calibration ( neoradio2_handle handle,
int  device,
int  bank,
neoRADIO2frame_calHeader header,
float *  arr,
int  arr_size 
)

◆ neoradio2_write_calibration_points()

LIBNEORADIO2_API int neoradio2_write_calibration_points ( neoradio2_handle handle,
int  device,
int  bank,
neoRADIO2frame_calHeader header,
float *  arr,
int  arr_size 
)

◆ neoradio2_write_calibration_points_successful()

LIBNEORADIO2_API int neoradio2_write_calibration_points_successful ( neoradio2_handle handle,
int  device,
int  bank 
)

◆ neoradio2_write_calibration_successful()

LIBNEORADIO2_API int neoradio2_write_calibration_successful ( neoradio2_handle handle,
int  device,
int  bank 
)

◆ neoradio2_write_sensor()

LIBNEORADIO2_API int neoradio2_write_sensor ( neoradio2_handle handle,
int  device,
int  bank,
int  mask,
int  value 
)

◆ neoradio2_write_sensor_successful()

LIBNEORADIO2_API int neoradio2_write_sensor_successful ( neoradio2_handle handle,
int  device,
int  bank 
)

◆ neoradio2_write_settings()

LIBNEORADIO2_API int neoradio2_write_settings ( neoradio2_handle handle,
int  device,
int  bank,
neoRADIO2_settings settings 
)

◆ neoradio2_write_settings_successful()

LIBNEORADIO2_API int neoradio2_write_settings_successful ( neoradio2_handle handle,
int  device,
int  bank 
)