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 * @brief Init the system
12 *
13 * This function is called by the i2c application
14 * during initialization.
15 */
16 void i2c_application_system_init(void);
17
18 /**
19 * @brief Reset the system
20 *
21 * This function is called by the i2c application when
22 * the system should be restarted.
23 */
24 void i2c_application_system_reset(void);
25
26 /**
27 * @brief Wait for interrupt to occur
28 */
29 void i2c_application_system_wait_for_interrupt(void);
30
31 /**
32 * @brief Check if wakeup pin is high
33 *
34 * This function is used to test if the system should power down
35 *
36 * @return true if wakeup pin is high
37 */
38 bool i2c_application_system_test_wakeup_pin(void);
39
40 /**
41 * @brief Set the ready pin state
42 *
43 * This function is used to set the state of the ready pin
44 *
45 * @param[in] enable pin is set to high level when enable is true
46 */
47 void i2c_application_system_set_ready_pin(bool enable);
48
49 /**
50 * @brief Setup the generic gpio pin
51 *
52 * This function is used to setup the generic gpio pin
53 *
54 * @param[in] enable pin is set to output driver when enable is true
55 */
56 void i2c_application_system_setup_generic_gpio_pin(bool enable);
57
58 /**
59 * @brief Set the generic gpio pin output state
60 *
61 * This function is used to set the output state of the generic gpio pin
62 *
63 * @param[in] enable pin output is set to high level when enable is true
64 */
65 void i2c_application_system_set_generic_gpio_pin(bool enable);
66
67 /**
68 * @brief Make the MCU enter its low power state
69 *
70 * This function is called by the i2c application when
71 * the MCU should power down.
72 */
73 void i2c_application_enter_low_power_state(void);
74
75 /**
76 * @brief Set up a periodic timer used to wake up the system from sleep
77 *
78 * If the time_msec is set to zero the periodic wakeup will be disabled.
79 *
80 * @param period_ms Period time in milliseconds
81 */
82 void i2c_application_set_periodic_wakeup(uint32_t period_ms);
83
84 /**
85 * @brief Test if a periodic wake up has occurred
86 *
87 * @return true if a periodic wake up has occurred
88 */
89 bool i2c_application_is_periodic_wakeup(void);
90
91 #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:208
i2c_application_system_reset
void i2c_application_system_reset(void)
Reset the system.
Definition: i2c_application_system_stm32.c:158
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:169
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:215
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:188
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:181
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:238
i2c_application_system_init
void i2c_application_system_init(void)
Init the system.
Definition: i2c_application_system_stm32.c:130
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:244
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:174