COSA
An Object-Oriented Platform for Arduino Programming
|
#include <avr/io.h>
#include <avr/sleep.h>
#include <avr/eeprom.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/sfr_defs.h>
#include <util/delay_basic.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "Cosa/Errno.h"
#include "Cosa/Board.hh"
#include "Cosa.h"
Go to the source code of this file.
Classes | |
union | univ16_t |
union | univ32_t |
struct | iovec_t |
Macros | |
#define | __UNIQUE(name) __CONCAT(name,__LINE__) |
#define | ROUND(x, y) (((x) + (y - 1)) / (y)) |
#define | CHARBITS 8 |
#define | BYTES(bits) ROUND(bits, CHARBITS) |
#define | UINT8_MAX ((uin8_t) 0xffU) |
#define | UINT16_MAX ((uint16_t) 0xffffU) |
#define | UINT32_MAX ((uint32_t) 0xffffffffUL) |
#define | INT_MIN INT16_MIN |
#define | INT_MAX INT16_MAX |
#define | INT8_MIN ((int8_t) 0x80) |
#define | INT8_MAX ((int8_t) 0x7f) |
#define | INT16_MIN ((int16_t) 0x8000) |
#define | INT16_MAX ((int16_t) 0x7fff) |
#define | INT32_MIN ((int32_t) 0x80000000L) |
#define | INT32_MAX ((int32_t) 0x7fffffffL) |
#define | NULL ((void*) 0) |
#define | LIKELY(x) __builtin_expect((x), true) |
#define | UNLIKELY(x) __builtin_expect((x), false) |
#define | UNUSED(x) (void) (x) |
#define | membersof(x) (sizeof(x) / sizeof(x[0])) |
#define | __PROGMEM PROGMEM |
#define | STR_P(s) |
#define | PSTR(s) STR_P(s) |
#define | __PSTR(s) STR_P(s) |
#define | static_assert(condition, message) |
#define | I_CPU (F_CPU / 1000000L) |
#define | DELAY(us) _delay_loop_2((us) * (F_CPU / 4000000L)) |
#define | nop() __asm__ __volatile__("nop") |
#define | barrier() __asm__ __volatile__("" ::: "memory") |
#define | synchronized |
#define | ntoh swap |
#define | hton swap |
Typedefs | |
typedef float | float32_t |
typedef univ16_t | univ_t |
typedef const class prog_str * | str_P |
typedef const void * | void_P |
typedef const void_P | void_vec_P |
typedef volatile bool | condvar_t |
Functions | |
char * | strcat_P (char *s1, str_P s2) |
str_P | strchr_P (str_P s, int __val) |
str_P | strchrnul_P (str_P s, int __val) |
int | strcmp_P (const char *s1, str_P s2) |
int | strncmp_P (const char *s1, str_P s2, size_t n) |
char * | strcpy_P (char *s1, str_P s2) |
int | strcasecmp_P (const char *s1, str_P s2) |
char * | strcasestr_P (const char *s1, str_P s2) |
size_t | strlen_P (str_P s) |
uint8_t | lock () |
void | unlock (uint8_t key) |
void | __unlock (uint8_t *key) |
uint8_t | lock (condvar_t &cond) |
size_t | iovec_size (const iovec_t *vec) |
void | iovec_arg (iovec_t *&vp, const void *buf, size_t size) |
void | iovec_end (iovec_t *&vp) |
uint16_t | swap (uint16_t value) |
void | swap (uint16_t *dest, const uint16_t *src, size_t size) |
template<class T > | |
void | swap (T *dest, const T *src) |
void | swap (uint16_t *buf, size_t size) |
template<class T > | |
void | swap (T *buf) |
int16_t | swap (int16_t value) |
void | swap (int16_t *dest, const int16_t *src, size_t size) |
uint32_t | swap (uint32_t value) |
int32_t | swap (int32_t value) |
char | tohex (uint8_t value) |
char | toHEX (uint8_t value) |
Variables | |
void(* | delay )(uint32_t ms) |
void(* | sleep )(uint16_t s) |
void(* | yield )() |
Copyright (C) 2012-2015, Mikael Patel
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Common literals, data types and syntax abstractions.
This file is part of the Arduino Che Cosa project.
Definition in file Types.h.
const Ciao::Descriptor::user_t Fai::Descriptor::set_mode_t __PROGMEM PROGMEM |
#define __UNIQUE | ( | name | ) | __CONCAT(name,__LINE__) |
#define barrier | ( | ) | __asm__ __volatile__("" ::: "memory") |
#define DELAY | ( | us | ) | _delay_loop_2((us) * (F_CPU / 4000000L)) |
#define I_CPU (F_CPU / 1000000L) |
#define LIKELY | ( | x | ) | __builtin_expect((x), true) |
#define membersof | ( | x | ) | (sizeof(x) / sizeof(x[0])) |
#define nop | ( | ) | __asm__ __volatile__("nop") |
#define ntoh swap |
#define ROUND | ( | x, | |
y | |||
) | (((x) + (y - 1)) / (y)) |
#define STR_P | ( | s | ) |
Program string literal that may be used in macro. Is not unique.
[in] | s | string literal (at compile time). |
#define synchronized |
Syntactic sugar for synchronized block. Used in the form:
Interrupts are disabled in the block allowing secure update. All control structures are allowed (e.g. return, goto).
#define UNUSED | ( | x | ) | (void) (x) |
typedef float float32_t |
typedef const class prog_str* str_P |
typedef const void_P void_vec_P |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void swap | ( | T * | dest, |
const T * | src | ||
) |
|
inline |
void swap | ( | T * | buf | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void(* delay) (uint32_t ms) |
Delay given number of milli-seconds. This function pointer may be redefined to allow low-power and/or multi-tasking duing wait.
[in] | ms | milli-seconds delay. |
void(* sleep) (uint16_t s) |
Sleep given number of seconds. This function pointer may be redefined to allow low-power and/or multi-tasking duing wait.
[in] | s | seconds delay. |
void(* yield) () |
Allow context switch to other tasks if available. The default implementation is a low-power sleep and wait for interrupt.