title: How to pass a bitfield and a bit inside it to a function
body: <p>With microcontrollers you usually have a register and its bitfield version that enables you to get access to each pin individually</p>
  
  <p>Suppose i have two objects from two bitfield </p>
  
  <pre><code>struct {
          unsigned a_A:1;
          unsigned b_A:1;
          unsigned c_A:1;
          unsigned d_A:1;
          unsigned e_A:1;
          unsigned f_A:1;
          unsigned g_A:1;
          unsigned h_A:1;
          }A;
  struct {
          unsigned a_B:1;
          unsigned b_B:1;
          unsigned c_B:1;
          unsigned d_B:1;
          unsigned e_B:1;
          unsigned f_B:1;
          unsigned g_B:1;
          unsigned h_B:1;
          }B;
  </code></pre>
  
  <p>how to build a function that accepts a bitfield and one of its bits as parameters
  Just like</p>
  
  <pre><code>void my_func(bitfield,bit_name)
  </code></pre>
  
  <p>bit_name should varies for each type of the bitfields</p>