LIS3DH.Registers (lis3dh v0.1.0)

Copy Markdown

Raw register accessors for the LIS3DH.

Each function reads or writes a single 8-bit register. Higher-level helpers in LIS3DH and friends interpret the bytes as signed integers, scaled physical quantities, or named bit-fields.

Register addresses, access modes and bit layouts are taken from LIS3DH Datasheet DocID17530 Rev 2 §7 Register mapping and §8 Registers description.

Summary

Functions

Read the contents of the act_dur register.

Read the contents of the act_ths register.

Read the contents of the click_cfg register.

Read the contents of the click_src register.

Read the contents of the click_ths register.

Read the contents of the ctrl_reg_0 register.

Read the contents of the ctrl_reg_1 register.

Read the contents of the ctrl_reg_2 register.

Read the contents of the ctrl_reg_3 register.

Read the contents of the ctrl_reg_4 register.

Read the contents of the ctrl_reg_5 register.

Read the contents of the ctrl_reg_6 register.

Read the contents of the fifo_ctrl_reg register.

Read the contents of the fifo_src_reg register.

Read the contents of the int1_cfg register.

Read the contents of the int1_duration register.

Read the contents of the int1_src register.

Read the contents of the int1_ths register.

Read the contents of the int2_cfg register.

Read the contents of the int2_duration register.

Read the contents of the int2_src register.

Read the contents of the int2_ths register.

Read the contents of the out_adc1_h register.

Read the contents of the out_adc1_l register.

Read the contents of the out_adc2_h register.

Read the contents of the out_adc2_l register.

Read the contents of the out_adc3_h register.

Read the contents of the out_adc3_l register.

Read the contents of the out_x_h register.

Read the contents of the out_x_l register.

Read the contents of the out_y_h register.

Read the contents of the out_y_l register.

Read the contents of the out_z_h register.

Read the contents of the out_z_l register.

Read the contents of the reference register.

Read the contents of the status_reg register.

Read the contents of the status_reg_aux register.

Read the contents of the temp_cfg_reg register.

Read the contents of the time_latency register.

Read the contents of the time_limit register.

Read the contents of the time_window register.

Read the contents of the who_am_i register.

Swap the contents of the act_dur register.

Swap the contents of the act_ths register.

Swap the contents of the click_cfg register.

Swap the contents of the click_ths register.

Swap the contents of the ctrl_reg_0 register.

Swap the contents of the ctrl_reg_1 register.

Swap the contents of the ctrl_reg_2 register.

Swap the contents of the ctrl_reg_3 register.

Swap the contents of the ctrl_reg_4 register.

Swap the contents of the ctrl_reg_5 register.

Swap the contents of the ctrl_reg_6 register.

Swap the contents of the fifo_ctrl_reg register.

Swap the contents of the int1_cfg register.

Swap the contents of the int1_duration register.

Swap the contents of the int1_ths register.

Swap the contents of the int2_cfg register.

Swap the contents of the int2_duration register.

Swap the contents of the int2_ths register.

Swap the contents of the reference register.

Swap the contents of the temp_cfg_reg register.

Swap the contents of the time_latency register.

Swap the contents of the time_limit register.

Swap the contents of the time_window register.

Update the contents of the act_dur register using a transformation function.

Update the contents of the act_ths register using a transformation function.

Update the contents of the click_cfg register using a transformation function.

Update the contents of the click_ths register using a transformation function.

Update the contents of the ctrl_reg_0 register using a transformation function.

Update the contents of the ctrl_reg_1 register using a transformation function.

Update the contents of the ctrl_reg_2 register using a transformation function.

Update the contents of the ctrl_reg_3 register using a transformation function.

Update the contents of the ctrl_reg_4 register using a transformation function.

Update the contents of the ctrl_reg_5 register using a transformation function.

Update the contents of the ctrl_reg_6 register using a transformation function.

Update the contents of the fifo_ctrl_reg register using a transformation function.

Update the contents of the int1_cfg register using a transformation function.

Update the contents of the int1_duration register using a transformation function.

Update the contents of the int1_ths register using a transformation function.

