source: UsbWattMeter/trunk/src/usb_watt_meter/main.h@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 5.5 KB
Line 
1/*
2 * TOPPERS ECHONET Lite Communication Middleware
3 *
4 * Copyright (C) 2016 Cores Co., Ltd. Japan
5 *
6 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
7 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
8 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
9 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
10 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
11 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
12 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
13 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
14ƒƒ“ƒgi—˜—p
15 * ŽÒƒ}ƒjƒ…
16ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
17 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
18 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
19 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
20 * ‚ƁD
21 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
22ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
23ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
24 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
25 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
26 * •ñ‚·‚邱‚ƁD
27 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
28 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
29 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
30 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
31 * –Ɛӂ·‚邱‚ƁD
32 *
33 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
34 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
35 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
36 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
37 * ‚̐ӔC‚𕉂í‚È‚¢D
38 *
39 * @(#) $Id: main.h 164 2016-03-07 11:33:50Z coas-nagasima $
40 */
41
42#ifndef _MAIN_H_
43#define _MAIN_H_
44
45/*
46 * ƒTƒ“ƒvƒ‹ƒvƒƒOƒ‰ƒ€(1)‚̃wƒbƒ_ƒtƒ@ƒCƒ‹
47 */
48
49/*
50 * ƒ^[ƒQƒbƒgˆË‘¶‚Ì’è‹`
51 */
52#include <kernel.h>
53#include "target_config.h"
54#include "echonet.h"
55
56/*
57 * Šeƒ^ƒXƒN‚Ì—Dæ“x‚Ì’è‹`
58 */
59
60#define MAIN_PRIORITY 5 /* ƒƒCƒ“ƒ^ƒXƒN‚Ì—Dæ“x */
61
62#define MAIN_STACK_SIZE 1024 /* ƒXƒ^ƒbƒN—̈æ‚̃TƒCƒY */
63
64#define EOJ_X3_LOCAL_NODE 1 /* ƒm[ƒhƒvƒƒtƒ@ƒCƒ‹ƒIƒuƒWƒFƒNƒg‚̃Cƒ“ƒXƒ^ƒ“ƒXƒR[ƒh */
65
66#define EOJ_X3_ELECTRIC_ENERGY_METER_1 1 /* “d—͗ʃ[ƒ^‚P‚̃Cƒ“ƒXƒ^ƒ“ƒXƒR[ƒh */
67#define EOJ_X3_ELECTRIC_ENERGY_METER_2 2 /* “d—͗ʃ[ƒ^‚Q‚̃Cƒ“ƒXƒ^ƒ“ƒXƒR[ƒh */
68#define EOJ_X3_ELECTRIC_ENERGY_METER_3 3 /* “d—͗ʃ[ƒ^‚R‚̃Cƒ“ƒXƒ^ƒ“ƒXƒR[ƒh */
69#define EOJ_X3_ELECTRIC_ENERGY_METER_4 4 /* “d—͗ʃ[ƒ^‚S‚̃Cƒ“ƒXƒ^ƒ“ƒXƒR[ƒh */
70#define EOJ_X3_ELECTRIC_ENERGY_METER_5 5 /* “d—͗ʃ[ƒ^‚T‚̃Cƒ“ƒXƒ^ƒ“ƒXƒR[ƒh */
71#define EOJ_X3_ELECTRIC_ENERGY_METER_6 6 /* “d—͗ʃ[ƒ^‚U‚̃Cƒ“ƒXƒ^ƒ“ƒXƒR[ƒh */
72
73#define KMM_SIZE 8192 /* ƒJ[ƒlƒ‹‚ªŠ„‚è•t‚¯‚郁ƒ‚ƒŠ—̈æ‚̃TƒCƒY */
74
75/*
76 * ŠÖ”‚̃vƒƒgƒ^ƒCƒvéŒ¾
77 */
78#ifndef TOPPERS_MACRO_ONLY
79
80extern void main_task(intptr_t exinf);
81
82#ifdef __CA850__
83#pragma pack(1)
84#elif __RX
85#pragma pack
86#elif _MSC_VER
87#pragma pack(push, 1)
88#endif
89
90/*
91 * ‚u‚…
92‚’‚“‚‰‚‚Žî•ñ‚ÌŒ^
93 */
94struct version_information_t {
95 /* ƒƒWƒƒ[ƒo[ƒWƒ‡ƒ“(¬”“_ˆÈã) */
96 uint8_t major_version_number;
97 /* ƒ}ƒCƒi[ƒo[ƒWƒ‡ƒ“(¬”“_ˆÈ‰º) */
98 uint8_t minor_version_number;
99 /* “d•¶ƒ^ƒCƒv */
100 uint8_t message_type[2];
101};
102
103/*
104 * ƒ[ƒJ[ƒR[ƒh‚ÌŒ^
105 */
106struct manufacturer_code_t {
107 /* ƒ[ƒJ[ƒR[ƒh */
108 uint8_t manufacturer_code[3];
109};
110
111/*
112 * Ž¯•Ê”ԍ†‚ÌŒ^
113 */
114struct node_identification_number_t {
115 /* ‰ºˆÊ’ʐM‘wIDƒtƒB[ƒ‹ƒh */
116 uint8_t lower_communication_id_field;
117 /* ƒ[ƒJ[ƒR[ƒh */
118 struct manufacturer_code_t manufacturer_code;
119 /* ƒ†ƒj[ƒNID•”(ƒ[ƒJ[“ÆŽ©) */
120 uint8_t unique_id_section[13];
121};
122
123/*
124 * ‹KŠi‚u‚…
125‚’‚“‚‰‚‚Žî•ñ‚ÌŒ^
126 */
127struct standard_version_information_t {
128 /* ΁Տ1(for future reserved) */
129 uint8_t reserved1;
130 /* ΁Տ2(for future reserved) */
131 uint8_t reserved2;
132 /* ƒŠƒŠ[ƒX‡‚ðASCII‚ÅŽ¦‚· */
133 uint8_t order_of_release;
134 /* ΁Տ4(for future reserved) */
135 uint8_t reserved3;
136};
137
138/*
139 * ƒm[ƒhƒvƒƒtƒ@ƒCƒ‹ƒIƒuƒWƒFƒNƒg
140 */
141struct node_profile_object_t {
142 /* “®ìó‘Ô */
143 uint8_t operation_status;
144 /* ‚u‚…
145‚’‚“‚‰‚‚Žî•ñ */
146 struct version_information_t version_information;
147 /* Ž¯•Ê”ԍ† */
148 struct node_identification_number_t identification_number;
149 /* ˆÙí“à—e */
150 uint16_t fault_content;
151 /* ƒ[ƒJ[ƒR[ƒh */
152 struct manufacturer_code_t manufacturer_code;
153};
154
155/*
156 * “d—͗ʃ[ƒ^
157 */
158struct watt_hour_meter_t {
159 /* “®ìó‘Ô */
160 uint8_t operation_status;
161 /* Ý’uêŠ */
162 uint8_t installation_location;
163 /* ‹KŠi‚u‚…
164‚’‚“‚‰‚‚Žî•ñ */
165 struct standard_version_information_t standard_version_information;
166 /* ˆÙí”­¶ó‘Ô */
167 uint8_t fault_status;
168 /* ƒ[ƒJ[ƒR[ƒh */
169 struct manufacturer_code_t manufacturer_code;
170 /* ÏŽZ“d—Í—Ê’PˆÊ */
171 uint8_t integral_electric_energy_unit;
172 /* ÏŽZ“d—Í—ÊŒv‘ª’l */
173 uint32_t integral_electric_energy_measurement_value;
174 /* ÏŽZ“d—Í—ÊŒv‘ª’l—š—ð‚P */
175 uint32_t integral_electric_energy_measurement_log[48];
176 int current_pos;
177};
178
179#ifdef __CA850__
180#pragma pack(8)
181#elif __RX
182#pragma unpack
183#elif _MSC_VER
184#pragma pack(pop)
185#endif
186
187extern struct node_profile_object_t local_node_data; /* ƒm[ƒhƒvƒƒtƒ@ƒCƒ‹ƒIƒuƒWƒFƒNƒg‚̃f[ƒ^ */
188
189extern struct watt_hour_meter_t electric_energy_meter_data[6]; /* “d—͗ʃ[ƒ^‚P`‚U‚̃f[ƒ^ */
190
191EPRP_SETTER onoff_prop_set;
192EPRP_SETTER alarm_prop_set;
193EPRP_SETTER time_prop_set;
194EPRP_GETTER time_prop_get;
195EPRP_SETTER date_prop_set;
196EPRP_GETTER date_prop_get;
197EPRP_GETTER watt_hour_meter_integral_electric_energy_measurement_value_get;
198EPRP_GETTER watt_hour_meter_integral_electric_energy_unit_get;
199EPRP_GETTER watt_hour_meter_integral_electric_energy_measurement_log_get;
200
201#endif /* TOPPERS_MACRO_ONLY */
202
203#endif /* of #ifndef _MAINN_H_ */
Note: See TracBrowser for help on using the repository browser.