xtos_ bci_ get_ config
Queries and strictly validates v1 configuration and firmware/register readback; pinned v1.0.2 supports the eight-channel 250 Hz Cyton profile.
On this page
Declaration
#include <xtos/bci.h>
int xtos_bci_get_config(xtos_bci_session_t *session,
struct xtos_bci_config_v1 *out);Parameters
| Parameter | Type | Description |
|---|---|---|
| session | xtos_bci_session_t * | Non-NULL, caller-managed lifetime; externally serialize access. |
| out | struct xtos_bci_config_v1 * | Non-NULL caller-owned output structure; every byte remains unchanged on failure. |
Output fields
| Field | Type | Meaning |
|---|---|---|
| version | uint32_t | ABI version, dimensionless; must be 1. |
| flags | uint32_t | Flags, dimensionless; zero in v1. |
| channels | uint32_t | Channel count; the validated profile requires 8. |
| sample_rate_hz | uint32_t | Sampling rate in Hz; the validated profile requires 250. |
| enabled_mask | uint32_t | Dimensionless enabled-channel mask; bits 0..7 represent channels 0..7 and agree with CHnSET power-down bits. |
| capabilities | uint32_t | Dimensionless capability bits: CONFIG_READBACK=1, FIRMWARE_READBACK=2, GAIN_CONTROL=4, IMPEDANCE=8, SELF_TEST=16; the first two are required, unknown bits rejected. The pinned Cyton path does not advertise impedance/self-test. |
| reserved0 | uint32_t[2] | Reserved, dimensionless; both elements are zero. |
| generation | uint64_t | Dimensionless nonzero configuration generation; increases on successful verified commits during the device lifetime, even for unchanged readbacks. It is not a unique board ID. |
| gain | uint32_t[8] | Per-channel dimensionless gain; each is 1, 2, 4, 6, 8, 12, or 24 and agrees with register readback. |
| registers | uint8_t[24] | 24 actual ADS register bytes, dimensionless; CONFIG1 low three bits equal 6 and CHnSET validates gains and enable state. |
| firmware | char[256] | Firmware banner, no unit; nonempty and NUL-terminated, with printable ASCII or CR/LF before NUL. It is not unique device identity. |
| reserved | uint32_t[8] | Reserved, dimensionless; all eight elements are zero. |
Return value
Returns 0 and copies validated configuration on success; -1/errno on failure with out unchanged.
Errors
| errno | Condition |
|---|---|
| EINVAL | session/out is NULL. |
| EPROTO | Invalid version, reserved fields, capabilities, gain/enable readback, firmware string, or fixed profile. |
| ENODATA/ENODEV/ENOTTY/EOPNOTSUPP/system errno | Configuration is unverified, device disconnected, interface unsupported, or underlying ioctl failed. |
Notes
- Externally serialize every API on one session; the SDK has no internal lock. Calls may block or allocate and establish no real-time deadline guarantee.
- Internally sets only request version=1. Cyton returns the driver-retained last verified configuration; this call does not issue a serial register query, commit a new generation, or reset the board. It is not the old GET_INFO cache; configuration updates occur during initialization, START, or successful configuration transactions.
- The native-endian configuration is 384 bytes; API presence does not establish calibration or impedance capability.
Example
#include <xtos/bci.h>
int query_config(xtos_bci_session_t *s) {
struct xtos_bci_config_v1 config;
return xtos_bci_get_config(s, &config);
}Source
This reference describes headers and implementation in OpenXTOS v1.0.2 (c24e923717670c4724cdaf24c7c105caee8dc2fb).