]> cvs.zerfleddert.de Git - rsbs2/blame_incremental - bmc/chassis.c
Completely working IPMB communication (power up/down, reset)
[rsbs2] / bmc / chassis.c
... / ...
CommitLineData
1#include <avr/io.h>
2#include <stdio.h>
3
4#include "chassis.h"
5
6#define DEBUG
7
8void chassis_init()
9{
10 DDRB = 0xff;
11 PORTB = 0xff;
12}
13
14void chassis_control(unsigned char action)
15{
16#ifdef DEBUG
17 printf("Chassis control 0x%02x\n", action);
18#endif
19
20 switch(action) {
21 case CHASSIS_ACTION_POWER_DOWN:
22 PORTB=0xff;
23 break;
24
25 case CHASSIS_ACTION_POWER_UP:
26 PORTB=0x00;
27 break;
28
29 case CHASSIS_ACTION_HARD_RESET:
30 PORTB=0x55;
31 break;
32
33 default:
34 printf("Unimplemented chassis action 0x%02x\n", action);
35 break;
36 }
37}
Impressum, Datenschutz