diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-10-27 11:16:21 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-10-27 11:16:21 +0900 |
commit | 947c78887e791596d4a5ec2d1079f8b1a049628b (patch) | |
tree | 3981e88eb8764d7180722f8466f36b756dc005af /input_hal/inc | |
parent | 706ad73eb02caf8532deaf5d38995bd258725cb8 (diff) |
basesystem 0.1sandbox/ToshikazuOhiwa/basesystem
Diffstat (limited to 'input_hal/inc')
-rw-r--r-- | input_hal/inc/input_drm.h | 22 | ||||
-rw-r--r-- | input_hal/inc/input_hal_debug.h | 57 | ||||
-rw-r--r-- | input_hal/inc/input_hal_frameworkunifiedlog.h | 76 | ||||
-rw-r--r-- | input_hal/inc/input_hal_internal.h | 107 | ||||
-rw-r--r-- | input_hal/inc/input_touch_ilitek.h | 27 | ||||
-rw-r--r-- | input_hal/inc/input_udev_monitor.h | 40 | ||||
-rw-r--r-- | input_hal/inc/input_util.h | 46 |
7 files changed, 375 insertions, 0 deletions
diff --git a/input_hal/inc/input_drm.h b/input_hal/inc/input_drm.h new file mode 100644 index 00000000..11ffc328 --- /dev/null +++ b/input_hal/inc/input_drm.h @@ -0,0 +1,22 @@ +/* + * @copyright Copyright (c) 2018-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INC_INPUT_DRM_H_ +#define INC_INPUT_DRM_H_ + +int GetPanelSpecResolutionInput(int *reso_h, int *reso_v); + +#endif // INC_INPUT_DRM_H_ diff --git a/input_hal/inc/input_hal_debug.h b/input_hal/inc/input_hal_debug.h new file mode 100644 index 00000000..2fb7d86d --- /dev/null +++ b/input_hal/inc/input_hal_debug.h @@ -0,0 +1,57 @@ +/* + * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INC_INPUT_HAL_DEBUG_H_ +#define INC_INPUT_HAL_DEBUG_H_ + +#include "input_hal_frameworkunifiedlog.h" + +// #define INPUT_DEBUG + +#ifdef INPUT_DEBUG +#define INPUT_DBG_LOG(zone_index, fmt, ...) \ + FRAMEWORKUNIFIEDLOG(zone_index, __FUNCTION__, fmt, ## __VA_ARGS__); +#else +#define INPUT_DBG_LOG(zone_index, fmt, ...) +#endif + +/* Log output control flag */ +#define INPUT_LOG_ENABLE_TRACE /* Normal log(Trace) */ +#define INPUT_LOG_ENABLE_ERROR /* Error log */ +#define INPUT_LOG_ENABLE_RETAIL /* Debug log */ + +#ifdef INPUT_LOG_ENABLE_TRACE +#define INPUT_LOG_TRACE(fmt, ...) \ + FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, fmt, ## __VA_ARGS__); +#else +#define INPUT_LOG_TRACE(fmt, ...) +#endif + +#ifdef INPUT_LOG_ENABLE_ERROR +#define INPUT_ERROR_LOG(fmt, ...) \ + FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, fmt, ## __VA_ARGS__); +#else +#define INPUT_ERROR_LOG(fmt, ...) +#endif + +#ifdef INPUT_LOG_ENABLE_RETAIL +#define INPUT_RETAIL_LOG(fmt, ...) \ + FRAMEWORKUNIFIEDLOG(ZONE_HMI_DBG, __FUNCTION__, fmt, ## __VA_ARGS__); +#else +#define INPUT_RETAIL_LOG(fmt, ...) +#endif + +#endif // INC_INPUT_HAL_DEBUG_H_ diff --git a/input_hal/inc/input_hal_frameworkunifiedlog.h b/input_hal/inc/input_hal_frameworkunifiedlog.h new file mode 100644 index 00000000..c54f16a4 --- /dev/null +++ b/input_hal/inc/input_hal_frameworkunifiedlog.h @@ -0,0 +1,76 @@ +/* + * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INC_INPUT_HAL_FRAMEWORKUNIFIEDLOG_H_ +#define INC_INPUT_HAL_FRAMEWORKUNIFIEDLOG_H_ + +#include <native_service/ns_logger_if.h> + +#define ZONE_INIT ZONEMASK(10) +#define ZONE_FUNC ZONEMASK(11) +#define ZONE_MEM ZONEMASK(12) +#define ZONE_13 ZONEMASK(13) +#define ZONE_14 ZONEMASK(14) +#define ZONE_15 ZONEMASK(15) +#define ZONE_16 ZONEMASK(16) +#define ZONE_17 ZONEMASK(17) +#define ZONE_18 ZONEMASK(18) +#define ZONE_19 ZONEMASK(19) +#define ZONE_20 ZONEMASK(20) +#define ZONE_21 ZONEMASK(21) +#define ZONE_22 ZONEMASK(22) +#define ZONE_23 ZONEMASK(23) +#define ZONE_24 ZONEMASK(24) +#define ZONE_25 ZONEMASK(25) +#define ZONE_26 ZONEMASK(26) +#define ZONE_27 ZONEMASK(27) +#define ZONE_28 ZONEMASK(28) +#define ZONE_INFO ZONEMASK(29) +#define ZONE_WARN ZONEMASK(30) +#define ZONE_ERR ZONEMASK(31) + +#define ZONE_TEXT_10 "Init" +#define ZONE_TEXT_11 "Function" +#define ZONE_TEXT_12 "Memory" +#define ZONE_TEXT_13 "" +#define ZONE_TEXT_14 "" +#define ZONE_TEXT_15 "" +#define ZONE_TEXT_16 "" +#define ZONE_TEXT_17 "" +#define ZONE_TEXT_18 "" +#define ZONE_TEXT_19 "" +#define ZONE_TEXT_20 "" +#define ZONE_TEXT_21 "" +#define ZONE_TEXT_22 "" +#define ZONE_TEXT_23 "" +#define ZONE_TEXT_24 "" +#define ZONE_TEXT_25 "" +#define ZONE_TEXT_26 "" +#define ZONE_TEXT_27 "" +#define ZONE_TEXT_28 "" +#define ZONE_TEXT_29 "Info" +#define ZONE_TEXT_30 "Warning" +#define ZONE_TEXT_31 "Error" + +#ifndef FRAMEWORKUNIFIEDLOGOPTIONS +#define FRAMEWORKUNIFIEDLOGOPTIONS (LSHAREDMEM) // LPRINT , LMSGQ, LSLOGGER +#endif + +#ifndef FRAMEWORKUNIFIEDLOGAPPZONES +#define FRAMEWORKUNIFIEDLOGAPPZONES ZONE_ERR, ZONE_WARN, ZONE_INFO +#endif + +extern const CHAR AppName[]; // NOLINT (defind outside) +#endif // INC_INPUT_HAL_FRAMEWORKUNIFIEDLOG_H_ diff --git a/input_hal/inc/input_hal_internal.h b/input_hal/inc/input_hal_internal.h new file mode 100644 index 00000000..4e57aed9 --- /dev/null +++ b/input_hal/inc/input_hal_internal.h @@ -0,0 +1,107 @@ +/* + * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INC_INPUT_HAL_INTERNAL_H_ +#define INC_INPUT_HAL_INTERNAL_H_ + +/* + * Touch panel operation function info + */ +struct TouchHal { + /** + * \~english Make touch panel start work. + */ + int (* start)(void); + /** + * \~english Get touch panel device horizontal resolution. + */ + int (* get_reso_h)(int *); + /** + * \~english Get touch panel device vertical resolution. + */ + int (* get_reso_v)(int *); + /** + * \~english Get whether X axis is inversion. + */ + int (* get_reverse_axis_x)(bool *); + /** + * \~english Get whether Y axis is inversion. + */ + int (* get_reverse_axis_y)(bool *); + /** + * \~english Config touch panel. + */ + int (* config)(const char *, int, int); + /** + * \~english Get touch panel device name. + */ + int (* get_touch_devicename)(char*, size_t); + /** + * \~english Get touch panel key device name. + */ + int (* get_key_devicename)(char*, size_t); + /** + * \~english Execute touch panel self test. + */ + int (* selftest)(int, void *); + /** + * \~english Get touch panel config status. + */ + int (* get_config_status)(int *); + /** + * \~english Set whether the driver sends touch panel data or not. + */ + int (* set_touch_lock)(int); + /** + * \~english Request touch panel touch suspend. + */ + int (* set_touch_suspend)(void); + /** + * \~english Set touch panel sensitivity level. + */ + int (* set_sensitivity_level)(int); + /** + * \~english Get touch panel sensitivity level. + */ + int (* get_sensitivity_level)(int *); + /** + * \~english Notify radio scan frequency. + */ + int (* notify_radio_scan_frequency)(struct RadioInfoTouch *); +}; + + +/** + * Config touch panel + */ +int ConfigTouch(const char *path , int resolution_h, int resolution_v); + +/** + * Get touch panel device name + */ +int GetPanelNameTouch(char* name, size_t buf_length); + +/** + * Get touch panel key device name + */ +int GetKeyNameTouch(char* name, size_t buf_length); + +/** + * Get touch panel config status + */ +int GetConfigStatusTouch(int *status); + +#endif // INC_INPUT_HAL_INTERNAL_H_ diff --git a/input_hal/inc/input_touch_ilitek.h b/input_hal/inc/input_touch_ilitek.h new file mode 100644 index 00000000..6d76d839 --- /dev/null +++ b/input_hal/inc/input_touch_ilitek.h @@ -0,0 +1,27 @@ +/* + * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INC_INPUT_TOUCH_ILITEK_H_ +#define INC_INPUT_TOUCH_ILITEK_H_ + +#include "input_hal_internal.h" + +/* + * Init ilitek touch panel operation function + */ +int InputTouchIlitekInit(struct TouchHal *touch); + +#endif // INC_INPUT_TOUCH_ILITEK_H_ diff --git a/input_hal/inc/input_udev_monitor.h b/input_hal/inc/input_udev_monitor.h new file mode 100644 index 00000000..0391f6f6 --- /dev/null +++ b/input_hal/inc/input_udev_monitor.h @@ -0,0 +1,40 @@ +/* + * @copyright Copyright (c) 2018-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INC_INPUT_UDEV_MONITOR_H_ +#define INC_INPUT_UDEV_MONITOR_H_ + +#include <peripheral_service/aglinput.h> + +#include "input_util.h" + +#define INPUT_DEVICE_NODE_LENGTH_MAX (32) + +struct InputInputDeviceList{ + int fd; + int device_assort; + char device_node[INPUT_DEVICE_NODE_LENGTH_MAX]; + struct InputUtilList list; +}; + +struct InputUdevMonitorInfo { + struct udev *udev; + struct udev_monitor *monitor; + struct InputInputDeviceList dev_list; +}; + +int32_t InputUdevMonitorThreadCreate(void); + +#endif // INC_INPUT_UDEV_MONITOR_H_ diff --git a/input_hal/inc/input_util.h b/input_hal/inc/input_util.h new file mode 100644 index 00000000..6d6a4009 --- /dev/null +++ b/input_hal/inc/input_util.h @@ -0,0 +1,46 @@ +/* + * @copyright Copyright (c) 2018-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INC_INPUT_UTIL_H_ +#define INC_INPUT_UTIL_H_ + +#include <native_service/frameworkunified_types.h> + +struct InputUtilList { + struct InputUtilList *next; + struct InputUtilList *prev; +}; + +#define INPUT_INIT_LIST_HEAD(ptr) \ + (ptr)->next = (ptr); (ptr)->prev = (ptr); + +#define input_list_entry(ptr, type, member) \ + (reinterpret_cast<type *>( \ + reinterpret_cast<char *>(ptr) - (size_t)(&(reinterpret_cast<type *>(0))->member))) + +#define input_list_for_each(pos, head) \ + for (pos = (head)->next; pos != (head); pos = pos->next) + +#define input_list_for_each_safe(pos, n, head) \ + for (pos = (head)->next, n = pos->next; pos != (head); \ + pos = n, n = pos->next) + +void InputUtilListAdd(struct InputUtilList *node_new, struct InputUtilList *node_head); +void InputUtilListDelete(struct InputUtilList *node); +int InputUtilMCSend(HANDLE h_message, PCSTR source, UI_32 cmd, UI_32 length, PCVOID data); +int InputUtilSleep(int usec); + +#endif // INC_INPUT_UTIL_H_ |