close Warning: Can't use blame annotator:
No changeset 2 in the repository

source: svn/newcon3bcm2_21bu/dst/dhl/src/DHL_SYS_Impl.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 3.3 KB
RevLine 
1/*
2        DHL_SYS_Impl.h
3*/
4
5
6#ifndef __DHL_SYS_IMPL_H__
7#define __DHL_SYS_IMPL_H__
8
9#include "DHL_Types.h"
10#include "DHL_SYS.h"
11
12
13//------------------------------------------
14//  GPIO list.
15//
16/*
17        00: shared with UART RX
18        01: shared with UART TX
19
20        03: LED green. (cannot control RED color)
21       
22        04: channel down button
23        05: channel up button
24       
25        //06: menu button
26        //07: select button
27
28        08: audio mute (dst own)
29       
30        11: ch 3/4 switch select
31
32        29: loop-through or ch 3/4 out
33        30: flash write protect (active low)
34       
35        14~25: used as boot strap pins.
36
37        note:
38                power button is directly connected to Wake-up module.
39                LED control
40
41
42BKTODO: DHL_SYS_Config.h ÀÇ Á¤ÀÇ¿Í ±¸ºÐÇØ¼­ Çϳª¸¸ »ç¿ëÇÒ °Í.
43*/
44
45#define GPIO_LED_GREEN          9
46#define GPIO_LED_RED                    4
47#define GPIO_CH_DN                      5
48#define GPIO_CH_UP                      6
49#define GPIO_AUDIO_MUTE         118  /* 0: mute audio. 1: unmute.  default is mute by pull down. */
50#define GPIO_CH34_SW_IN   11  /* 0: ch3, 1: ch4  ==> BKTODO: NVMÀ¸·Î ¿Å±è (¸Þ´º¿¡¼­ »ç¿ëÀÚ ÀÔ·ÂÀ» ÀúÀåÇØ¼­ ó¸®ÇÔ)*/
51#define GPIO_PATH_CONTROL 29  /* 0: loop-through, 1: CH 3/4. default is pull-down.  BKTODO: */
52#define GPIO_FLASH_WP  30  /* flash write protect. default is pull-down. */
53
54
55//------------------------------------------
56//  GPIO config flags..
57
58// I/O direction
59#define DHL_GPIO_OUTPUT  0x0
60#define DHL_GPIO_INPUT   0x1
61#define DHL_GPIO_IO_MASK 0x1
62
63// interrupt. if not set, interrupt is disabled.
64#define DHL_GPIO_RISING_EDGE 0x10
65#define DHL_GPIO_FALLING_EDGE 0x20
66#define DHL_GPIO_BOTH_EDGE 0x30
67#define DHL_GPIO_EDGE_MASK 0x30
68
69
70
71//------------------------------------------
72//  callback type and it's state param
73
74#define eDHL_SYS_CB_POWER (eDHL_SYS_CB_BUTTON+33) // 33 is beyond gpio number. it is safe.
75        // state:
76        //  no meaning. it notifies that power button is just pressed.
77       
78#define eDHL_SYS_CB_CHUP  (eDHL_SYS_CB_BUTTON+GPIO_CH_UP)
79#define eDHL_SYS_CB_CHDN  (eDHL_SYS_CB_BUTTON+GPIO_CH_DN)
80        // state:
81        // 0: it is first key.
82        // 1: it is repeat key.
83
84#define eDHL_SYS_CB_RFM   (eDHL_SYS_CB_SWITCH+0)
85        // state:
86        // value of gpio GPIO_CH34_SW_IN
87
88
89
90//------------------------------------------
91
92#define DHL_BOOTCMD_MAGIC  0xB64925DA
93
94#define DHL_BOOTCMD_DOWNLOAD  0x1
95        // parameter: none
96        // meaning: go into download mode
97
98#define DHL_BOOTCMD_FUPDATE 0x2
99        // parameter: none
100        // meaning: go into flash update mode
101
102
103//------------------------------------------
104
105
106//void dhl_sys_gpio_config(UINT32 num, UINT32 flag, int value);
107
108int dhl_sys_gpio_rw(UINT32 num, int bData, BOOL bWrite);
109
110//void dhl_sys_set_red_led(int bOn);
111
112int dhl_sys_read_power_btn(void);
113
114
115void dhl_sys_reset(int boot_cmd);
116
117void dhl_sys_standby(void);
118
119
120UINT32 dhl_sys_get_clock_freq(int type);
121
122UINT32 dhl_sys_get_cpu_tick(void);
123
124UINT32 dhl_sys_cpu_ticks_per_ms(void);
125
126#define dhl_sys_cpu_tick_gap_ms(tick_new, tick_old) \
127        (((tick_new) - (tick_old)) / dhl_sys_cpu_ticks_per_ms())
128
129
130// cafrii comment!
131// this api should be used with care!!
132UINT32 dhl_sys_get_ms_tick(void);
133
134
135void dhl_sys_config_vdac(BOOL bEnable);
136
137void dhl_sys_enable_watchdog(BOOL bEnable, UINT32 period);
138
139void dhl_sys_register_callback(void (*cb)(int type, UINT32, UINT32), UINT32 userparam);
140void dhl_sys_notify_callback(int type, UINT32 state);
141
142void dhl_sys_init(void);
143
144
145#endif /* __DHL_SYS_IMPL_H__ */
146
147
Note: See TracBrowser for help on using the repository browser.