1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef _CLI_PLATFORM_H_
9 #define _CLI_PLATFORM_H_
10 
11 #include <stdbool.h>
12 #include <stdint.h>
13 
14 /*
15  * cli_timestamp_t
16  *   Description
17  *     Stores timestamp information in human-readable format.
18  *   Members
19  *     uint32_t days
20  *       Number of days elapsed since restart.
21  *     uint8_t hours
22  *       Hours portion of time since restart.
23  *     uint8_t minutes
24  *       Minutes portion of time since restart.
25  *     uint8_t seconds
26  *       Seconds portion of time since restart.
27  *     uint8_t fraction
28  *       Value from 0-99 containing hundredths of seconds.
29  */
30 typedef struct {
31     uint32_t days;
32     uint8_t hours;
33     uint8_t minutes;
34     uint8_t seconds;
35     uint8_t fraction;
36 } cli_timestamp_t;
37 
38 /*****************************************************************************/
39 /* CLI Platform-Specific Function Prototypes                                 */
40 /*****************************************************************************/
41 
42 /*
43  * cli_platform_get_time
44  *   Description
45  *     Fills out a cli_timestamp_t structure, this can be real time or time
46  *     since system startup.
47  *   Parameters
48  *     cli_timestamp_t *t
49  *       Pointer to structure to fill out.
50  */
51 void cli_platform_get_time(cli_timestamp_t *t);
52 
53 /*
54  * cli_platform_delay_ms
55  *   Descriptions
56  *     Delays execution for a number of milliseconds.
57  *   Parameters
58  *     uint32_t ms
59  *       Number of milliseconds to delay.
60  */
61 void cli_platform_delay_ms(uint32_t ms);
62 
63 /*****************************************************************************/
64 /* CLI Platform-Specific UART Functions                                      */
65 /*****************************************************************************/
66 
67 /*
68  * cli_platform_uid_notify
69  *   Description
70  *     If system has a UID light, this function notifies it of activity on
71  *     the console.
72  *   Return
73  *     cli_ret_et: success if it works, something else if it fails.
74  */
75 uint32_t cli_platform_uid_notify(void);
76 
77 #endif /* _CLI_PLATFORM_H_ */
78