![]() |
eBoard ๐
โ โงโจ
Written for SIA 2017/2018
|
#include <avr/pgmspace.h>
#include "Arduino.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <compat/twi.h>
#include "pins_arduino.h"
#include <inttypes.h>
#include "Stream.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <avr/wdt.h>
#include <assert.h>
Go to the source code of this file.
Classes | |
class | eagle_impl::TwoWire |
This is used to avoid path resolving issues and defines the common known Arduino Wire-Interface Don't use manually More... | |
struct | eagle_impl::SPIClass |
[SPI] This is used to avoid path resolving issues and defines the common known Arduino SPI interface Don't use manually More... | |
class | eagle_impl::SoftwareSerial |
This is used to avoid path resolving issues and defines the common known Arduino SoftwareSerial interface only enabled on UNO and NANO (specific, ATmega328P based-plattforms) Don't use manually More... | |
struct | _DELAY_TABLE |
struct | ServoCds55 |
struct | SoccerBoard |
[COPY&PASTE] This is the SoccerBoard ghost struct :D More... | |
struct | I2CInOut |
[COPY&PASTE] This is the I2CInOut ghost struct :D More... | |
struct | AX12Servo |
[COPY&PASTE] This is the AX12Servo ghost struct :D More... | |
struct | DynamixelBoard |
[COPY&PASTE] This is the DynamixelBoard ghost struct :D More... | |
struct | RB14Scan |
[COPY&PASTE] [BLUETOOTH] This is the RB14Scan ghost struct :D More... | |
struct | LCD |
[I2C] [LCD] This is used to add support for OLED displays connected to the 'SoccerBoard' More... | |
struct | NeoPixel |
[NEO] this allows you to access Adafruit LED-stripes More... | |
struct | ServoPin_t |
struct | servo_t |
class | Servo |
Namespaces | |
eagle_impl | |
this namespace contains all the Don't use manually classes ;) | |
Macros | |
#define | EBOARD_VERSION "3.0c" |
#define | VALUE_TO_STRING(x) #x |
#define | VALUE(x) VALUE_TO_STRING(x) |
#define | PPERFORM_PRAGMA(str) _Pragma(#str) |
#define | DEBUG_MSG(str) PPERFORM_PRAGMA(message ("" #str)) |
#define | MACRO_MSG(mac, str) PPERFORM_PRAGMA(message("You set " #mac " to " VALUE(mac) ": " #str)) |
#define | EBOARD_HEADER_GUARD |
#define | ARDUINO 200 |
#define | EBOARD_I2C 0x1 |
#define | EBOARD_LCD 0x1 |
#define | EBOARD_SHIFT_REGISTER 0x1 |
#define | EBOARD_BLUETOOTH 0x1 |
#define | REPT_TASK |
#define | __AVR_ATmega2560__ |
#define | __AVR_ATmega328P__ |
#define | EBOARD_NEO 0x1 |
#define | HIGHSPEED |
#define | __AVR__ |
#define | EBOARD_GUESSPATH 0x1 |
#define | main eVirtual_main |
#define | PIN_MAX 0x32 |
#define | twi_h |
#define | TWI_FREQ 100000L |
#define | TWI_BUFFER_LENGTH 32 |
#define | TWI_READY 0 |
#define | TWI_MRX 1 |
#define | TWI_MTX 2 |
#define | TWI_SRX 3 |
#define | TWI_STX 4 |
#define | cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#define | sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#define | BUFFER_LENGTH 32 |
#define | EBOARD_USE_SPI 0x1 |
#define | _SPI_H_INCLUDED |
#define | SPI_CLOCK_DIV4 0x00 |
#define | SPI_CLOCK_DIV16 0x01 |
#define | SPI_CLOCK_DIV64 0x02 |
#define | SPI_CLOCK_DIV128 0x03 |
#define | SPI_CLOCK_DIV2 0x04 |
#define | SPI_CLOCK_DIV8 0x05 |
#define | SPI_CLOCK_DIV32 0x06 |
#define | SPI_MODE0 0x00 |
#define | SPI_MODE1 0x04 |
#define | SPI_MODE2 0x08 |
#define | SPI_MODE3 0x0C |
#define | SPI_MODE_MASK 0x0C |
#define | SPI_CLOCK_MASK 0x03 |
#define | SPI_2XCLOCK_MASK 0x01 |
#define | EBOARD_DEBUG_MODE 0x1 |
#define | EBOARD_NANO 0x0 |
#define | EBOARD_CHECK_PINS 0x1 |
#define | EBOARD_CHECK_PINS_PWM 0x1 |
#define | EBOARD_DEBUG_SPEED 9600 |
#define | EBOARD_SPI_SERVO_MAX 2 |
#define | EBOARD_USE_UTILITY 0x1 |
#define | EBOARD_COPY_AND_PASTE 0x1 |
#define | EBOARD_PWM_SPE 1 |
#define | EBOARD_CLAMP 0x1 |
#define | EBOARD_USE_RESET 0x1 |
#define | PIN_BLUETOOTH_STATE 0x13 |
#define | PIN_BLUETOOTH_RX 0x13 |
#define | PIN_BLUETOOTH_TX 0x12 |
#define | PIN_MOTOR_DIR 0x4 |
#define | PIN_MOTOR_SPE 0x5 |
#define | PIN_SHIFT_CLK 0x6 |
#define | PIN_SHIFT_DAT 0x7 |
#define | PIN_SHIFT_LAT 0x8 |
#define | _SS_MAX_RX_BUFF 64 |
#define | GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) |
#define | _DEBUG 0 |
#define | _DEBUG_PIN1 11 |
#define | _DEBUG_PIN2 13 |
#define | __ASSERT_USE_STDERR |
#define | DIGITAL_IN 0x0 |
#define | DIGITAL_IN_INV 0x1 |
#define | DIGITAL_IN_PULLUP 0x2 |
#define | DIGITAL_IN_PULLUP_INV 0x3 |
#define | DIGITAL_OUT 0x4 |
#define | DIGITAL_OUT_INV 0x5 |
#define | DIGITAL_OUT_LOW 0x6 |
#define | DIGITAL_OUT_HIGH 0x7 |
#define | ANALOG_IN_8_BIT 0x8 |
#define | ANALOG_IN_10_BIT 0x9 |
#define | ANALOG_IN_MEAN_8_BIT 0xA |
#define | ANALOG_IN_MEAN_10_BIT 0xB |
#define | COUNTER_8_BIT 0xC |
#define | COUNTER_16_BIT 0xD |
#define | COUNTER_RISE_8_BIT 0xE |
#define | COUNTER_RISE_16_BIT 0xF |
#define | PWM_SLOW 0x8 |
#define | PWM_FAST 0x9 |
#define | FREQ_LOW 0xA |
#define | FREQ_HIGH 0xB |
#define | COUNTER_B_DIR 0xC |
#define | COUNTER_B_DIR_PULLUP 0xD |
#define | COUNTER_MEAN_8_BIT 0xE |
#define | COUNTER_MEAN_16_BIT 0xF |
#define | LCD_COMMAND_MODE 0x80 |
#define | LCD_DATA_MODE 0x40 |
#define | LCD_COMMAND_DISPLAY_OFF 0xAE |
#define | LCD_COMMAND_DISPLAY_ON 0xAF |
#define | LCD_COMMAND_BLACK_BACKGROUND 0xA6 |
#define | LCD_COMMAND_WHITE_BACKGROUND 0xA7 |
#define | LCD_COMMAND_SET_BRIGHTNESS 0x81 |
#define | LCD_PAGE_ADDRESSING 0x02 |
#define | LCD_HORIZONTAL_ADDRESSING 0x00 |
#define | LCD_COMMAND_CHARGE_PUMP_SETTING 0x8d |
#define | LCD_COMMAND_CHARGE_PUMP_ENABLE 0x14 |
#define | LCD_WIDTH 128 |
#define | LCD_HEIGHT 64 |
#define | EBOARD_NEO_RGB ((0 << 6) | (0 << 4) | (1 << 2) | (2)) |
#define | EBOARD_NEO_RBG ((0 << 6) | (0 << 4) | (2 << 2) | (1)) |
#define | EBOARD_NEO_GRB ((1 << 6) | (1 << 4) | (0 << 2) | (2)) |
#define | EBOARD_NEO_GBR ((2 << 6) | (2 << 4) | (0 << 2) | (1)) |
#define | EBOARD_NEO_BRG ((1 << 6) | (1 << 4) | (2 << 2) | (0)) |
#define | EBOARD_NEO_BGR ((2 << 6) | (2 << 4) | (1 << 2) | (0)) |
#define | EBOARD_NEO_WRGB ((0 << 6) | (1 << 4) | (2 << 2) | (3)) |
#define | EBOARD_NEO_WRBG ((0 << 6) | (1 << 4) | (3 << 2) | (2)) |
#define | EBOARD_NEO_WGRB ((0 << 6) | (2 << 4) | (1 << 2) | (3)) |
#define | EBOARD_NEO_WGBR ((0 << 6) | (3 << 4) | (1 << 2) | (2)) |
#define | EBOARD_NEO_WBRG ((0 << 6) | (2 << 4) | (3 << 2) | (1)) |
#define | EBOARD_NEO_WBGR ((0 << 6) | (3 << 4) | (2 << 2) | (1)) |
#define | EBOARD_NEO_RWGB ((1 << 6) | (0 << 4) | (2 << 2) | (3)) |
#define | EBOARD_NEO_RWBG ((1 << 6) | (0 << 4) | (3 << 2) | (2)) |
#define | EBOARD_NEO_RGWB ((2 << 6) | (0 << 4) | (1 << 2) | (3)) |
#define | EBOARD_NEO_RGBW ((3 << 6) | (0 << 4) | (1 << 2) | (2)) |
#define | EBOARD_NEO_RBWG ((2 << 6) | (0 << 4) | (3 << 2) | (1)) |
#define | EBOARD_NEO_RBGW ((3 << 6) | (0 << 4) | (2 << 2) | (1)) |
#define | EBOARD_NEO_GWRB ((1 << 6) | (2 << 4) | (0 << 2) | (3)) |
#define | EBOARD_NEO_GWBR ((1 << 6) | (3 << 4) | (0 << 2) | (2)) |
#define | EBOARD_NEO_GRWB ((2 << 6) | (1 << 4) | (0 << 2) | (3)) |
#define | EBOARD_NEO_GRBW ((3 << 6) | (1 << 4) | (0 << 2) | (2)) |
#define | EBOARD_NEO_GBWR ((2 << 6) | (3 << 4) | (0 << 2) | (1)) |
#define | EBOARD_NEO_GBRW ((3 << 6) | (2 << 4) | (0 << 2) | (1)) |
#define | EBOARD_NEO_BWRG ((1 << 6) | (2 << 4) | (3 << 2) | (0)) |
#define | EBOARD_NEO_BWGR ((1 << 6) | (3 << 4) | (2 << 2) | (0)) |
#define | EBOARD_NEO_BRWG ((2 << 6) | (1 << 4) | (3 << 2) | (0)) |
#define | EBOARD_NEO_BRGW ((3 << 6) | (1 << 4) | (2 << 2) | (0)) |
#define | EBOARD_NEO_BGWR ((2 << 6) | (3 << 4) | (1 << 2) | (0)) |
#define | EBOARD_NEO_BGRW ((3 << 6) | (2 << 4) | (1 << 2) | (0)) |
#define | EBOARD_NEO_800KHZ 0x0000 |
#define | EBOARD_NEO_400KHZ 0x0100 |
#define | _useTimer1 |
#define | MIN_PULSE_WIDTH 544 |
#define | MAX_PULSE_WIDTH 2400 |
#define | DEFAULT_PULSE_WIDTH 1500 |
#define | REFRESH_INTERVAL 20000 |
#define | SERVOS_PER_TIMER 12 |
#define | MAX_SERVOS (_Nbr_16timers * SERVOS_PER_TIMER) |
#define | INVALID_SERVO 255 |
#define | usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / 8) |
#define | ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) |
#define | TRIM_DURATION 2 |
#define | SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / SERVOS_PER_TIMER)) |
#define | SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % SERVOS_PER_TIMER) |
#define | SERVO_INDEX(_timer, _channel) ((_timer*SERVOS_PER_TIMER) + _channel) |
#define | SERVO(_timer, _channel) (servos[SERVO_INDEX(_timer,_channel)]) |
#define | SERVO_MIN() (MIN_PULSE_WIDTH - this->min * 4) |
#define | SERVO_MAX() (MAX_PULSE_WIDTH - this->max * 4) |
Typedefs | |
typedef int | optVAL_t |
typedef struct _DELAY_TABLE | DELAY_TABLE |
Enumerations | |
enum | timer16_Sequence_t { _timer1, _Nbr_16timers } |
Functions | |
_Pragma ("message (\ \\f you do not want any preprocessing information from this eBoard-Header set 1 to 0\\") | |
_Pragma ("message (\ \\ou are using eBoard-header v3.0c written by EagleoutIce\\") | |
_Pragma ("message (\ \\ocumentation macro SET => Full doc features enabled\\") | |
_Pragma ("message (\ \\ou are using Guesspath! Necessary libraries for eBoard will be included automatically\\") | |
_Pragma ("message (\ \\uilding for Arduino Mega with ATmega2560\\") | |
_Pragma ("message (\ \\ou enabled IยฒC feature\s\") | |
void | twi_init (void) |
void | twi_setAddress (uint8_t address) |
uint8_t | twi_readFrom (uint8_t address, uint8_t *data, uint8_t length, uint8_t sendStop) |
uint8_t | twi_writeTo (uint8_t address, uint8_t *data, uint8_t length, uint8_t wait, uint8_t sendStop) |
uint8_t | twi_transmit (const uint8_t *data, uint8_t length) |
void | twi_attachSlaveRxEvent (void(*function)(uint8_t *, int)) |
void | twi_attachSlaveTxEvent (void(*function)(void)) |
void | twi_reply (uint8_t ack) |
void | twi_stop (void) |
void | twi_releaseBus (void) |
ISR (TWI_vect) | |
_Pragma ("message (\ \\ou enabled SPI\\") | |
_Pragma ("message (\ \\ou enabled LCD\\") | |
_Pragma ("message (\ \\ou did not define IGNORE_SIZE: int will be used\\") | |
_Pragma ("message(\ou set \\0x1 \\to \\x1\\ \\\erial feedback will be send to Computer\\") | |
_Pragma ("message(\ou set \\0x0 \\to \\x0\\ \\\sing Arduino UNO/MEGA environment\\") | |
_Pragma ("message(\ou set \\0x1 \\to \\x1\\ \\\heck for Pins enabled\\") | |
_Pragma ("message(\ou set \\0x1 \\to \\x1\\ \\\hiftregister enabled\\") | |
_Pragma ("message(\ou set \\0x1 \\to \\x1\\ \\\heck for PWM-Pins enabled\\") | |
_Pragma ("message(\ou set \\0x1 \\to \\x1\\ \\\tility features will be implemented\\") | |
_Pragma ("message(\ou set \\0x1 \\to \\x1\\ \\\luetooth controls enabled\\") | |
_Pragma ("message(\ou set \\0x1 \\to \\x1\\ \\\otor Range is set to [0;1023]\\") | |
_Pragma ("message(\ou set \\0x1 \\to \\x1\\ \\\dafruit Neo-Pixel support enabled\\") | |
_Pragma ("message(\ou set \\0x1 \\to \\x1\\ \\\oftware-Reset is available\\") | |
void | DebugPulse (uint8_t pin, uint8_t count) |
SoftwareSerial | _serial (0x13, 0x12) |
void | __assert (const char *__func, const char *__file, optVAL_t __lineno, const char *__sexp) |
[DEBUG_MODE] custom assert message More... | |
void | checkIdx (optVAL_t idx) |
[DEBUG_MODE] used to check if a pin index is in bounds More... | |
optVAL_t | countSetBits (optVAL_t x) |
[COPY&PASTE] [CHECK_PWM] counts high-bits in an int/byte (determined by IGNORE_SIZE) More... | |
bool | checkPin (optVAL_t idx, optVAL_t mode=0x1) |
[COPY&PASTE] [CHECK_PINS] Check if a pin is set to a specific mode More... | |
void | setPin (optVAL_t idx, optVAL_t mode=0x1) |
[COPY&PASTE] set a pin to a certain mode => checkPin() will return true then More... | |
char | readVal (char oF='.') |
[BLUETOOTH] reads a single value from bluetooth if available! More... | |
bool | checkOverflow (void) |
[BLUETOOTH] checks if theres a lack of Data! More... | |
template<typename T > | |
void | writeVal (const T &val) |
[BLUETOOTH] writes Data to bluetooth More... | |
bool | isConnected (void) |
[BLUETOOTH] this will check if the HC-05 is paired More... | |
void | shiftSingle (optVAL_t idx, bool val) |
[SHIFT] Changes a single output Pin More... | |
void | shiftAll (void) |
[SHIFT] Changes bits according to store_bits More... | |
void | writePWM (optVAL_t val) |
write a clamped pwm value to an output pin More... | |
void | rept_task (void) |
void | writePin (optVAL_t idx, bool val) |
write a boolean state to an output pin More... | |
optVAL_t | readPin (optVAL_t idx, bool dig=true) |
read a digital state from an INPUTpin More... | |
optVAL_t | sendI2C (optVAL_t deviceID, byte *buf, byte buf_len) |
Sends a buffer of bytes to a certain IยฒC-Device. More... | |
optVAL_t | sendI2C (optVAL_t deviceID, byte buf) |
Sends a byte to a certain I2C-Device. More... | |
void | pingI2C (optVAL_t ret[], optVAL_t ret_len) |
Sends a byte to a certain IยฒC-Device. More... | |
void | readI2C (optVAL_t deviceID, optVAL_t ret[], optVAL_t ret_len, bool blocking=true) |
Reads a special amount of bits from a certain IยฒC-Device. More... | |
static void | handle_interrupts (timer16_Sequence_t timer, volatile uint16_t *TCNTn, volatile uint16_t *OCRnA) |
SIGNAL (TIMER1_COMPA_vect) | |
static void | initISR (timer16_Sequence_t timer) |
static void | finISR (timer16_Sequence_t timer) |
static boolean | isTimerActive (timer16_Sequence_t timer) |
void | trig_rept_task () |
ISR (TIMER2_OVF_vect) | |
int | eVirtual_main () |
void | setup (void) |
this is a guard More... | |
void | loop (void) |
[COPY&PASTE] As we have an Arduino we need a setup function ;) More... | |
void | set_motor_speed (optVAL_t spe) |
void | set_steer_angle (optVAL_t ang) |
Variables | |
static volatile uint8_t | twi_state |
static volatile uint8_t | twi_slarw |
static volatile uint8_t | twi_sendStop |
static volatile uint8_t | twi_inRepStart |
static void(* | twi_onSlaveTransmit )(void) |
static void(* | twi_onSlaveReceive )(uint8_t *, int) |
static uint8_t | twi_masterBuffer [32] |
static volatile uint8_t | twi_masterBufferIndex |
static volatile uint8_t | twi_masterBufferLength |
static uint8_t | twi_txBuffer [32] |
static volatile uint8_t | twi_txBufferIndex |
static volatile uint8_t | twi_txBufferLength |
static uint8_t | twi_rxBuffer [32] |
static volatile uint8_t | twi_rxBufferIndex |
static volatile uint8_t | twi_error |
TwoWire | Wire = TwoWire() |
SPIClass | SPI |
static bool | STOP = false |
uint64_t | pin_out = 0x0 |
uint64_t | pin_in = 0x0 |
long | store_bits = 0L |
optVAL_t | _pwmValue = 0x0 |
optVAL_t | _OpwmValue = 0x0 |
ServoCds55 | _servoHandler |
PROGMEM const byte | basicFont [][8] |
static const uint8_t PROGMEM | _sineTable [256] |
static const uint8_t PROGMEM | _gammaTable [256] |
static servo_t | servos [(_Nbr_16timers *12)] |
static volatile int8_t | Channel [_Nbr_16timers] |
uint8_t | ServoCount = 0 |
int | timer_count = 0 |
bool | timer_ofl = false |
#define _DEBUG_PIN1 11 |
Definition at line 927 of file eBoard.h.
Referenced by eagle_impl::SoftwareSerial::begin(), and eagle_impl::SoftwareSerial::recv().
#define _DEBUG_PIN2 13 |
Definition at line 928 of file eBoard.h.
Referenced by eagle_impl::SoftwareSerial::begin(), and eagle_impl::SoftwareSerial::recv().
#define _SS_MAX_RX_BUFF 64 |
Definition at line 833 of file eBoard.h.
Referenced by eagle_impl::SoftwareSerial::available(), eagle_impl::SoftwareSerial::read(), and eagle_impl::SoftwareSerial::recv().
#define BUFFER_LENGTH 32 |
Definition at line 330 of file eBoard.h.
Referenced by eagle_impl::TwoWire::requestFrom(), and eagle_impl::TwoWire::write().
#define cbi | ( | sfr, | |
bit | |||
) | (_SFR_BYTE(sfr) &= ~_BV(bit)) |
Definition at line 108 of file eBoard.h.
Referenced by twi_init().
#define DEBUG_MSG | ( | str | ) | PPERFORM_PRAGMA(message ("" #str)) |
#define DEFAULT_PULSE_WIDTH 1500 |
Definition at line 3567 of file eBoard.h.
Referenced by Servo::Servo().
#define EBOARD_NEO_BGR ((2 << 6) | (2 << 4) | (1 << 2) | (0)) |
#define EBOARD_NEO_BGRW ((3 << 6) | (2 << 4) | (1 << 2) | (0)) |
#define EBOARD_NEO_BGWR ((2 << 6) | (3 << 4) | (1 << 2) | (0)) |
#define EBOARD_NEO_BRG ((1 << 6) | (1 << 4) | (2 << 2) | (0)) |
#define EBOARD_NEO_BRGW ((3 << 6) | (1 << 4) | (2 << 2) | (0)) |
#define EBOARD_NEO_BRWG ((2 << 6) | (1 << 4) | (3 << 2) | (0)) |
#define EBOARD_NEO_BWGR ((1 << 6) | (3 << 4) | (2 << 2) | (0)) |
#define EBOARD_NEO_BWRG ((1 << 6) | (2 << 4) | (3 << 2) | (0)) |
#define EBOARD_NEO_GBR ((2 << 6) | (2 << 4) | (0 << 2) | (1)) |
#define EBOARD_NEO_GBRW ((3 << 6) | (2 << 4) | (0 << 2) | (1)) |
#define EBOARD_NEO_GBWR ((2 << 6) | (3 << 4) | (0 << 2) | (1)) |
#define EBOARD_NEO_GRB ((1 << 6) | (1 << 4) | (0 << 2) | (2)) |
#define EBOARD_NEO_GRBW ((3 << 6) | (1 << 4) | (0 << 2) | (2)) |
#define EBOARD_NEO_GRWB ((2 << 6) | (1 << 4) | (0 << 2) | (3)) |
#define EBOARD_NEO_GWBR ((1 << 6) | (3 << 4) | (0 << 2) | (2)) |
#define EBOARD_NEO_GWRB ((1 << 6) | (2 << 4) | (0 << 2) | (3)) |
#define EBOARD_NEO_RBG ((0 << 6) | (0 << 4) | (2 << 2) | (1)) |
#define EBOARD_NEO_RBGW ((3 << 6) | (0 << 4) | (2 << 2) | (1)) |
#define EBOARD_NEO_RBWG ((2 << 6) | (0 << 4) | (3 << 2) | (1)) |
#define EBOARD_NEO_RGB ((0 << 6) | (0 << 4) | (1 << 2) | (2)) |
#define EBOARD_NEO_RGBW ((3 << 6) | (0 << 4) | (1 << 2) | (2)) |
#define EBOARD_NEO_RGWB ((2 << 6) | (0 << 4) | (1 << 2) | (3)) |
#define EBOARD_NEO_RWBG ((1 << 6) | (0 << 4) | (3 << 2) | (2)) |
#define EBOARD_NEO_RWGB ((1 << 6) | (0 << 4) | (2 << 2) | (3)) |
#define EBOARD_NEO_WBGR ((0 << 6) | (3 << 4) | (2 << 2) | (1)) |
#define EBOARD_NEO_WBRG ((0 << 6) | (2 << 4) | (3 << 2) | (1)) |
#define EBOARD_NEO_WGBR ((0 << 6) | (3 << 4) | (1 << 2) | (2)) |
#define EBOARD_NEO_WGRB ((0 << 6) | (2 << 4) | (1 << 2) | (3)) |
#define EBOARD_NEO_WRBG ((0 << 6) | (1 << 4) | (3 << 2) | (2)) |
#define EBOARD_NEO_WRGB ((0 << 6) | (1 << 4) | (2 << 2) | (3)) |
#define EBOARD_SPI_SERVO_MAX 2 |
Definition at line 714 of file eBoard.h.
Referenced by DynamixelBoard::action(), DynamixelBoard::DynamixelBoard(), and AX12Servo::storePosition().
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) |
#define INVALID_SERVO 255 |
Definition at line 3571 of file eBoard.h.
Referenced by Servo::readMicroseconds(), and Servo::Servo().
#define LCD_COMMAND_BLACK_BACKGROUND 0xA6 |
Definition at line 2065 of file eBoard.h.
Referenced by LCD::changeBackground().
#define LCD_COMMAND_CHARGE_PUMP_ENABLE 0x14 |
Definition at line 2078 of file eBoard.h.
Referenced by LCD::init().
#define LCD_COMMAND_CHARGE_PUMP_SETTING 0x8d |
Definition at line 2076 of file eBoard.h.
Referenced by LCD::init().
#define LCD_COMMAND_DISPLAY_OFF 0xAE |
Definition at line 2061 of file eBoard.h.
Referenced by LCD::changeMode().
#define LCD_COMMAND_DISPLAY_ON 0xAF |
Definition at line 2063 of file eBoard.h.
Referenced by LCD::changeMode().
#define LCD_COMMAND_MODE 0x80 |
Definition at line 2057 of file eBoard.h.
Referenced by LCD::s1Cmd().
#define LCD_COMMAND_WHITE_BACKGROUND 0xA7 |
Definition at line 2067 of file eBoard.h.
Referenced by LCD::changeBackground().
#define LCD_DATA_MODE 0x40 |
Definition at line 2059 of file eBoard.h.
Referenced by LCD::s1Dat().
#define LCD_HEIGHT 64 |
Definition at line 2085 of file eBoard.h.
Referenced by LCD::print().
#define LCD_PAGE_ADDRESSING 0x02 |
Definition at line 2071 of file eBoard.h.
Referenced by LCD::init().
#define LCD_WIDTH 128 |
Definition at line 2081 of file eBoard.h.
Referenced by LCD::print().
#define MACRO_MSG | ( | mac, | |
str | |||
) | PPERFORM_PRAGMA(message("You set " #mac " to " VALUE(mac) ": " #str)) |
#define main eVirtual_main |
#define MAX_PULSE_WIDTH 2400 |
Definition at line 3566 of file eBoard.h.
Referenced by Servo::attach().
#define MAX_SERVOS (_Nbr_16timers * SERVOS_PER_TIMER) |
Definition at line 3570 of file eBoard.h.
Referenced by Servo::attach(), Servo::Servo(), and Servo::writeMicroseconds().
#define MIN_PULSE_WIDTH 544 |
Definition at line 3565 of file eBoard.h.
Referenced by Servo::attach(), and Servo::write().
#define PIN_BLUETOOTH_RX 0x13 |
Definition at line 789 of file eBoard.h.
Referenced by __assert(), checkIdx(), and setup().
#define PIN_BLUETOOTH_STATE 0x13 |
Definition at line 781 of file eBoard.h.
Referenced by isConnected(), and setup().
#define PIN_BLUETOOTH_TX 0x12 |
Definition at line 797 of file eBoard.h.
Referenced by __assert(), and checkIdx().
#define PIN_MAX 0x32 |
Definition at line 80 of file eBoard.h.
Referenced by checkIdx().
#define PIN_MOTOR_DIR 0x4 |
Definition at line 804 of file eBoard.h.
Referenced by __assert(), SoccerBoard::motor(), setup(), and I2CInOut::write().
#define PIN_MOTOR_SPE 0x5 |
Definition at line 808 of file eBoard.h.
Referenced by __assert(), setup(), and trig_rept_task().
#define PIN_SHIFT_CLK 0x6 |
Definition at line 812 of file eBoard.h.
Referenced by setup(), and shiftAll().
#define PIN_SHIFT_DAT 0x7 |
Definition at line 816 of file eBoard.h.
Referenced by setup(), and shiftAll().
#define PIN_SHIFT_LAT 0x8 |
Definition at line 820 of file eBoard.h.
Referenced by setup(), and shiftAll().
#define REFRESH_INTERVAL 20000 |
Definition at line 3568 of file eBoard.h.
Referenced by handle_interrupts().
#define SERVO | ( | _timer, | |
_channel | |||
) | (servos[SERVO_INDEX(_timer,_channel)]) |
Definition at line 3607 of file eBoard.h.
Referenced by handle_interrupts(), and isTimerActive().
#define SERVO_INDEX | ( | _timer, | |
_channel | |||
) | ((_timer*SERVOS_PER_TIMER) + _channel) |
Definition at line 3606 of file eBoard.h.
Referenced by handle_interrupts().
#define SERVO_INDEX_TO_CHANNEL | ( | _servo_nbr | ) | (_servo_nbr % SERVOS_PER_TIMER) |
#define SERVO_INDEX_TO_TIMER | ( | _servo_nbr | ) | ((timer16_Sequence_t)(_servo_nbr / SERVOS_PER_TIMER)) |
Definition at line 3604 of file eBoard.h.
Referenced by Servo::attach(), and Servo::detach().
#define SERVO_MAX | ( | ) | (MAX_PULSE_WIDTH - this->max * 4) |
Definition at line 3609 of file eBoard.h.
Referenced by Servo::read(), Servo::write(), and Servo::writeMicroseconds().
#define SERVO_MIN | ( | ) | (MIN_PULSE_WIDTH - this->min * 4) |
Definition at line 3608 of file eBoard.h.
Referenced by Servo::read(), Servo::write(), and Servo::writeMicroseconds().
#define SERVOS_PER_TIMER 12 |
Definition at line 3569 of file eBoard.h.
Referenced by handle_interrupts(), and isTimerActive().
#define SPI_2XCLOCK_MASK 0x01 |
Definition at line 583 of file eBoard.h.
Referenced by eagle_impl::SPIClass::setClockDivider().
#define SPI_CLOCK_DIV8 0x05 |
Definition at line 567 of file eBoard.h.
Referenced by ServoCds55::begin().
#define SPI_CLOCK_MASK 0x03 |
Definition at line 581 of file eBoard.h.
Referenced by eagle_impl::SPIClass::setClockDivider().
#define SPI_MODE_MASK 0x0C |
Definition at line 579 of file eBoard.h.
Referenced by eagle_impl::SPIClass::setDataMode().
#define ticksToUs | ( | _ticks | ) | (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) |
Definition at line 3597 of file eBoard.h.
Referenced by Servo::readMicroseconds().
#define TRIM_DURATION 2 |
Definition at line 3598 of file eBoard.h.
Referenced by Servo::readMicroseconds(), and Servo::writeMicroseconds().
#define TWI_BUFFER_LENGTH 32 |
Definition at line 96 of file eBoard.h.
Referenced by ISR(), twi_readFrom(), twi_transmit(), and twi_writeTo().
#define TWI_FREQ 100000L |
Definition at line 93 of file eBoard.h.
Referenced by twi_init().
#define TWI_MRX 1 |
Definition at line 99 of file eBoard.h.
Referenced by twi_readFrom().
#define TWI_MTX 2 |
Definition at line 100 of file eBoard.h.
Referenced by twi_writeTo().
#define TWI_READY 0 |
Definition at line 98 of file eBoard.h.
Referenced by ISR(), twi_init(), twi_readFrom(), twi_releaseBus(), twi_stop(), and twi_writeTo().
#define TWI_STX 4 |
Definition at line 102 of file eBoard.h.
Referenced by ISR(), and twi_transmit().
#define usToTicks | ( | _us | ) | (( clockCyclesPerMicrosecond()* _us) / 8) |
Definition at line 3596 of file eBoard.h.
Referenced by handle_interrupts(), Servo::Servo(), and Servo::writeMicroseconds().
#define VALUE | ( | x | ) | VALUE_TO_STRING(x) |
typedef struct _DELAY_TABLE DELAY_TABLE |
enum timer16_Sequence_t |
Enumerator | |
---|---|
_timer1 | |
_Nbr_16timers |
Definition at line 3564 of file eBoard.h.
void __assert | ( | const char * | __func, |
const char * | __file, | ||
optVAL_t | __lineno, | ||
const char * | __sexp | ||
) |
[DEBUG_MODE] custom assert message
__func | the function name |
__file | the file name |
__lineno | the line number |
__sexp | the expression |
Error with: checkIdx in /home/eagleoutice/Dokumente/proj/_sia/src/eBoard.h >>idx>0x1 && idx < 0xA This happens if an out of bounds exception has occured. Following pins shouldn't be used: D2&D3 : Used for Bluetooth communication D4&D5 : Used for main motor control D10-13: Used for smart-servo-shield
Definition at line 1267 of file eBoard.h.
References PIN_BLUETOOTH_RX, PIN_BLUETOOTH_TX, PIN_MOTOR_DIR, and PIN_MOTOR_SPE.
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
_Pragma | ( | ) |
SoftwareSerial _serial | ( | 0x13 | , |
0x12 | |||
) |
Referenced by checkOverflow(), readVal(), setup(), and writeVal().
|
inline |
[DEBUG_MODE] used to check if a pin index is in bounds
idx | the index of the pin to check |
Definition at line 1296 of file eBoard.h.
References PIN_BLUETOOTH_RX, PIN_BLUETOOTH_TX, and PIN_MAX.
Referenced by checkPin(), readPin(), setPin(), and writePin().
|
inline |
[BLUETOOTH] checks if theres a lack of Data!
Definition at line 1368 of file eBoard.h.
References _serial(), and eagle_impl::SoftwareSerial::overflow().
[COPY&PASTE] [CHECK_PINS] Check if a pin is set to a specific mode
idx | the index of the pin to check |
mode | the mode the pin should be checked for |
๐ง I prevent errors!
Definition at line 1332 of file eBoard.h.
References checkIdx(), pin_in, and pin_out.
Referenced by readPin(), and writePin().
|
inline |
Definition at line 999 of file eBoard.h.
Referenced by eagle_impl::SoftwareSerial::recv().
int eVirtual_main | ( | ) |
|
static |
Definition at line 3662 of file eBoard.h.
References _timer1.
Referenced by Servo::detach().
|
inlinestatic |
Definition at line 3610 of file eBoard.h.
References Channel, REFRESH_INTERVAL, SERVO, SERVO_INDEX, ServoCount, SERVOS_PER_TIMER, and usToTicks.
Referenced by SIGNAL().
|
static |
Definition at line 3650 of file eBoard.h.
References _timer1.
Referenced by Servo::attach().
|
inline |
[BLUETOOTH] this will check if the HC-05 is paired
Definition at line 1390 of file eBoard.h.
References PIN_BLUETOOTH_STATE.
Referenced by RB14Scan::channel(), and RB14Scan::raw().
ISR | ( | TWI_vect | ) |
Definition at line 222 of file eBoard.h.
References TWI_BUFFER_LENGTH, twi_error, twi_inRepStart, twi_masterBuffer, twi_masterBufferIndex, twi_masterBufferLength, twi_onSlaveReceive, twi_onSlaveTransmit, TWI_READY, twi_releaseBus(), twi_reply(), twi_rxBuffer, twi_rxBufferIndex, twi_sendStop, twi_slarw, TWI_SRX, twi_state, twi_stop(), TWI_STX, twi_txBuffer, twi_txBufferIndex, and twi_txBufferLength.
ISR | ( | TIMER2_OVF_vect | ) |
Definition at line 3777 of file eBoard.h.
References EBOARD_PWM_SPE, timer_count, timer_ofl, and trig_rept_task().
|
static |
Definition at line 3677 of file eBoard.h.
References SERVO, and SERVOS_PER_TIMER.
Referenced by Servo::attach(), and Servo::detach().
void loop | ( | void | ) |
[COPY&PASTE] As we have an Arduino we need a setup function ;)
Definition at line 3866 of file eBoard.h.
Referenced by NeoPixel::show().
Sends a byte to a certain IยฒC-Device.
ret | an array of optVAL_t |
ret_len | the length of the array |
Definition at line 1923 of file eBoard.h.
References eagle_impl::TwoWire::beginTransmission(), eagle_impl::TwoWire::endTransmission(), STOP, and Wire.
Reads a special amount of bits from a certain IยฒC-Device.
deviceID | the target device |
ret | the buffer to send |
ret_len | size of buffer |
blocking | should the Arduino wait until there is Data? |
Definition at line 1949 of file eBoard.h.
References eagle_impl::TwoWire::available(), eagle_impl::TwoWire::read(), STOP, and Wire.
read a digital state from an INPUTpin
idx | the index of the pin to use |
dig | determines if the value should be from the digital or the analog pins |
Definition at line 1460 of file eBoard.h.
References checkIdx(), checkPin(), and setPin().
Referenced by SoccerBoard::analog(), and SoccerBoard::digital().
|
inline |
[BLUETOOTH] reads a single value from bluetooth if available!
oF | the character returned on failure |
Definition at line 1375 of file eBoard.h.
References _serial(), eagle_impl::SoftwareSerial::available(), and eagle_impl::SoftwareSerial::read().
Referenced by RB14Scan::channel().
void rept_task | ( | void | ) |
Sends a buffer of bytes to a certain IยฒC-Device.
deviceID | the target device |
buf | the buffer to send |
buf_len | size of buffer |
Definition at line 1935 of file eBoard.h.
References eagle_impl::TwoWire::beginTransmission(), buf, eagle_impl::TwoWire::endTransmission(), Wire, and eagle_impl::TwoWire::write().
Sends a byte to a certain I2C-Device.
deviceID | the target device |
buf | the buffer to send |
Definition at line 1940 of file eBoard.h.
References eagle_impl::TwoWire::beginTransmission(), buf, eagle_impl::TwoWire::endTransmission(), Wire, and eagle_impl::TwoWire::write().
|
inline |
Definition at line 3873 of file eBoard.h.
References Servo::write().
|
inline |
Definition at line 3878 of file eBoard.h.
References Servo::write().
[COPY&PASTE] set a pin to a certain mode => checkPin() will return true then
idx | the index of the pin to set |
mode | the mode the pin should be set to |
Definition at line 1341 of file eBoard.h.
References checkIdx(), pin_in, and pin_out.
Referenced by SoccerBoard::motor(), readPin(), setup(), I2CInOut::write(), and writePin().
void setup | ( | void | ) |
this is a guard
[COPY&PASTE] As we have an Arduino we need a setup function ;)
Definition at line 3793 of file eBoard.h.
References _serial(), _servoHandler, Servo::attach(), eagle_impl::TwoWire::begin(), eagle_impl::SoftwareSerial::begin(), ServoCds55::begin(), EBOARD_DEBUG_SPEED, eVirtual_main(), PIN_BLUETOOTH_RX, PIN_BLUETOOTH_STATE, PIN_MOTOR_DIR, PIN_MOTOR_SPE, PIN_SHIFT_CLK, PIN_SHIFT_DAT, PIN_SHIFT_LAT, setPin(), shiftAll(), STOP, Wire, Servo::write(), and writePWM().
void shiftAll | ( | void | ) |
[SHIFT] Changes bits according to store_bits
Definition at line 1411 of file eBoard.h.
References PIN_SHIFT_CLK, PIN_SHIFT_DAT, PIN_SHIFT_LAT, STOP, and store_bits.
Referenced by setup(), and shiftSingle().
|
inline |
[SHIFT] Changes a single output Pin
idx | index of the bit :D |
val | the new state of this bit |
Definition at line 1407 of file eBoard.h.
References shiftAll(), and store_bits.
Referenced by writePin().
SIGNAL | ( | TIMER1_COMPA_vect | ) |
Definition at line 3636 of file eBoard.h.
References _timer1, and handle_interrupts().
void trig_rept_task | ( | ) |
Definition at line 3763 of file eBoard.h.
References _OpwmValue, _pwmValue, PIN_MOTOR_SPE, and rept_task().
Referenced by ISR().
void twi_attachSlaveRxEvent | ( | void(*)(uint8_t *, int) | function | ) |
Definition at line 200 of file eBoard.h.
References twi_onSlaveReceive.
Referenced by eagle_impl::TwoWire::begin().
void twi_attachSlaveTxEvent | ( | void(*)(void) | function | ) |
Definition at line 203 of file eBoard.h.
References twi_onSlaveTransmit.
Referenced by eagle_impl::TwoWire::begin().
void twi_init | ( | void | ) |
Definition at line 129 of file eBoard.h.
References cbi, TWI_FREQ, twi_inRepStart, TWI_READY, twi_sendStop, and twi_state.
Referenced by eagle_impl::TwoWire::begin().
uint8_t twi_readFrom | ( | uint8_t | address, |
uint8_t * | data, | ||
uint8_t | length, | ||
uint8_t | sendStop | ||
) |
Definition at line 143 of file eBoard.h.
References TWI_BUFFER_LENGTH, twi_error, twi_inRepStart, twi_masterBuffer, twi_masterBufferIndex, twi_masterBufferLength, TWI_MRX, TWI_READY, twi_sendStop, twi_slarw, and twi_state.
Referenced by eagle_impl::TwoWire::requestFrom().
void twi_releaseBus | ( | void | ) |
void twi_reply | ( | uint8_t | ack | ) |
|
inline |
Definition at line 140 of file eBoard.h.
Referenced by eagle_impl::TwoWire::begin().
void twi_stop | ( | void | ) |
uint8_t twi_transmit | ( | const uint8_t * | data, |
uint8_t | length | ||
) |
Definition at line 192 of file eBoard.h.
References TWI_BUFFER_LENGTH, twi_state, TWI_STX, twi_txBuffer, and twi_txBufferLength.
Referenced by eagle_impl::TwoWire::write().
uint8_t twi_writeTo | ( | uint8_t | address, |
uint8_t * | data, | ||
uint8_t | length, | ||
uint8_t | wait, | ||
uint8_t | sendStop | ||
) |
Definition at line 167 of file eBoard.h.
References TWI_BUFFER_LENGTH, twi_error, twi_inRepStart, twi_masterBuffer, twi_masterBufferIndex, twi_masterBufferLength, TWI_MTX, TWI_READY, twi_sendStop, twi_slarw, and twi_state.
Referenced by eagle_impl::TwoWire::endTransmission().
|
inline |
write a boolean state to an output pin
idx | the index of the pin to use |
val | the state the pin should have |
Definition at line 1437 of file eBoard.h.
References checkIdx(), checkPin(), setPin(), and shiftSingle().
Referenced by SoccerBoard::led(), SoccerBoard::ledMeter(), SoccerBoard::ledOff(), SoccerBoard::ledOn(), SoccerBoard::ledsOff(), and SoccerBoard::power().
|
inline |
write a clamped pwm value to an output pin
val | the pwm value [0-255] to use |
Definition at line 1426 of file eBoard.h.
References _pwmValue.
Referenced by SoccerBoard::motor(), SoccerBoard::motorsOff(), setup(), and I2CInOut::write().
|
inline |
[BLUETOOTH] writes Data to bluetooth
val | This is the data to be written. Can be int, str etc... |
Definition at line 1383 of file eBoard.h.
References _serial(), and eagle_impl::SoftwareSerial::write().
Referenced by RB14Scan::write().
|
static |
Definition at line 3521 of file eBoard.h.
Referenced by NeoPixel::gamma8().
optVAL_t _OpwmValue = 0x0 |
Definition at line 1422 of file eBoard.h.
Referenced by trig_rept_task().
optVAL_t _pwmValue = 0x0 |
Definition at line 1422 of file eBoard.h.
Referenced by trig_rept_task(), and writePWM().
ServoCds55 _servoHandler |
Definition at line 1588 of file eBoard.h.
Referenced by SoccerBoard::motor(), AX12Servo::setID(), AX12Servo::setPosition(), and setup().
|
static |
Definition at line 3504 of file eBoard.h.
Referenced by NeoPixel::sine8().
PROGMEM const byte basicFont[][8] |
Definition at line 1956 of file eBoard.h.
Referenced by LCD::print().
|
static |
Definition at line 3601 of file eBoard.h.
Referenced by handle_interrupts().
uint64_t pin_in = 0x0 |
Definition at line 1327 of file eBoard.h.
Referenced by checkPin(), and setPin().
uint64_t pin_out = 0x0 |
Definition at line 1321 of file eBoard.h.
Referenced by checkPin(), and setPin().
uint8_t ServoCount = 0 |
Definition at line 3602 of file eBoard.h.
Referenced by handle_interrupts(), and Servo::Servo().
|
static |
Definition at line 3600 of file eBoard.h.
Referenced by Servo::attach(), Servo::attached(), Servo::readMicroseconds(), Servo::Servo(), and Servo::writeMicroseconds().
SPIClass SPI |
Definition at line 632 of file eBoard.h.
Referenced by ServoCds55::begin(), and ServoCds55::sendWait().
|
static |
Definition at line 641 of file eBoard.h.
Referenced by DynamixelBoard::action(), pingI2C(), readI2C(), setup(), and shiftAll().
long store_bits = 0L |
Definition at line 1401 of file eBoard.h.
Referenced by shiftAll(), and shiftSingle().
|
static |
Definition at line 128 of file eBoard.h.
Referenced by ISR(), twi_readFrom(), and twi_writeTo().
|
static |
Definition at line 117 of file eBoard.h.
Referenced by ISR(), twi_init(), twi_readFrom(), and twi_writeTo().
|
static |
Definition at line 120 of file eBoard.h.
Referenced by ISR(), twi_readFrom(), and twi_writeTo().
|
static |
Definition at line 121 of file eBoard.h.
Referenced by ISR(), twi_readFrom(), and twi_writeTo().
|
static |
Definition at line 122 of file eBoard.h.
Referenced by ISR(), twi_readFrom(), and twi_writeTo().
|
static |
Definition at line 119 of file eBoard.h.
Referenced by ISR(), and twi_attachSlaveRxEvent().
|
static |
Definition at line 118 of file eBoard.h.
Referenced by ISR(), and twi_attachSlaveTxEvent().
|
static |
|
static |
Definition at line 116 of file eBoard.h.
Referenced by ISR(), twi_init(), twi_readFrom(), and twi_writeTo().
|
static |
Definition at line 115 of file eBoard.h.
Referenced by ISR(), twi_readFrom(), and twi_writeTo().
|
static |
Definition at line 114 of file eBoard.h.
Referenced by ISR(), twi_init(), twi_readFrom(), twi_releaseBus(), twi_stop(), twi_transmit(), and twi_writeTo().
|
static |
Definition at line 123 of file eBoard.h.
Referenced by ISR(), and twi_transmit().
|
static |
|
static |
Definition at line 125 of file eBoard.h.
Referenced by ISR(), and twi_transmit().
Definition at line 543 of file eBoard.h.
Referenced by LCD::changeBrightness(), pingI2C(), readI2C(), LCD::s1Cmd(), LCD::s1Dat(), sendI2C(), and setup().