X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/rsbs2/blobdiff_plain/d51930558a73dd1083b924159971d4c77df411e6..da7751cb0539c2ecb03ff66d05904626052e06e3:/bmc/chassis.c diff --git a/bmc/chassis.c b/bmc/chassis.c new file mode 100644 index 0000000..5bdad1f --- /dev/null +++ b/bmc/chassis.c @@ -0,0 +1,37 @@ +#include +#include + +#include "chassis.h" + +#define DEBUG + +void chassis_init() +{ + DDRB = 0xff; + PORTB = 0xff; +} + +void chassis_control(unsigned char action) +{ +#ifdef DEBUG + printf("Chassis control 0x%02x\n", action); +#endif + + switch(action) { + case CHASSIS_ACTION_POWER_DOWN: + PORTB=0xff; + break; + + case CHASSIS_ACTION_POWER_UP: + PORTB=0x00; + break; + + case CHASSIS_ACTION_HARD_RESET: + PORTB=0x55; + break; + + default: + printf("Unimplemented chassis action 0x%02x\n", action); + break; + } +}