Re-organized sub-directory by category
[staging/basesystem.git] / hal / soc_temperature_hal / hal_api / soc_temperature_hal.h
1 /*
2  * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file soc_temperature_hal.h
19  */
20
21 #ifndef HAL_API_SOC_TEMPERATURE_HAL_H_
22 #define HAL_API_SOC_TEMPERATURE_HAL_H_
23
24 #include <native_service/frameworkunified_types.h>
25
26 /** @addtogroup soc_temperature_hal
27  *  @{
28  */
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif  // __cplusplus
33
34 /**
35  * \ingroup GetSoCTemperature
36  * \~english @par Brief
37  *           Get SoC temperature value(unit:celsius).
38  * \~english @param [out] temperature
39  *      float*   -    degree celsius
40  * \~english @retval eFrameworkunifiedStatusOK  Success
41  * \~english @retval eFrameworkunifiedStatusNullPointer  NULL pointer specified
42  * \~english @retval eFrameworkunifiedStatusFail  Abnormal Error (system error)
43  * \~english @par Prerequisite
44  *        - The SoC has temperature sensor, and the thermal driver is available.
45  * \~english @par Change of internal state
46  *        - Change of internal state according to the API does not occur.
47  * \~english @par Conditions of processing failure
48  *        - Parameter temperature is NULL[eFrameworkunifiedStatusNullPointer]
49  *        - System error(open/read/close failed)[eFrameworkunifiedStatusFail]
50  * \~english @par Classification
51  *        Public
52  * \~english @par Type
53  *        Sync
54  * \~english @par Detail
55  *        - Get SoC temperature value.
56  *        - On success eFrameworkunifiedStatusOK is returned and the parameter temperature is set.
57  *        - Not eFrameworkunifiedStatusOK is returned if an error occurred.
58  *        - Return value shall be checked before temperature is refered.
59  *        - Sample code:
60  *            @code
61  *            #include <stdio.h>
62  *            #include <stdlib.h>
63  *            #include <soc_temperature_hal.h>
64  *            #include <native_service/frameworkunified_types.h>
65  *
66  *            int main(int argc, char *argv[]) {
67  *              float temperature = 0.0f;
68  *              EFrameworkunifiedStatus status = GetSoCTemperature(&temperature);
69  *              if (status != eFrameworkunifiedStatusOK) {
70  *                printf("Get SoC temperature failed\n");
71  *                exit(EXIT_FAILURE);
72  *              }
73  *              printf("SoC temperature: %f\n", temperature);
74  *              exit(EXIT_SUCCESS);
75  *            }
76  *            @endcode
77  * \~english @see
78  *        - None
79  */
80 EFrameworkunifiedStatus GetSoCTemperature(float* temperature);
81
82 #ifdef __cplusplus
83 }
84 #endif  // __cplusplus
85
86 /** @}*/  // end of soc_temperature_hal
87
88 #endif  // HAL_API_SOC_TEMPERATURE_HAL_H_
89