\hypertarget{group__deprecated__items}{}\doxysubsection{$<$compat/deprecated.h$>$\+: Deprecated items}
\label{group__deprecated__items}\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxysubsubsection*{Allowing specific system-\/wide interrupts}
\label{_amgrp193128e5bbdec1bc980f5611231d3b55}%
In addition to globally enabling interrupts, each device\textquotesingle{}s particular interrupt needs to be enabled separately if interrupts for this device are desired. While some devices maintain their interrupt enable bit inside the device\textquotesingle{}s register set, external and timer interrupts have system-\/wide configuration registers.

Example\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{// Enable timer 1 overflow interrupts.}}
\DoxyCodeLine{\mbox{\hyperlink{group__deprecated__items_ga46f0b87ccc2ab63dea1ff28207270b82}{timer\_enable\_int}}(\mbox{\hyperlink{group__avr__sfr_ga11643f271076024c395a93800b3d9546}{\_BV}}(TOIE1));}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{// Do some work...}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{// Disable all timer interrupts.}}
\DoxyCodeLine{\mbox{\hyperlink{group__deprecated__items_ga46f0b87ccc2ab63dea1ff28207270b82}{timer\_enable\_int}}(0);}
\end{DoxyCode}


\begin{DoxyNote}{Note}
Be careful when you use these functions. If you already have a different interrupt enabled, you could inadvertantly disable it by enabling another intterupt. 
\end{DoxyNote}
\begin{DoxyCompactItemize}
\item 
static \+\_\+\+\_\+inline\+\_\+\+\_\+ void \mbox{\hyperlink{group__deprecated__items_ga46f0b87ccc2ab63dea1ff28207270b82}{timer\+\_\+enable\+\_\+int}} (unsigned char ints)
\item 
\#define \mbox{\hyperlink{group__deprecated__items_ga9a3fe82a7199e9e84f7be6a5f23127bc}{enable\+\_\+external\+\_\+int}}(mask)~(\+\_\+\+\_\+\+E\+I\+CR = mask)
\item 
\#define \mbox{\hyperlink{group__deprecated__items_gaa0b2d3a87492967c01615f32f30d06d5}{I\+N\+T\+E\+R\+R\+U\+PT}}(signame)
\item 
\mbox{\Hypertarget{group__deprecated__items_ga65483663c17f94d50d9e24e277bd7bbb}\label{group__deprecated__items_ga65483663c17f94d50d9e24e277bd7bbb}} 
\#define {\bfseries \+\_\+\+\_\+\+I\+N\+T\+R\+\_\+\+A\+T\+T\+RS}~used
\end{DoxyCompactItemize}
\doxysubsubsection*{Obsolete IO macros}
\label{_amgrpaf1202294281a87ab5300af3ed2225e0}%
Back in a time when A\+V\+R-\/\+G\+CC and avr-\/libc could not handle IO port access in the direct assignment form as they are handled now, all IO port access had to be done through specific macros that eventually resulted in inline assembly instructions performing the desired action.

These macros became obsolete, as reading and writing IO ports can be done by simply using the IO port name in an expression, and all bit manipulation (including those on IO ports) can be done using generic C bit manipulation operators.

The macros in this group simulate the historical behaviour. While they are supposed to be applied to IO ports, the emulation actually uses standard C methods, so they could be applied to arbitrary memory locations as well. \begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{group__deprecated__items_ga5cfa4750a0633c34c7a361d8fd62c042}{inp}}(port)~(port)
\item 
\#define \mbox{\hyperlink{group__deprecated__items_gaab324bd721e821e275f00c3478e240c9}{outp}}(val,  port)~(port) = (val)
\item 
\#define \mbox{\hyperlink{group__deprecated__items_gad6488a48837d179b1833e2f48dac9665}{inb}}(port)~(port)
\item 
\#define \mbox{\hyperlink{group__deprecated__items_ga3a3b4c1ddf0c05701f933d70de330f08}{outb}}(port,  val)~(port) = (val)
\item 
\#define \mbox{\hyperlink{group__deprecated__items_ga014ef751e83f97569c06f3cdd888f3f7}{sbi}}(port,  bit)~(port) $\vert$= (1 $<$$<$ (bit))
\item 
\#define \mbox{\hyperlink{group__deprecated__items_ga08ee265dc07048dbb5a8b6c84551d520}{cbi}}(port,  bit)~(port) \&= $\sim$(1 $<$$<$ (bit))
\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
This header file contains several items that used to be available in previous versions of this library, but have eventually been deprecated over time. 


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <compat/deprecated.h>} }
\end{DoxyCode}