Update the contents of the int2_cfg register using a transformation function.

Update the contents of the int2_duration register using a transformation function.

Update the contents of the int2_ths register using a transformation function.

Update the contents of the reference register using a transformation function.

Update the contents of the temp_cfg_reg register using a transformation function.

Update the contents of the time_latency register using a transformation function.

Update the contents of the time_limit register using a transformation function.

Update the contents of the time_window register using a transformation function.

Write new contents to the act_dur register.

Write new contents to the act_ths register.

Write new contents to the click_cfg register.

Write new contents to the click_ths register.

Write new contents to the ctrl_reg_0 register.

Write new contents to the ctrl_reg_1 register.

Write new contents to the ctrl_reg_2 register.

Write new contents to the ctrl_reg_3 register.

Write new contents to the ctrl_reg_4 register.

Write new contents to the ctrl_reg_5 register.

Write new contents to the ctrl_reg_6 register.

Write new contents to the fifo_ctrl_reg register.

Write new contents to the int1_cfg register.

Write new contents to the int1_duration register.

Write new contents to the int1_ths register.

Write new contents to the int2_cfg register.

Write new contents to the int2_duration register.

Write new contents to the int2_ths register.

Write new contents to the reference register.

Write new contents to the temp_cfg_reg register.

Write new contents to the time_latency register.

Write new contents to the time_limit register.

Write new contents to the time_window register.

Functions

read_act_dur(conn)

