title: Typedef nested structure in union, .c and .h file
body: <p>How I should declare this union in header file?</p>
  
  <pre><code>#include &lt;avr/io.h&gt;
  #include &lt;stdint.h&gt;
  #include &lt;stdio.h&gt;
  #include "i2c_twi.h"
  
  #define DS3231_ADDR 0xd0
  
  typedef union {
      uint8_t bytes[7];
      struct{
           uint8_t ss;
           uint8_t mm;
           uint8_t hh;
           uint8_t dayOfWeek;
           uint8_t day;
           uint8_t month;
           uint8_t year;
       };
   } TDATETIME;
  
   TDATETIME dateTime;
  </code></pre>
  
  <p>I declare it this way and I can't use <code>dataTime</code> in my main function:</p>
  
  <pre><code>#include &lt;stdint.h&gt;
  #ifndef DS3231_H_
  #define DS3231_H_
  
  typedef union _TDATETIME TDATETIME
  
  #endif /* DS3231_H_ */
  </code></pre>
  
  <p>Compiler generates the following error:</p>
  
  <pre><code>../main.c:42:26: error: ‘dateTime’ undeclared (first use in this function)
  DS3231_get_dateTime( &amp;dateTime );
  </code></pre>