lnls-dig / halcs

Hardware Abstraction Layer for Control Systems
GNU General Public License v3.0
1 stars 4 forks source link

[smio:all] replace smio_thsafe_read/write to SET/GET_PARAM macros #111

Open lerwys opened 8 years ago

lerwys commented 8 years ago

Issue by lerwys Friday Nov 06, 2015 at 03:10 GMT Originally opened as https://github.com/lnls-dig/bpm-sw/issues/111


Problem: Typically, we need to change register fields, which occupies some bits of a register. In order to not modify other fields, we must read the whole register first an change only the bits corresponding to that field. This is the regular way way doing this. The issue is that it is easy to use the smio_thsafeclient() of functions and change the whole register.

Solution: Use the rw_param macros like SET_PARAM and GET_PARAM to read/write only specifc register fields.