arduino-audio-tools
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
Arduino.h File Reference

If you want to use the framework w/o Arduino you need to provide the implementation of a couple of classes and methods! More...

#include <ctype.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <zephyr/drivers/gpio.h>

Go to the source code of this file.

Classes

class  Client
 
class  HardwareSerial
 
class  Print
 
class  Stream
 

Namespaces

namespace  audio_tools
 Generic Implementation of sound input and output for desktop environments using portaudio.
 

Macros

#define DESKTOP_MILLIS_DEFINED
 
#define GPIO_TO_INT(pin)   pin.pin
 
#define GPIO_TO_STR(pin)   std::to_string(GPIO_TO_INT(pin)).c_str()
 
#define HIGH   0x1
 
#define INPUT   0x0
 
#define INPUT_PULLUP   0x2
 
#define IS_GPIO(pin)   (pin.port != nullptr)
 
#define IS_NOARDUINO
 
#define LOW   0x0
 
#define OUTPUT   0x1
 
#define PI   3.14159265359f
 
#define PSTR(fmt)   fmt
 
#define ZLOGE(...)   printk(__VA_ARGS__)
 

Typedefs

using digital_pin_t = gpio_dt_spec
 Zephyr GPIO spec as digital_pin_t.
 

Enumerations

enum  PrintCharFmt { DEC = 10 , HEX = 16 }
 

Functions

void delay (uint32_t ms)
 
void delayMicroseconds (uint32_t us)
 
int digitalRead (digital_pin_t pin)
 
void digitalWrite (digital_pin_t pin, bool value)
 
long map (long x, long in_min, long in_max, long out_min, long out_max)
 Maps input to output values.
 
uint64_t micros ()
 
uint32_t millis ()
 Returns the milliseconds since the start.
 
static bool operator!= (audio_tools::digital_pin_t &a, audio_tools::digital_pin_t &b)
 Support for pin compare.
 
static bool operator== (audio_tools::digital_pin_t &a, audio_tools::digital_pin_t &b)
 Support for pin compare.
 
void pinMode (digital_pin_t pin, int mode)
 
void yield ()
 

Variables

static gpio_dt_spec GPIO_NONE = {nullptr, 0, 0}
 GPIO_NONE is no pin defined.
 
static HardwareSerial Serial
 

Detailed Description

If you want to use the framework w/o Arduino you need to provide the implementation of a couple of classes and methods!

Author
Phil Schatzmann
Version
0.1
Date
2022-09-19

Macro Definition Documentation

◆ DESKTOP_MILLIS_DEFINED

#define DESKTOP_MILLIS_DEFINED

◆ GPIO_TO_INT

#define GPIO_TO_INT (   pin)    pin.pin

◆ GPIO_TO_STR

#define GPIO_TO_STR (   pin)    std::to_string(GPIO_TO_INT(pin)).c_str()

◆ HIGH

#define HIGH   0x1

◆ INPUT

#define INPUT   0x0

◆ INPUT_PULLUP

#define INPUT_PULLUP   0x2

◆ IS_GPIO

#define IS_GPIO (   pin)    (pin.port != nullptr)

◆ IS_NOARDUINO

#define IS_NOARDUINO

◆ LOW

#define LOW   0x0

◆ OUTPUT

#define OUTPUT   0x1

◆ PI

#define PI   3.14159265359f

◆ PSTR

#define PSTR (   fmt)    fmt

◆ ZLOGE

#define ZLOGE (   ...)    printk(__VA_ARGS__)

Enumeration Type Documentation

◆ PrintCharFmt

Enumerator
DEC 
HEX 

Function Documentation

◆ map()

long map ( long  x,
long  in_min,
long  in_max,
long  out_min,
long  out_max 
)
inline

Maps input to output values.

Variable Documentation

◆ Serial

HardwareSerial Serial
static