These items are supplied within that header file for backward compatibility reasons only, so old source code that has been written for previous library versions could easily be maintained until its end-\/of-\/life. Use of any of these items in new code is strongly discouraged. 

\doxysubsubsection{Macro Definition Documentation}
\mbox{\Hypertarget{group__deprecated__items_ga08ee265dc07048dbb5a8b6c84551d520}\label{group__deprecated__items_ga08ee265dc07048dbb5a8b6c84551d520}} 
\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}!cbi@{cbi}}
\index{cbi@{cbi}!$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxyparagraph{\texorpdfstring{cbi}{cbi}}
{\footnotesize\ttfamily \#define cbi(\begin{DoxyParamCaption}\item[{}]{port,  }\item[{}]{bit }\end{DoxyParamCaption})~(port) \&= $\sim$(1 $<$$<$ (bit))}

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000011}{Deprecated}}]\end{DoxyRefDesc}


Clear {\ttfamily bit} in IO port {\ttfamily port}. \mbox{\Hypertarget{group__deprecated__items_ga9a3fe82a7199e9e84f7be6a5f23127bc}\label{group__deprecated__items_ga9a3fe82a7199e9e84f7be6a5f23127bc}} 
\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}!enable\_external\_int@{enable\_external\_int}}
\index{enable\_external\_int@{enable\_external\_int}!$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxyparagraph{\texorpdfstring{enable\_external\_int}{enable\_external\_int}}
{\footnotesize\ttfamily \#define enable\+\_\+external\+\_\+int(\begin{DoxyParamCaption}\item[{}]{mask }\end{DoxyParamCaption})~(\+\_\+\+\_\+\+E\+I\+CR = mask)}

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000003}{Deprecated}}]\end{DoxyRefDesc}


This macro gives access to the {\ttfamily G\+I\+M\+SK} register (or {\ttfamily E\+I\+M\+SK} register if using an A\+VR Mega device or {\ttfamily G\+I\+CR} register for others). Although this macro is essentially the same as assigning to the register, it does adapt slightly to the type of device being used. This macro is unavailable if none of the registers listed above are defined. \mbox{\Hypertarget{group__deprecated__items_gad6488a48837d179b1833e2f48dac9665}\label{group__deprecated__items_gad6488a48837d179b1833e2f48dac9665}} 
\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}!inb@{inb}}
\index{inb@{inb}!$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxyparagraph{\texorpdfstring{inb}{inb}}
{\footnotesize\ttfamily \#define inb(\begin{DoxyParamCaption}\item[{}]{port }\end{DoxyParamCaption})~(port)}

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000008}{Deprecated}}]\end{DoxyRefDesc}


Read a value from an IO port {\ttfamily port}. \mbox{\Hypertarget{group__deprecated__items_ga5cfa4750a0633c34c7a361d8fd62c042}\label{group__deprecated__items_ga5cfa4750a0633c34c7a361d8fd62c042}} 
\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}!inp@{inp}}
\index{inp@{inp}!$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxyparagraph{\texorpdfstring{inp}{inp}}
{\footnotesize\ttfamily \#define inp(\begin{DoxyParamCaption}\item[{}]{port }\end{DoxyParamCaption})~(port)}

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000006}{Deprecated}}]\end{DoxyRefDesc}


