firmware  v0.1.2
Chromation Spectrometer Dev-Kit
UartSpi-Hardware.h
Go to the documentation of this file.
1 
6 #ifndef _UARTSPI_HARDWARE_H
7 #define _UARTSPI_HARDWARE_H
8 #include <stdint.h>
9 #include <avr/io.h> // includes iom328p.h for hardware i/o values
10 #include "UartSpi.h"
11 // ---Registers---
12 uspi_ptr UartSpi_ddr = &DDRD; // controls if pin is input or output
13 uspi_ptr UartSpi_port = &PORTD; // controls if pin outputs HIGH or LOW
14 uspi_ptr UartSpi_UCSR0A = &UCSR0A; // ctrl and status reg A
15 uspi_ptr UartSpi_UCSR0B = &UCSR0B; // ctrl and status reg B
16 uspi_ptr UartSpi_UCSR0C = &UCSR0C; // ctrl and status reg C
17 uspi_ptr UartSpi_UDR0 = &UDR0; // data register
18 uspi_ptr16 UartSpi_UBRR0 = &UBRR0; // baud rate register
19 // ---Pins---
20 uspi_pin UartSpi_Miso = PD0; // connect to ADC Data Out
21 uspi_pin UartSpi_AdcConv = PD2; // connect to ADC Conversion Start
22 uspi_pin UartSpi_Sck = PD4; // connect to ADC clock in
23 // ---Bits---
24 uspi_bit UartSpi_UMSEL00 = UMSEL00;
25 uspi_bit UartSpi_UMSEL01 = UMSEL01;
26 uspi_bit UartSpi_RXEN0 = RXEN0;
27 uspi_bit UartSpi_TXEN0 = TXEN0;
28 uspi_bit UartSpi_UCPOL0 = UCPOL0;
29 uspi_bit UartSpi_UCPHA0 = UCPHA0;
30 uspi_bit UartSpi_UDORD0 = UDORD0;
31 uspi_bit UartSpi_UDRE0 = UDRE0;
32 uspi_bit UartSpi_RXC0 = RXC0;
33 #endif // _UARTSPI_HARDWARE_H