AVR-LibC  2.2.0
Standard C library for AVR-GCC
 

AVR-LibC Documentation

Logo

AVR-LibC Development Pages

Main Page

User Manual

Library Reference

FAQ

Example Projects

File List

Loading...
Searching...
No Matches
builtins.h
Go to the documentation of this file.
1/* Copyright (c) 2008 Anatoly Sokolov
2 Copyright (c) 2010 Joerg Wunsch
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7
8 * Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10
11 * Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in
13 the documentation and/or other materials provided with the
14 distribution.
15
16 * Neither the name of the copyright holders nor the names of
17 contributors may be used to endorse or promote products derived
18 from this software without specific prior written permission.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE. */
31
32/* $Id$ */
33
34/*
35 avr/builtins.h - Intrinsic functions built into the compiler
36 */
37
38#ifndef _AVR_BUILTINS_H_
39#define _AVR_BUILTINS_H_
40
41#ifndef __HAS_DELAY_CYCLES
42#define __HAS_DELAY_CYCLES 1
43#endif
44
45/* For GCC built-ins, we should not define prototypes,
46 hence only document that stuff. */
47#ifdef __DOXYGEN__
48
49/** \file */
50/** \defgroup avr_builtins <avr/builtins.h>: avr-gcc builtins documentation
51 \code #include <avr/builtins.h> \endcode
52
53 \note This file only documents some avr-gcc builtins.
54 For functions built-in in the compiler, there should be no
55 prototype declarations.
56
57 See also the
58 <a href="https://gcc.gnu.org/onlinedocs/gcc/AVR-Built-in-Functions.html"
59 >GCC documentation</a> for a full list of avr-gcc builtins.
60*/
61
62/**
63 \ingroup avr_builtins
64
65 Enables interrupts by setting the global interrupt mask. */
66extern void __builtin_avr_sei(void);
67
68/**
69 \ingroup avr_builtins
70
71 Disables all interrupts by clearing the global interrupt mask. */
72extern void __builtin_avr_cli(void);
73
74/**
75 \ingroup avr_builtins
76
77 Emits a \c SLEEP instruction. */
78
79extern void __builtin_avr_sleep(void);
80
81/**
82 \ingroup avr_builtins
83
84 Emits a WDR (watchdog reset) instruction. */
85extern void __builtin_avr_wdr(void);
86
87/**
88 \ingroup avr_builtins
89
90 Emits a SWAP (nibble swap) instruction on __b. */
92
93/**
94 \ingroup avr_builtins
95
96 Emits an FMUL (fractional multiply unsigned) instruction. */
98
99/**
100 \ingroup avr_builtins
101
102 Emits an FMUL (fractional multiply signed) instruction. */
104
105/**
106 \ingroup avr_builtins
107
108 Emits an FMUL (fractional multiply signed with unsigned) instruction. */
110
111#if __HAS_DELAY_CYCLES
112/**
113 \ingroup avr_builtins
114
115 Emits a sequence of instructions causing the CPU to spend
116 \c __n cycles on it. */
117extern void __builtin_avr_delay_cycles(uint32_t __n);
118#endif
119#endif /* DOXYGEN */
120#endif /* _AVR_BUILTINS_H_ */
int16_t __builtin_avr_fmulsu(int8_t __a, uint8_t __b)
int16_t __builtin_avr_fmuls(int8_t __a, int8_t __b)
void __builtin_avr_cli(void)
uint8_t __builtin_avr_swap(uint8_t __b)
void __builtin_avr_wdr(void)
uint16_t __builtin_avr_fmul(uint8_t __a, uint8_t __b)
void __builtin_avr_sei(void)
void __builtin_avr_sleep(void)
unsigned int uint16_t
Definition: stdint.h:93
unsigned long int uint32_t
Definition: stdint.h:103
signed int int16_t
Definition: stdint.h:88
unsigned char uint8_t
Definition: stdint.h:83
signed char int8_t
Definition: stdint.h:78