From 41c497025f40615373817498606fabd0fcd41dd6 Mon Sep 17 00:00:00 2001 From: Dominik Wenger Date: Mon, 19 Oct 2009 18:14:27 +0000 Subject: Initial mini2440 port. Flyspray: FS#10627 Author: Bob Cousins git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23265 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/s3c2440/mini2440/adc-target.h | 42 ++++++ .../arm/s3c2440/mini2440/backlight-mini2440.c | 151 +++++++++++++++++++++ .../target/arm/s3c2440/mini2440/backlight-target.h | 31 +++++ .../target/arm/s3c2440/mini2440/button-mini2440.c | 80 +++++++++++ .../target/arm/s3c2440/mini2440/button-target.h | 70 ++++++++++ firmware/target/arm/s3c2440/mini2440/lcd-target.h | 43 ++++++ .../target/arm/s3c2440/mini2440/led-mini2440.c | 66 +++++++++ .../target/arm/s3c2440/mini2440/led-mini2440.h | 46 +++++++ .../target/arm/s3c2440/mini2440/power-mini2440.c | 55 ++++++++ 9 files changed, 584 insertions(+) create mode 100644 firmware/target/arm/s3c2440/mini2440/adc-target.h create mode 100644 firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c create mode 100644 firmware/target/arm/s3c2440/mini2440/backlight-target.h create mode 100644 firmware/target/arm/s3c2440/mini2440/button-mini2440.c create mode 100644 firmware/target/arm/s3c2440/mini2440/button-target.h create mode 100644 firmware/target/arm/s3c2440/mini2440/lcd-target.h create mode 100644 firmware/target/arm/s3c2440/mini2440/led-mini2440.c create mode 100644 firmware/target/arm/s3c2440/mini2440/led-mini2440.h create mode 100644 firmware/target/arm/s3c2440/mini2440/power-mini2440.c (limited to 'firmware/target/arm/s3c2440/mini2440') diff --git a/firmware/target/arm/s3c2440/mini2440/adc-target.h b/firmware/target/arm/s3c2440/mini2440/adc-target.h new file mode 100644 index 0000000000..24e878e735 --- /dev/null +++ b/firmware/target/arm/s3c2440/mini2440/adc-target.h @@ -0,0 +1,42 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Bob Cousins + * + * 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 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef _ADC_TARGET_H_ +#define _ADC_TARGET_H_ + +/* Channel 0 is connected to an on board pot for testing + Channels 0-3 are available via expansion connector CON4 + Channels 4-7 are routed to LCD connector for touchscreen operation if + supported by display panel. +*/ +#define NUM_ADC_CHANNELS 8 + +#define ADC_ONBOARD 0 +#define ADC_SPARE_1 1 +#define ADC_SPARE_2 2 +#define ADC_SPARE_3 3 +#define ADC_TSYM 4 +#define ADC_TSYP 5 +#define ADC_TSXM 6 +#define ADC_TSXP 7 + +#define ADC_READ_ERROR 0xFFFF + +#endif diff --git a/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c b/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c new file mode 100644 index 0000000000..88c0b5ce2c --- /dev/null +++ b/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c @@ -0,0 +1,151 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Bob Cousins + * + * 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 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "config.h" +#include "cpu.h" +#include "system.h" +#include "backlight-target.h" +#include "backlight.h" +#include "lcd.h" +#include "power.h" + + +/* Dummy value at index 0, 1-12 used. */ +static const unsigned char log_brightness[13] = + {0,0,1,2,3,5,7,10,15,22,31,44,63}; + + +static enum backlight_states +{ + BACKLIGHT_CONTROL_IDLE, + BACKLIGHT_CONTROL_OFF, + BACKLIGHT_CONTROL_ON, + BACKLIGHT_CONTROL_SET, + BACKLIGHT_CONTROL_FADE +} backlight_control; + +static unsigned char _backlight_brightness; +static unsigned char backlight_target; + + +/* Assumes that the backlight has been initialized */ +void _backlight_set_brightness(int brightness) +{ + /* stop the interrupt from messing us up */ + backlight_control = BACKLIGHT_CONTROL_IDLE; + _backlight_brightness = log_brightness[brightness]; + backlight_control = BACKLIGHT_CONTROL_SET; +} + +void _backlight_set_state (unsigned int level) +{ + if (level == 0) + GPGDAT &= ~GPIO_LCD_PWR; + else + GPGDAT |= GPIO_LCD_PWR; +} + +/* led_control_service runs in interrupt context - be brief! + * This service is called once per interrupt timer tick - 100 times a second. + * + * There should be at most only one i2c operation per call - if more are need + * the calls should be spread across calls. + * + * Putting all led servicing in one thread means that we wont step on any + * i2c operations - they are all serialized here in the ISR tick. It also + * insures that we get called at equal timing for good visual effect. + */ +#ifndef BOOTLOADER +static void led_control_service(void) +{ + switch (backlight_control) + { + case BACKLIGHT_CONTROL_IDLE: + backlight_control = BACKLIGHT_CONTROL_IDLE; + break; + case BACKLIGHT_CONTROL_OFF: + _backlight_set_brightness(0); + backlight_control = BACKLIGHT_CONTROL_IDLE; + break; + case BACKLIGHT_CONTROL_ON: + _backlight_set_brightness(255); + backlight_control = BACKLIGHT_CONTROL_IDLE; + break; + case BACKLIGHT_CONTROL_SET: + _backlight_set_brightness(255); + backlight_control = BACKLIGHT_CONTROL_IDLE; + break; + case BACKLIGHT_CONTROL_FADE: + _backlight_set_brightness(0); + backlight_control = BACKLIGHT_CONTROL_IDLE; + break; + default: + backlight_control = BACKLIGHT_CONTROL_IDLE; + break; + } +} +#endif /* BOOTLOADER */ + +static void __backlight_dim(bool dim_now) +{ + /* dont let the interrupt tick happen */ + backlight_control = BACKLIGHT_CONTROL_IDLE; + backlight_target = dim_now ? 0 : _backlight_brightness; + if(backlight_target==0 && _backlight_brightness==0) + { + if(dim_now == false) + backlight_control = BACKLIGHT_CONTROL_ON; + else + backlight_control = BACKLIGHT_CONTROL_OFF; + } + else + backlight_control = BACKLIGHT_CONTROL_FADE; +} + +void _backlight_on(void) +{ +#ifdef HAVE_LCD_ENABLE + lcd_enable(true); /* power on lcd + visible display */ +#endif + __backlight_dim(false); +} + +void _backlight_off(void) +{ + __backlight_dim(true); +} + + +bool _backlight_init(void) +{ + unsigned char brightness = log_brightness[DEFAULT_BRIGHTNESS_SETTING]; + _backlight_brightness = brightness; + + backlight_control = BACKLIGHT_CONTROL_ON; + + _backlight_set_state (1); + S3C2440_GPIO_CONFIG (GPGCON, 4, GPIO_OUTPUT); + +#ifndef BOOTLOADER + /* put the led control on the tick list */ + tick_add_task(led_control_service); +#endif + return true; +} diff --git a/firmware/target/arm/s3c2440/mini2440/backlight-target.h b/firmware/target/arm/s3c2440/mini2440/backlight-target.h new file mode 100644 index 0000000000..c804f16bcc --- /dev/null +++ b/firmware/target/arm/s3c2440/mini2440/backlight-target.h @@ -0,0 +1,31 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 by Linus Nielsen Feltzing + * + * 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 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef BACKLIGHT_TARGET_H +#define BACKLIGHT_TARGET_H + +#define GPIO_LCD_PWR (1 << 4) /* GPIO.G4 */ + +bool _backlight_init(void); +void _backlight_on(void); +void _backlight_off(void); +void _backlight_set_brightness(int brightness); + +#endif diff --git a/firmware/target/arm/s3c2440/mini2440/button-mini2440.c b/firmware/target/arm/s3c2440/mini2440/button-mini2440.c new file mode 100644 index 0000000000..787c04d1ef --- /dev/null +++ b/firmware/target/arm/s3c2440/mini2440/button-mini2440.c @@ -0,0 +1,80 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Bob Cousins + * + * 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 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "cpu.h" +#include "system.h" +#include "button.h" +#include "kernel.h" + +void button_init_device(void) +{ + /* Configure port directions and enable internal pullups on button inputs */ + + /* These are the standard 6 buttons on the Mini2440 */ + S3C2440_GPIO_CONFIG (GPGCON, 0, GPIO_INPUT); + S3C2440_GPIO_CONFIG (GPGCON, 3, GPIO_INPUT); + S3C2440_GPIO_CONFIG (GPGCON, 5, GPIO_INPUT); + S3C2440_GPIO_CONFIG (GPGCON, 6, GPIO_INPUT); + S3C2440_GPIO_CONFIG (GPGCON, 7, GPIO_INPUT); + S3C2440_GPIO_CONFIG (GPGCON, 11, GPIO_INPUT); + + S3C2440_GPIO_PULLUP (GPGUP, 0, GPIO_PULLUP_ENABLE); + S3C2440_GPIO_PULLUP (GPGUP, 3, GPIO_PULLUP_ENABLE); + S3C2440_GPIO_PULLUP (GPGUP, 5, GPIO_PULLUP_ENABLE); + S3C2440_GPIO_PULLUP (GPGUP, 6, GPIO_PULLUP_ENABLE); + S3C2440_GPIO_PULLUP (GPGUP, 7, GPIO_PULLUP_ENABLE); + S3C2440_GPIO_PULLUP (GPGUP, 11, GPIO_PULLUP_ENABLE); + + /* These are additional buttons on my add on keypad */ + S3C2440_GPIO_CONFIG (GPGCON, 9, GPIO_INPUT); + S3C2440_GPIO_CONFIG (GPGCON, 10, GPIO_INPUT); + S3C2440_GPIO_PULLUP (GPGUP, 9, GPIO_PULLUP_ENABLE); + S3C2440_GPIO_PULLUP (GPGUP, 10, GPIO_PULLUP_ENABLE); + +} + +inline bool button_hold(void) +{ + return 0; +} + +int button_read_device(void) +{ + int btn = BUTTON_NONE; + + /* Read the buttons - active low */ + btn = (GPGDAT & BUTTON_MAIN) ^ BUTTON_MAIN; + + return btn; +} + +void touchpad_set_sensitivity(int level) +{ + (void)level; + /* No touchpad */ +} + +bool headphones_inserted(void) +{ + /* No detect */ + return false; +} diff --git a/firmware/target/arm/s3c2440/mini2440/button-target.h b/firmware/target/arm/s3c2440/mini2440/button-target.h new file mode 100644 index 0000000000..4a84014462 --- /dev/null +++ b/firmware/target/arm/s3c2440/mini2440/button-target.h @@ -0,0 +1,70 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Bob Cousins + * + * 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 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef _BUTTON_TARGET_H_ +#define _BUTTON_TARGET_H_ + +#include +#include "config.h" + + +bool button_hold(void); +void button_init_device(void); +int button_read_device(void); +void touchpad_set_sensitivity(int level); + +/* Mini2440 specific button codes */ + +#define BUTTON_ONE 0x0001 +#define BUTTON_TWO 0x0008 +#define BUTTON_THREE 0x0020 +#define BUTTON_FOUR 0x0040 +#define BUTTON_FIVE 0x0080 +#define BUTTON_SIX 0x0800 + +/* Add on buttons */ +#define BUTTON_SEVEN 0x0200 +#define BUTTON_EIGHT 0x0400 + +#define BUTTON_MENU BUTTON_ONE +#define BUTTON_UP BUTTON_TWO +#define BUTTON_SELECT BUTTON_THREE +#define BUTTON_DOWN BUTTON_FOUR +#define BUTTON_LEFT BUTTON_FIVE +#define BUTTON_RIGHT BUTTON_SIX + +/* Add on buttons */ +#define BUTTON_A BUTTON_SEVEN +#define BUTTON_POWER BUTTON_EIGHT + +/* TODO: bodge to keep keymap-mini2440 happy */ +#define BUTTON_VOL_DOWN 0x4000 +#define BUTTON_VOL_UP 0x8000 + +#define BUTTON_MAIN (BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT | \ + BUTTON_UP |BUTTON_DOWN|BUTTON_SELECT | \ + BUTTON_A |BUTTON_POWER ) + +#define BUTTON_REMOTE 0 + +#define POWEROFF_BUTTON BUTTON_MENU +#define POWEROFF_COUNT 10 + +#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/s3c2440/mini2440/lcd-target.h b/firmware/target/arm/s3c2440/mini2440/lcd-target.h new file mode 100644 index 0000000000..b2882e2390 --- /dev/null +++ b/firmware/target/arm/s3c2440/mini2440/lcd-target.h @@ -0,0 +1,43 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Bob Cousins, Lyre Project + * + * 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 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +extern void lcd_enable(bool state); + +/* Setup for Mini2440, 3.5" TFT LCD Touchscreen */ + +/* Config values for LCDCON1 */ +#define LCD_CLKVAL 4 +#define LCD_MMODE 0 +#define LCD_PNRMODE 3 +#define LCD_BPPMODE 12 +#define LCD_ENVID 1 + +/* Config values for LCDCON2 */ +#define LCD_UPPER_MARGIN 1 +#define LCD_LOWER_MARGIN 4 +#define LCD_VSYNC_LEN 1 + +/* Config values for LCDCON3 */ +#define LCD_RIGHT_MARGIN 0 +#define LCD_LEFT_MARGIN 25 + +/* Config values for LCDCON4 */ +#define LCD_HSYNC_LEN 4 diff --git a/firmware/target/arm/s3c2440/mini2440/led-mini2440.c b/firmware/target/arm/s3c2440/mini2440/led-mini2440.c new file mode 100644 index 0000000000..f541d75273 --- /dev/null +++ b/firmware/target/arm/s3c2440/mini2440/led-mini2440.c @@ -0,0 +1,66 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Bob Cousins + * + * 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 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "config.h" +#include "cpu.h" +#include "kernel.h" + +/* LED functions for debug */ + +void led_init (void) +{ + S3C2440_GPIO_CONFIG (GPBCON, 5, GPIO_OUTPUT); + S3C2440_GPIO_CONFIG (GPBCON, 6, GPIO_OUTPUT); + S3C2440_GPIO_CONFIG (GPBCON, 7, GPIO_OUTPUT); + S3C2440_GPIO_CONFIG (GPBCON, 8, GPIO_OUTPUT); + + S3C2440_GPIO_PULLUP (GPBUP, 5, GPIO_PULLUP_DISABLE); + S3C2440_GPIO_PULLUP (GPBUP, 6, GPIO_PULLUP_DISABLE); + S3C2440_GPIO_PULLUP (GPBUP, 7, GPIO_PULLUP_DISABLE); + S3C2440_GPIO_PULLUP (GPBUP, 8, GPIO_PULLUP_DISABLE); +} + +/* Turn on one or more LEDS */ +void set_leds (int led_mask) +{ + GPBDAT &= ~led_mask; +} + +/* Turn off one or more LEDS */ +void clear_leds (int led_mask) +{ + GPBDAT |= led_mask; +} + +/* Alternate flash pattern1 and pattern2 */ +/* Never returns */ +void led_flash (int led_pattern1, int led_pattern2) +{ + while (1) + { + set_leds (led_pattern1); + sleep(HZ/2); + clear_leds (led_pattern1); + + set_leds(led_pattern2); + sleep(HZ/2); + clear_leds (led_pattern2); + } +} diff --git a/firmware/target/arm/s3c2440/mini2440/led-mini2440.h b/firmware/target/arm/s3c2440/mini2440/led-mini2440.h new file mode 100644 index 0000000000..0aaad1c9a4 --- /dev/null +++ b/firmware/target/arm/s3c2440/mini2440/led-mini2440.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Bob Cousins + * + * 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 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef _LED_MINI2440_H_ +#define _LED_MINI2440_H_ + +/* LED functions for debug etc */ + +#define LED1 0x0020 /* GPB5 */ +#define LED2 0x0040 /* GPB6 */ +#define LED3 0x0080 /* GPB7 */ +#define LED4 0x0100 /* GPB8 */ + +#define LED_NONE 0x0000 +#define LED_ALL (LED1|LED2|LED3|LED4) + +void led_init (void); + +/* Turn on one or more LEDS */ +void set_leds (int led_mask); + +/* Turn off one or more LEDS */ +void clear_leds (int led_mask); + +/* Alternate flash of pattern1 and pattern2 - never returns */ +void led_flash (int led_pattern1, int led_pattern2); + +#endif /* _LED_MINI2440_H_ */ diff --git a/firmware/target/arm/s3c2440/mini2440/power-mini2440.c b/firmware/target/arm/s3c2440/mini2440/power-mini2440.c new file mode 100644 index 0000000000..d4b00751e0 --- /dev/null +++ b/firmware/target/arm/s3c2440/mini2440/power-mini2440.c @@ -0,0 +1,55 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Bob Cousins + * + * 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 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "config.h" +#include "cpu.h" +#include +#include +#include "kernel.h" +#include "system.h" +#include "power.h" +#include "led-mini2440.h" + +void power_init(void) +{ + /* Nothing to do */ +} + +unsigned int power_input_status(void) +{ + unsigned int status = 0; + + /* Always on*/ + status = POWER_INPUT_MAIN; + return status; +} + +/* Returns true if the unit is charging the batteries. */ +bool charging_state(void) +{ + return false; +} + +void power_off(void) +{ + /* we don't have any power control, user must do it */ + led_flash (LED_NONE, LED_ALL); + while (1); +} -- cgit v1.2.3