@spec read_act_dur(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the act_dur register.

Example

iex> read_act_dur(conn)
{:ok, <<0>>}

read_act_ths(conn)

@spec read_act_ths(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the act_ths register.

Example

iex> read_act_ths(conn)
{:ok, <<0>>}

read_click_cfg(conn)

@spec read_click_cfg(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the click_cfg register.

Example

iex> read_click_cfg(conn)
{:ok, <<0>>}

read_click_src(conn)

@spec read_click_src(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the click_src register.

Example

iex> read_click_src(conn)
{:ok, <<0>>}

read_click_ths(conn)

@spec read_click_ths(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the click_ths register.

Example

iex> read_click_ths(conn)
{:ok, <<0>>}

read_ctrl_reg_0(conn)

@spec read_ctrl_reg_0(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the ctrl_reg_0 register.

Example

iex> read_ctrl_reg_0(conn)
{:ok, <<0>>}

read_ctrl_reg_1(conn)

@spec read_ctrl_reg_1(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the ctrl_reg_1 register.

Example

iex> read_ctrl_reg_1(conn)
{:ok, <<0>>}

read_ctrl_reg_2(conn)

@spec read_ctrl_reg_2(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the ctrl_reg_2 register.

Example

iex> read_ctrl_reg_2(conn)
{:ok, <<0>>}

read_ctrl_reg_3(conn)

@spec read_ctrl_reg_3(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the ctrl_reg_3 register.

Example

iex> read_ctrl_reg_3(conn)
{:ok, <<0>>}

read_ctrl_reg_4(conn)

@spec read_ctrl_reg_4(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the ctrl_reg_4 register.

Example

iex> read_ctrl_reg_4(conn)
{:ok, <<0>>}

read_ctrl_reg_5(conn)

@spec read_ctrl_reg_5(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the ctrl_reg_5 register.

Example

iex> read_ctrl_reg_5(conn)
{:ok, <<0>>}

read_ctrl_reg_6(conn)

@spec read_ctrl_reg_6(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the ctrl_reg_6 register.

Example

iex> read_ctrl_reg_6(conn)
{:ok, <<0>>}

read_fifo_ctrl_reg(conn)

@spec read_fifo_ctrl_reg(Wafer.Conn.t()) ::
  {:ok, binary()} | {:error, reason :: any()}

Read the contents of the fifo_ctrl_reg register.

Example

iex> read_fifo_ctrl_reg(conn)
{:ok, <<0>>}

read_fifo_src_reg(conn)

@spec read_fifo_src_reg(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the fifo_src_reg register.

Example

iex> read_fifo_src_reg(conn)
{:ok, <<0>>}

read_int1_cfg(conn)

@spec read_int1_cfg(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the int1_cfg register.

Example

iex> read_int1_cfg(conn)
{:ok, <<0>>}

read_int1_duration(conn)

@spec read_int1_duration(Wafer.Conn.t()) ::
  {:ok, binary()} | {:error, reason :: any()}

Read the contents of the int1_duration register.

Example

iex> read_int1_duration(conn)
{:ok, <<0>>}

read_int1_src(conn)

@spec read_int1_src(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the int1_src register.

Example

iex> read_int1_src(conn)
{:ok, <<0>>}

read_int1_ths(conn)

@spec read_int1_ths(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the int1_ths register.

Example

iex> read_int1_ths(conn)
{:ok, <<0>>}

read_int2_cfg(conn)

@spec read_int2_cfg(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the int2_cfg register.

Example

iex> read_int2_cfg(conn)
{:ok, <<0>>}

read_int2_duration(conn)

@spec read_int2_duration(Wafer.Conn.t()) ::
  {:ok, binary()} | {:error, reason :: any()}

Read the contents of the int2_duration register.

Example

iex> read_int2_duration(conn)
{:ok, <<0>>}

read_int2_src(conn)

@spec read_int2_src(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the int2_src register.

Example

iex> read_int2_src(conn)
{:ok, <<0>>}

read_int2_ths(conn)

@spec read_int2_ths(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the int2_ths register.

Example

iex> read_int2_ths(conn)
{:ok, <<0>>}

read_out_adc1_h(conn)

@spec read_out_adc1_h(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_adc1_h register.

Example

iex> read_out_adc1_h(conn)
{:ok, <<0>>}

read_out_adc1_l(conn)

@spec read_out_adc1_l(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_adc1_l register.

Example

iex> read_out_adc1_l(conn)
{:ok, <<0>>}

read_out_adc2_h(conn)

@spec read_out_adc2_h(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_adc2_h register.

Example

iex> read_out_adc2_h(conn)
{:ok, <<0>>}

read_out_adc2_l(conn)

@spec read_out_adc2_l(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_adc2_l register.

Example

iex> read_out_adc2_l(conn)
{:ok, <<0>>}

read_out_adc3_h(conn)

@spec read_out_adc3_h(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_adc3_h register.

Example

iex> read_out_adc3_h(conn)
{:ok, <<0>>}

read_out_adc3_l(conn)

@spec read_out_adc3_l(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_adc3_l register.

Example

iex> read_out_adc3_l(conn)
{:ok, <<0>>}

read_out_x_h(conn)

@spec read_out_x_h(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_x_h register.

Example

iex> read_out_x_h(conn)
{:ok, <<0>>}

read_out_x_l(conn)

@spec read_out_x_l(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_x_l register.

Example

iex> read_out_x_l(conn)
{:ok, <<0>>}

read_out_y_h(conn)

@spec read_out_y_h(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_y_h register.

Example

iex> read_out_y_h(conn)
{:ok, <<0>>}

read_out_y_l(conn)

@spec read_out_y_l(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_y_l register.

Example

iex> read_out_y_l(conn)
{:ok, <<0>>}

read_out_z_h(conn)

@spec read_out_z_h(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_z_h register.

Example

iex> read_out_z_h(conn)
{:ok, <<0>>}

read_out_z_l(conn)

@spec read_out_z_l(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the out_z_l register.

Example

iex> read_out_z_l(conn)
{:ok, <<0>>}

read_reference(conn)

@spec read_reference(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the reference register.

Example

iex> read_reference(conn)
{:ok, <<0>>}

read_status_reg(conn)

@spec read_status_reg(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the status_reg register.

Example

iex> read_status_reg(conn)
{:ok, <<0>>}

read_status_reg_aux(conn)

@spec read_status_reg_aux(Wafer.Conn.t()) ::
  {:ok, binary()} | {:error, reason :: any()}

Read the contents of the status_reg_aux register.

Example

iex> read_status_reg_aux(conn)
{:ok, <<0>>}

read_temp_cfg_reg(conn)

@spec read_temp_cfg_reg(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the temp_cfg_reg register.

Example

iex> read_temp_cfg_reg(conn)
{:ok, <<0>>}

read_time_latency(conn)

@spec read_time_latency(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the time_latency register.

Example

iex> read_time_latency(conn)
{:ok, <<0>>}

read_time_limit(conn)

@spec read_time_limit(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the time_limit register.

Example

iex> read_time_limit(conn)
{:ok, <<0>>}

read_time_window(conn)

@spec read_time_window(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the time_window register.

Example

iex> read_time_window(conn)
{:ok, <<0>>}

read_who_am_i(conn)

@spec read_who_am_i(Wafer.Conn.t()) :: {:ok, binary()} | {:error, reason :: any()}

Read the contents of the who_am_i register.

Example

iex> read_who_am_i(conn)
{:ok, <<0>>}

swap_act_dur(conn, data)

@spec swap_act_dur(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the act_dur register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_act_dur(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_act_ths(conn, data)

@spec swap_act_ths(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the act_ths register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_act_ths(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_click_cfg(conn, data)

@spec swap_click_cfg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the click_cfg register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_click_cfg(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_click_ths(conn, data)

@spec swap_click_ths(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the click_ths register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_click_ths(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_ctrl_reg_0(conn, data)

@spec swap_ctrl_reg_0(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the ctrl_reg_0 register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_ctrl_reg_0(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_ctrl_reg_1(conn, data)

@spec swap_ctrl_reg_1(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the ctrl_reg_1 register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_ctrl_reg_1(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_ctrl_reg_2(conn, data)

@spec swap_ctrl_reg_2(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the ctrl_reg_2 register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_ctrl_reg_2(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_ctrl_reg_3(conn, data)

@spec swap_ctrl_reg_3(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the ctrl_reg_3 register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_ctrl_reg_3(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_ctrl_reg_4(conn, data)

@spec swap_ctrl_reg_4(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the ctrl_reg_4 register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_ctrl_reg_4(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_ctrl_reg_5(conn, data)

@spec swap_ctrl_reg_5(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the ctrl_reg_5 register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_ctrl_reg_5(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_ctrl_reg_6(conn, data)

@spec swap_ctrl_reg_6(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the ctrl_reg_6 register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_ctrl_reg_6(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_fifo_ctrl_reg(conn, data)

@spec swap_fifo_ctrl_reg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the fifo_ctrl_reg register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_fifo_ctrl_reg(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_int1_cfg(conn, data)

@spec swap_int1_cfg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the int1_cfg register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_int1_cfg(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_int1_duration(conn, data)

@spec swap_int1_duration(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the int1_duration register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_int1_duration(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_int1_ths(conn, data)

@spec swap_int1_ths(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the int1_ths register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_int1_ths(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_int2_cfg(conn, data)

@spec swap_int2_cfg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the int2_cfg register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_int2_cfg(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_int2_duration(conn, data)

@spec swap_int2_duration(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the int2_duration register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_int2_duration(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_int2_ths(conn, data)

@spec swap_int2_ths(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the int2_ths register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_int2_ths(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_reference(conn, data)

@spec swap_reference(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the reference register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_reference(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_temp_cfg_reg(conn, data)

@spec swap_temp_cfg_reg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the temp_cfg_reg register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_temp_cfg_reg(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_time_latency(conn, data)

@spec swap_time_latency(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the time_latency register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_time_latency(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_time_limit(conn, data)

@spec swap_time_limit(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the time_limit register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_time_limit(conn, <<0>>)
{:ok, <<0>>, _conn}

swap_time_window(conn, data)

@spec swap_time_window(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Swap the contents of the time_window register.

Reads the contents of the register, then replaces it, returning the previous contents. Some drivers may implement this atomically.

Example

iex> swap_time_window(conn, <<0>>)
{:ok, <<0>>, _conn}

update_act_dur(conn, callback)

@spec update_act_dur(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the act_dur register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_act_dur(conn, transform)
{:ok, _conn}

update_act_ths(conn, callback)

@spec update_act_ths(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the act_ths register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_act_ths(conn, transform)
{:ok, _conn}

update_click_cfg(conn, callback)

@spec update_click_cfg(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the click_cfg register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_click_cfg(conn, transform)
{:ok, _conn}

update_click_ths(conn, callback)

@spec update_click_ths(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the click_ths register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_click_ths(conn, transform)
{:ok, _conn}

update_ctrl_reg_0(conn, callback)

@spec update_ctrl_reg_0(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the ctrl_reg_0 register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_ctrl_reg_0(conn, transform)
{:ok, _conn}

update_ctrl_reg_1(conn, callback)

@spec update_ctrl_reg_1(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the ctrl_reg_1 register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_ctrl_reg_1(conn, transform)
{:ok, _conn}

update_ctrl_reg_2(conn, callback)

@spec update_ctrl_reg_2(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the ctrl_reg_2 register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_ctrl_reg_2(conn, transform)
{:ok, _conn}

update_ctrl_reg_3(conn, callback)

@spec update_ctrl_reg_3(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the ctrl_reg_3 register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_ctrl_reg_3(conn, transform)
{:ok, _conn}

update_ctrl_reg_4(conn, callback)

@spec update_ctrl_reg_4(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the ctrl_reg_4 register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_ctrl_reg_4(conn, transform)
{:ok, _conn}

update_ctrl_reg_5(conn, callback)

@spec update_ctrl_reg_5(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the ctrl_reg_5 register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_ctrl_reg_5(conn, transform)
{:ok, _conn}

update_ctrl_reg_6(conn, callback)

@spec update_ctrl_reg_6(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the ctrl_reg_6 register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_ctrl_reg_6(conn, transform)
{:ok, _conn}

update_fifo_ctrl_reg(conn, callback)

@spec update_fifo_ctrl_reg(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the fifo_ctrl_reg register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_fifo_ctrl_reg(conn, transform)
{:ok, _conn}

update_int1_cfg(conn, callback)

@spec update_int1_cfg(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the int1_cfg register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_int1_cfg(conn, transform)
{:ok, _conn}

update_int1_duration(conn, callback)

@spec update_int1_duration(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the int1_duration register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_int1_duration(conn, transform)
{:ok, _conn}

update_int1_ths(conn, callback)

@spec update_int1_ths(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the int1_ths register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_int1_ths(conn, transform)
{:ok, _conn}

update_int2_cfg(conn, callback)

@spec update_int2_cfg(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the int2_cfg register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_int2_cfg(conn, transform)
{:ok, _conn}

update_int2_duration(conn, callback)

@spec update_int2_duration(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the int2_duration register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_int2_duration(conn, transform)
{:ok, _conn}

update_int2_ths(conn, callback)

@spec update_int2_ths(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the int2_ths register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_int2_ths(conn, transform)
{:ok, _conn}

update_reference(conn, callback)

@spec update_reference(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the reference register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_reference(conn, transform)
{:ok, _conn}

update_temp_cfg_reg(conn, callback)

@spec update_temp_cfg_reg(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the temp_cfg_reg register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_temp_cfg_reg(conn, transform)
{:ok, _conn}

update_time_latency(conn, callback)

@spec update_time_latency(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the time_latency register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_time_latency(conn, transform)
{:ok, _conn}

update_time_limit(conn, callback)

@spec update_time_limit(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the time_limit register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_time_limit(conn, transform)
{:ok, _conn}

update_time_window(conn, callback)

@spec update_time_window(Wafer.Conn.t(), (<<_::_*8>> -> <<_::_*8>>)) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Update the contents of the time_window register using a transformation function.

Example

iex> transform = fn <<data::size(8)>> -> <<(data * 2)::size(8)>> end
...> update_time_window(conn, transform)
{:ok, _conn}

write_act_dur(conn, data)

@spec write_act_dur(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the act_dur register.

Example

iex> write_act_dur(conn, <<0>>)
{:ok, _conn}

write_act_ths(conn, data)

@spec write_act_ths(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the act_ths register.

Example

iex> write_act_ths(conn, <<0>>)
{:ok, _conn}

write_click_cfg(conn, data)

@spec write_click_cfg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the click_cfg register.

Example

iex> write_click_cfg(conn, <<0>>)
{:ok, _conn}

write_click_ths(conn, data)

@spec write_click_ths(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the click_ths register.

Example

iex> write_click_ths(conn, <<0>>)
{:ok, _conn}

write_ctrl_reg_0(conn, data)

@spec write_ctrl_reg_0(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the ctrl_reg_0 register.

Example

iex> write_ctrl_reg_0(conn, <<0>>)
{:ok, _conn}

write_ctrl_reg_1(conn, data)

@spec write_ctrl_reg_1(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the ctrl_reg_1 register.

Example

iex> write_ctrl_reg_1(conn, <<0>>)
{:ok, _conn}

write_ctrl_reg_2(conn, data)

@spec write_ctrl_reg_2(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the ctrl_reg_2 register.

Example

iex> write_ctrl_reg_2(conn, <<0>>)
{:ok, _conn}

write_ctrl_reg_3(conn, data)

@spec write_ctrl_reg_3(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the ctrl_reg_3 register.

Example

iex> write_ctrl_reg_3(conn, <<0>>)
{:ok, _conn}

write_ctrl_reg_4(conn, data)

@spec write_ctrl_reg_4(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the ctrl_reg_4 register.

Example

iex> write_ctrl_reg_4(conn, <<0>>)
{:ok, _conn}

write_ctrl_reg_5(conn, data)

@spec write_ctrl_reg_5(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the ctrl_reg_5 register.

Example

iex> write_ctrl_reg_5(conn, <<0>>)
{:ok, _conn}

write_ctrl_reg_6(conn, data)

@spec write_ctrl_reg_6(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the ctrl_reg_6 register.

Example

iex> write_ctrl_reg_6(conn, <<0>>)
{:ok, _conn}

write_fifo_ctrl_reg(conn, data)

@spec write_fifo_ctrl_reg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the fifo_ctrl_reg register.

Example

iex> write_fifo_ctrl_reg(conn, <<0>>)
{:ok, _conn}

write_int1_cfg(conn, data)

@spec write_int1_cfg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the int1_cfg register.

Example

iex> write_int1_cfg(conn, <<0>>)
{:ok, _conn}

write_int1_duration(conn, data)

@spec write_int1_duration(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the int1_duration register.

Example

iex> write_int1_duration(conn, <<0>>)
{:ok, _conn}

write_int1_ths(conn, data)

@spec write_int1_ths(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the int1_ths register.

Example

iex> write_int1_ths(conn, <<0>>)
{:ok, _conn}

write_int2_cfg(conn, data)

@spec write_int2_cfg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the int2_cfg register.

Example

iex> write_int2_cfg(conn, <<0>>)
{:ok, _conn}

write_int2_duration(conn, data)

@spec write_int2_duration(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the int2_duration register.

Example

iex> write_int2_duration(conn, <<0>>)
{:ok, _conn}

write_int2_ths(conn, data)

@spec write_int2_ths(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the int2_ths register.

Example

iex> write_int2_ths(conn, <<0>>)
{:ok, _conn}

write_reference(conn, data)

@spec write_reference(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the reference register.

Example

iex> write_reference(conn, <<0>>)
{:ok, _conn}

write_temp_cfg_reg(conn, data)

@spec write_temp_cfg_reg(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the temp_cfg_reg register.

Example

iex> write_temp_cfg_reg(conn, <<0>>)
{:ok, _conn}

write_time_latency(conn, data)

@spec write_time_latency(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the time_latency register.

Example

iex> write_time_latency(conn, <<0>>)
{:ok, _conn}

write_time_limit(conn, data)

@spec write_time_limit(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the time_limit register.

Example

iex> write_time_limit(conn, <<0>>)
{:ok, _conn}

write_time_window(conn, data)

@spec write_time_window(Wafer.Conn.t(), data :: binary()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Write new contents to the time_window register.

Example

iex> write_time_window(conn, <<0>>)
{:ok, _conn}