i2c_application_system.h
Go to the documentation of this file.
1 // Copyright (c) Acconeer AB, 2023
2 // All rights reserved
3
4 #ifndef I2C_APPLICATION_SYSTEM_H_
5 #define I2C_APPLICATION_SYSTEM_H_
6
7 #include <stdbool.h>
8 #include <stdint.h>
9
10
11 /**
12 * @brief Init the system
13 *
14 * This function is called by the i2c application
15 * during initialization.
16 */
17 void i2c_application_system_init(void);
18
19
20 /**
21 * @brief Reset the system
22 *
23 * This function is called by the i2c application when
24 * the system should be restarted.
25 */
26 void i2c_application_system_reset(void);
27
28
29 /**
30 * @brief Wait for interrupt to occur
31 */
32 void i2c_application_system_wait_for_interrupt(void);
33
34
35 /**
36 * @brief Check if wakeup pin is high
37 *
38 * This function is used to test if the system should power down
39 *
40 * @return true if wakeup pin is high
41 */
42 bool i2c_application_system_test_wakeup_pin(void);
43
44
45 /**
46 * @brief Set the ready pin state
47 *
48 * This function is used to set the state of the ready pin
49 *
50 * @param[in] enable pin is set to high level when enable is true
51 */
52 void i2c_application_system_set_ready_pin(bool enable);
53
54
55 /**
56 * @brief Setup the generic gpio pin
57 *
58 * This function is used to setup the generic gpio pin
59 *
60 * @param[in] enable pin is set to output driver when enable is true
61 */
62 void i2c_application_system_setup_generic_gpio_pin(bool enable);
63
64
65 /**
66 * @brief Set the generic gpio pin output state
67 *
68 * This function is used to set the output state of the generic gpio pin
69 *
70 * @param[in] enable pin output is set to high level when enable is true
71 */
72 void i2c_application_system_set_generic_gpio_pin(bool enable);
73
74
75 /**
76 * @brief Make the MCU enter its low power state
77 *
78 * This function is called by the i2c application when
79 * the MCU should power down.
80 */
81 void i2c_application_enter_low_power_state(void);
82
83
84 /**
85 * @brief Set up a periodic timer used to wake up the system from sleep
86 *
87 * If the time_msec is set to zero the periodic wakeup will be disabled.
88 *
89 * @param period_ms Period time in milliseconds
90 */
91 void i2c_application_set_periodic_wakeup(uint32_t period_ms);
92
93
94 /**
95 * @brief Test if a periodic wake up has occurred
96 *
97 * @return true if a periodic wake up has occurred
98 */
99 bool i2c_application_is_periodic_wakeup(void);
100
101
102 #endif
i2c_application_system_set_generic_gpio_pin
void i2c_application_system_set_generic_gpio_pin(bool enable)
Set the generic gpio pin output state.
Definition: i2c_application_system_stm32.c:184
i2c_application_system_reset
void i2c_application_system_reset(void)
Reset the system.
Definition: i2c_application_system_stm32.c:129
i2c_application_system_wait_for_interrupt
void i2c_application_system_wait_for_interrupt(void)
Wait for interrupt to occur.
Definition: i2c_application_system_stm32.c:141
i2c_application_enter_low_power_state
void i2c_application_enter_low_power_state(void)
Make the MCU enter its low power state.
Definition: i2c_application_system_stm32.c:192
i2c_application_system_setup_generic_gpio_pin
void i2c_application_system_setup_generic_gpio_pin(bool enable)
Setup the generic gpio pin.
Definition: i2c_application_system_stm32.c:163
i2c_application_system_set_ready_pin
void i2c_application_system_set_ready_pin(bool enable)
Set the ready pin state.
Definition: i2c_application_system_stm32.c:155
i2c_application_set_periodic_wakeup
void i2c_application_set_periodic_wakeup(uint32_t period_ms)
Set up a periodic timer used to wake up the system from sleep.
Definition: i2c_application_system_stm32.c:216
i2c_application_system_init
void i2c_application_system_init(void)
Init the system.
Definition: i2c_application_system_stm32.c:110
i2c_application_is_periodic_wakeup
bool i2c_application_is_periodic_wakeup(void)
Test if a periodic wake up has occurred.
Definition: i2c_application_system_stm32.c:223
i2c_application_system_test_wakeup_pin
bool i2c_application_system_test_wakeup_pin(void)
Check if wakeup pin is high.
Definition: i2c_application_system_stm32.c:147