avr-something

Something something AVR side…
git clone git://henryandlizzy.uk/avr-something
Log | Files | Refs | README

hidModule.h (893B)


      1 #pragma once
      2 
      3 #include "io.h"
      4 
      5 /*
      6 10		GND
      7 	9	C5
      8 8		
      9 	7	AREF
     10 6		_RESET_
     11 	5	C3
     12 4		AVCC
     13 	3	C4
     14 2		GND
     15 	1	C2
     16 	
     17 	
     18 	B0
     19 	B1	SD ???
     20 	B2	!USB!
     21 	B3	!USB!
     22 	B4	SD _SS_
     23 	B5	SD MOSI
     24 	B6	SD MISO
     25 	B7	SD SCLK | LED red
     26 
     27 	C2	U-B | W-A
     28 	C3	D-B | W-B
     29 	C4	R-B | C-B
     30 	C5	L-B
     31 
     32 	D0	BUTTON COM B
     33 	D1	WHEEL COM A
     34 	D2	RS232 RX1
     35 	D3	RS232 TX1
     36 	D4	LED yellow
     37 	D5	L OC1A | ADC5
     38 	D6	LED green
     39 	D7	R OC2A | ADC7
     40 */
     41 namespace hid {
     42 
     43 constexpr auto buttonCOM = bit(0);
     44 constexpr auto wheelCOM = bit(1);
     45 
     46 constexpr auto wheelA = bit(0);
     47 constexpr auto wheelB = bit(1);
     48 constexpr auto buttonC = bit(2);
     49 constexpr auto buttonL = bit(3);
     50 constexpr auto buttonU = bit(4);
     51 constexpr auto buttonR = bit(5);
     52 constexpr auto buttonD = bit(6);
     53 
     54 constexpr auto ledRED = bit(7);
     55 constexpr auto ledYEL = bit(4);
     56 constexpr auto ledGRN = bit(5);
     57 
     58 void init();
     59 
     60 uint8_t sampleInput();
     61 
     62 void setLeds(const uint8_t);
     63 
     64 [[noreturn]]
     65 void test();
     66 
     67 }