2012-03-19 08:01:41 +01:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* ergoDOX controller: Teensy 2.0 specific exports
|
|
|
|
* ----------------------------------------------------------------------------
|
2012-03-22 00:51:42 +01:00
|
|
|
* Copyright (c) 2012 Ben Blazak <benblazak.dev@gmail.com>
|
|
|
|
* Released under The MIT License (MIT) (see "license.md")
|
|
|
|
* Project located at <https://github.com/benblazak/ergodox-firmware>
|
2012-03-19 08:01:41 +01:00
|
|
|
* ------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
2012-03-22 00:51:42 +01:00
|
|
|
#ifndef TEENSY_2_0_h
|
|
|
|
#define TEENSY_2_0_h
|
2012-03-19 08:01:41 +01:00
|
|
|
|
2012-03-22 00:51:42 +01:00
|
|
|
#include <avr/io.h> // for the register macros
|
|
|
|
|
|
|
|
// LED control
|
2012-03-28 10:03:11 +02:00
|
|
|
#define KB_LED1_ON (DDRB |= (1<<5))
|
|
|
|
#define KB_LED1_OFF (DDRB &= ~(1<<5))
|
2012-03-27 12:06:52 +02:00
|
|
|
#define KB_LED1_SET(n) (OCR1A = (uint8_t)(n))
|
|
|
|
#define KB_LED1_SET_PERCENT(n) (OCR1A = (uint8_t)((n) * 0xFF))
|
2012-03-28 10:03:11 +02:00
|
|
|
#define KB_LED2_ON (DDRB |= (1<<6))
|
|
|
|
#define KB_LED2_OFF (DDRB &= ~(1<<6))
|
2012-03-27 12:06:52 +02:00
|
|
|
#define KB_LED2_SET(n) (OCR1B = (uint8_t)(n))
|
|
|
|
#define KB_LED2_SET_PERCENT(n) (OCR1B = (uint8_t)((n) * 0xFF))
|
2012-03-28 10:03:11 +02:00
|
|
|
#define KB_LED3_ON (DDRB |= (1<<7))
|
|
|
|
#define KB_LED3_OFF (DDRB &= ~(1<<7))
|
2012-03-27 12:06:52 +02:00
|
|
|
#define KB_LED3_SET(n) (OCR1C = (uint8_t)(n))
|
|
|
|
#define KB_LED3_SET_PERCENT(n) (OCR1C = (uint8_t)((n) * 0xFF))
|
2012-03-19 08:01:41 +01:00
|
|
|
|
|
|
|
|
2012-03-27 12:06:52 +02:00
|
|
|
#ifdef TEENSY_2_0_h_INCLUDE_PRIVATE
|
|
|
|
|
|
|
|
uint8_t teensy_init(void);
|
2012-03-19 08:01:41 +01:00
|
|
|
|
2012-03-27 12:06:52 +02:00
|
|
|
#endif
|
2012-03-19 08:01:41 +01:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|