--- /dev/null
+/*
+Copyright 2014 Ralf Schmitt <ralf@bunkertor.net>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <avr/io.h>
+#include "backlight.h"
+
+/* Backlight pin configuration
+ *
+ * Alphas PB1 (high)
+ * Numeric PB2 (high)
+ * Mod+Num PB3 (high)
+ * Backside PD6 (high)
+ * TopRight PD7 (low)
+ * F-Row PE6 (high)
+ *
+ */
+void backlight_set(uint8_t level)
+{
+ // Set as output.
+ DDRB |= (1<<1) | (1<<2) | (1<<3);
+ DDRD |= (1<<6) | (1<<7);
+ DDRE |= (1<<6);
+
+ if(level & (1<<0))
+ {
+ PORTB &= ~(1<<1);
+ PORTB &= ~(1<<2);
+ PORTB &= ~(1<<3);
+ PORTD &= ~(1<<6);
+ PORTD |= (1<<7);
+ PORTE &= ~(1<<6);
+ }
+ else
+ {
+ PORTB |= (1<<1);
+ PORTB |= (1<<2);
+ PORTB |= (1<<3);
+ PORTD |= (1<<6);
+ PORTD &= ~(1<<7);
+ PORTE |= (1<<6);
+ }
+}
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, PSCR, SLCK, BRK, \
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NUMLOCK,KP_SLASH,KP_ASTERISK,KP_MINUS, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, KP_7, KP_8, KP_9, KP_PLUS, \
- CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NO, ENT, KP_4, KP_5, KP_6, NO, \
+ CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,FN0, ENT, KP_4, KP_5, KP_6, NO, \
LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH,NO, RSFT, KP_1, KP_2, KP_3, KP_ENTER, \
LCTL,LGUI,LALT, SPC, NO, RALT,RGUI,RCTL, KP_0, NO, KP_DOT, NO)
};
static const uint16_t PROGMEM fn_actions[] = {
+ [0] = ACTION_BACKLIGHT_STEP()
};