Read a value from an IO port {\ttfamily port}. \mbox{\Hypertarget{group__deprecated__items_gaa0b2d3a87492967c01615f32f30d06d5}\label{group__deprecated__items_gaa0b2d3a87492967c01615f32f30d06d5}} 
\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}!INTERRUPT@{INTERRUPT}}
\index{INTERRUPT@{INTERRUPT}!$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxyparagraph{\texorpdfstring{INTERRUPT}{INTERRUPT}}
{\footnotesize\ttfamily \#define I\+N\+T\+E\+R\+R\+U\+PT(\begin{DoxyParamCaption}\item[{}]{signame }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordtype}{void} signame (\textcolor{keywordtype}{void}) \mbox{\hyperlink{power_8h_a577a0eebac2a6c2d105e61d9c8f04140}{\_\_attribute\_\_}} ((interrupt,\_\_INTR\_ATTRS));  \(\backslash\)}
\DoxyCodeLine{void signame (\textcolor{keywordtype}{void})}

\end{DoxyCode}
\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000005}{Deprecated}}]\end{DoxyRefDesc}


Introduces an interrupt handler function that runs with global interrupts initially enabled. This allows interrupt handlers to be interrupted.

As this macro has been used by too many unsuspecting people in the past, it has been deprecated, and will be removed in a future version of the library. Users who want to legitimately re-\/enable interrupts in their interrupt handlers as quickly as possible are encouraged to explicitly declare their handlers as described \mbox{\hyperlink{group__avr__interrupts_attr_interrupt}{above}}. \mbox{\Hypertarget{group__deprecated__items_ga3a3b4c1ddf0c05701f933d70de330f08}\label{group__deprecated__items_ga3a3b4c1ddf0c05701f933d70de330f08}} 
\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}!outb@{outb}}
\index{outb@{outb}!$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxyparagraph{\texorpdfstring{outb}{outb}}
{\footnotesize\ttfamily \#define outb(\begin{DoxyParamCaption}\item[{}]{port,  }\item[{}]{val }\end{DoxyParamCaption})~(port) = (val)}

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000009}{Deprecated}}]\end{DoxyRefDesc}


Write {\ttfamily val} to IO port {\ttfamily port}. \mbox{\Hypertarget{group__deprecated__items_gaab324bd721e821e275f00c3478e240c9}\label{group__deprecated__items_gaab324bd721e821e275f00c3478e240c9}} 
\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}!outp@{outp}}
\index{outp@{outp}!$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxyparagraph{\texorpdfstring{outp}{outp}}
{\footnotesize\ttfamily \#define outp(\begin{DoxyParamCaption}\item[{}]{val,  }\item[{}]{port }\end{DoxyParamCaption})~(port) = (val)}

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000007}{Deprecated}}]\end{DoxyRefDesc}


Write {\ttfamily val} to IO port {\ttfamily port}. \mbox{\Hypertarget{group__deprecated__items_ga014ef751e83f97569c06f3cdd888f3f7}\label{group__deprecated__items_ga014ef751e83f97569c06f3cdd888f3f7}} 
\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}!sbi@{sbi}}
\index{sbi@{sbi}!$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxyparagraph{\texorpdfstring{sbi}{sbi}}
{\footnotesize\ttfamily \#define sbi(\begin{DoxyParamCaption}\item[{}]{port,  }\item[{}]{bit }\end{DoxyParamCaption})~(port) $\vert$= (1 $<$$<$ (bit))}

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000010}{Deprecated}}]\end{DoxyRefDesc}


Set {\ttfamily bit} in IO port {\ttfamily port}. 

\doxysubsubsection{Function Documentation}
\mbox{\Hypertarget{group__deprecated__items_ga46f0b87ccc2ab63dea1ff28207270b82}\label{group__deprecated__items_ga46f0b87ccc2ab63dea1ff28207270b82}} 
\index{$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}!timer\_enable\_int@{timer\_enable\_int}}
\index{timer\_enable\_int@{timer\_enable\_int}!$<$compat/deprecated.h$>$: Deprecated items@{$<$compat/deprecated.h$>$: Deprecated items}}
\doxyparagraph{\texorpdfstring{timer\_enable\_int()}{timer\_enable\_int()}}
{\footnotesize\ttfamily static \+\_\+\+\_\+inline\+\_\+\+\_\+ void timer\+\_\+enable\+\_\+int (\begin{DoxyParamCaption}\item[{unsigned char}]{ints }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000004}{Deprecated}}]\end{DoxyRefDesc}


This function modifies the {\ttfamily timsk} register. The value you pass via {\ttfamily ints} is device specific. 