ads131m_rmw_reg(9)
β¨ ads131m_rmw_reg(9) β¨
okay so this is a page from the Kernel API Manual, bestie β it's ads131m_rmw_reg(9), and it's literally the "peek, tweak, put it back" girlie of the ADS131M driver family. let's get into it π
πΈ NAME πΈ
ads131m_rmw_reg β reads, modifies, and writes a single register. that's it, that's the whole vibe. one register. read it, change it, send it back. iconic behavior honestly π
π¦ SYNOPSIS π¦
int ads131m_rmw_reg (struct ads131m_priv *priv , u8 reg , u16 clear ,
u16 set );
yes she takes four arguments and yes she returns an int. she's lowkey built different β¨
π ARGUMENTS π
privβ the device private data structure. like, the whole personality of the device lives in here, and you're handing her over.regβ the 8-bit register address. so it's au8, keep it in that range, no cap.clearβ bitmask of bits to clear. the "βοΈ not you, not you" list.setβ bitmask of bits to set. the "π you, you, and also you" list.
π₯ DESCRIPTION π₯
so what does she actually do? she performs an atomic read-modify-write operation on a register. the way that works: she reads the register, applies the clear and set masks to it, and then writes the new value back β but only if it has changed. not her wasting a write for nothing, no ma'am. π«Ά
atomic is the key word here babe, don't sleep on it β it's a read-modify-write as one operation, not three separate little errands. π§
β RETURN β
0on success β slay, we ate π- a negative error code β something's giving wrong, go check it π
π SEE ALSO π
kernel file: ./drivers/iio/adc/ti-ads131m02.c β that's where the actual code hangs out, go say hi π
and the whole friend group, fr fr:
ads131m_tx_frame_unlocked(9)ads131m_rx_frame_unlocked(9)ads131m_check_status_crc_err(9)ads131m_write_reg_unlocked(9)ads131m_read_reg_unlocked(9)ads131m_verify_output_crc(9)ads131m_adc_read(9)ads131m_hw_reset(9)ads131m_sw_reset(9)ads131m_reset(9)ads131m_hw_init(9)ads131m_parse_clock(9)
okay that's the page!! mwah π this one lives in ./drivers/iio/adc and the date on it is October 2026, so likeβ¦ future girlie behavior honestly β³β¨ stay hydrated, read your registers atomically, and remember: clear the bits you don't want, set the bits you do. periodt. ππ¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms