IoT Supervisor 0.0
Loading...
Searching...
No Matches
hardware.h
Go to the documentation of this file.
1
25#ifndef INC_HARDWARE_H_
26#define INC_HARDWARE_H_
27
28#if defined(PCB)
29// PORT 0
30// P0_B0 NC
31// P0_B1 NC
32#define nLED (P0_B2) // reset LED, present since initial development as "LED"
33#define XCVR_TX (P0_B3)
34// P0_B4 UART TX
35// P0_B5 UART RX
36#define nPWR_LED (P0_B6)
37// P0_B7 comparator output (hardware)
38
39// PORT 1
40#define nMB_LED (P1_B0)
41#define RESET_P (P1_B1)
42#define nWDT_LED (P1_B2)
43// P1_B3 is taken by the comparator input
44
45#define VIN_CMP_CPOUT() (CMP1CN0 & CMP1CN0_CPOUT__BMASK)
46
47#else // not PCB
48#define RESET_P (P1_B1)
49#define nLED (P1_B4)
50#define XCVR_TX (P0_B3)
51
52#define VIN_CMP_CPOUT() (CMP0CN0 & CMP0CN0_CPOUT__BMASK)
53#endif // PCB
54
55#if defined(DEBUG) && DEBUG
56// debug mode is on, toggle the debug pins
57// do not use the pcb with debug mode!
58#if defined(PCB)
59#error "Do not use debug mode with the PCB!"
60#endif // PCB
61#define DBG0 (P0_B6)
62#define DBG1 (P1_B0)
63#define DBG2 (P1_B2)
64#define DBG3 (P1_B3)
65#define TIMER0_PINO_ON()
66#define TIMER0_PINO_OFF()
67#define TIMER0_PINI_ON() DBG0 = 1;
68#define TIMER0_PINI_OFF() DBG0 = 0;
69#define TIMER1_PIN_ON() DBG1 = 1;
70#define TIMER1_PIN_OFF() DBG1 = 0;
71#define UART0_PIN_ON() DBG2 = 1;
72#define UART0_PIN_OFF() DBG2 = 0;
73#define ADC0_PIN_ON()
74#define ADC0_PIN_OFF()
75#define MAIN_PIN_ON()
76#define MAIN_PIN_OFF()
77#define PETIT_PROCESS_ON() DBG3 = 1;
78#define PETIT_PROCESS_OFF() DBG3 = 0;
79// note that these respond to inverse logic
80#define RESET_LED_SET(nSTATE)
81#define WDT_LED_SET(nSTATE) nLED = (nSTATE);
82#else
83// empty declarations
84#define TIMER0_PINO_ON()
85#define TIMER0_PINO_OFF()
86#define TIMER0_PINI_ON()
87#define TIMER0_PINI_OFF()
88#define TIMER1_PIN_ON()
89#define TIMER1_PIN_OFF()
90#define UART0_PIN_ON()
91#define UART0_PIN_OFF()
92#define ADC0_PIN_ON()
93#define ADC0_PIN_OFF()
94#define MAIN_PIN_ON()
95#define MAIN_PIN_OFF()
96#define PETIT_PROCESS_ON()
97#define PETIT_PROCESS_OFF()
98#define RESET_LED_SET(nSTATE) nLED = (nSTATE);
99#define WDT_LED_SET(nSTATE) nWDT_LED = (nSTATE);
100#endif
101
102#endif /* INC_HARDWARE_H_ */