36 lines
1.4 KiB
C
36 lines
1.4 KiB
C
/* 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 3 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/>.
|
|
*
|
|
*/
|
|
/* This is the main part of the LED light controller program.
|
|
* It handles all peripherals (power, fan, channels, IR, serial)
|
|
*/
|
|
|
|
/* peripheral I/O */
|
|
#define LED PD6 /* status LED */
|
|
#define IR PB0 /* IR receiver */
|
|
#define FAN PC5 /* FAN output */
|
|
#define PWR_OK PB1 /* ATX power OK */
|
|
#define nPS_ON PB2 /* ATX power supply ON switch */
|
|
|
|
/* channel definitions */
|
|
#define CHANNELS_1 5 /* the number of outputs for channel 1 */
|
|
#define CHANNELS_2 5 /* the number of outputs for channel 2 */
|
|
extern volatile uint8_t* PORTS[CHANNELS_1+CHANNELS_2]; /* channel ports */
|
|
extern volatile uint8_t* DDRS[CHANNELS_1+CHANNELS_2]; /* channel I/O configuration registers */
|
|
extern const uint8_t BITS[CHANNELS_1+CHANNELS_2]; /* channel bits */
|
|
|
|
void ioinit(void);
|
|
void uart_action(char c);
|
|
void ir_action(uint8_t address, uint8_t command);
|