i2c_application_system.h File Reference
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Functions

void i2c_application_system_init (void)
 Init the system. More...
 
void i2c_application_system_reset (void)
 Reset the system. More...
 
void i2c_application_system_wait_for_interrupt (void)
 Wait for interrupt to occur. More...
 
bool i2c_application_system_test_wakeup_pin (void)
 Check if wakeup pin is high. More...
 
void i2c_application_system_set_ready_pin (bool enable)
 Set the ready pin state. More...
 
void i2c_application_system_setup_generic_gpio_pin (bool enable)
 Setup the generic gpio pin. More...
 
void i2c_application_system_set_generic_gpio_pin (bool enable)
 Set the generic gpio pin output state. More...
 
void i2c_application_enter_low_power_state (void)
 Make the MCU enter its low power state. More...
 
void i2c_application_set_periodic_wakeup (uint32_t period_ms)
 Set up a periodic timer used to wake up the system from sleep. More...
 
bool i2c_application_is_periodic_wakeup (void)
 Test if a periodic wake up has occurred. More...
 

Function Documentation

◆ i2c_application_enter_low_power_state()

void i2c_application_enter_low_power_state ( void  )

Make the MCU enter its low power state.

This function is called by the i2c application when the MCU should power down.

Wait for the i2c interface to be idle, if not idle after retries, power down anyway!

Definition at line 192 of file i2c_application_system_stm32.c.

◆ i2c_application_is_periodic_wakeup()

bool i2c_application_is_periodic_wakeup ( void  )

Test if a periodic wake up has occurred.

Returns
true if a periodic wake up has occurred

Definition at line 223 of file i2c_application_system_stm32.c.

◆ 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.

If the time_msec is set to zero the periodic wakeup will be disabled.

Parameters
period_msPeriod time in milliseconds

Definition at line 216 of file i2c_application_system_stm32.c.

◆ i2c_application_system_init()

void i2c_application_system_init ( void  )

Init the system.

This function is called by the i2c application during initialization.

Calling this function with wrong parameters will return HAL_ERROR Calling this function when the i2c module is in the wrong state return HAL_BUSY

Definition at line 110 of file i2c_application_system_stm32.c.

◆ i2c_application_system_reset()

void i2c_application_system_reset ( void  )

Reset the system.

This function is called by the i2c application when the system should be restarted.

Wait for the i2c interface to be idle, if not idle after retries, reset anyway!

Definition at line 129 of file i2c_application_system_stm32.c.

◆ i2c_application_system_set_generic_gpio_pin()

void i2c_application_system_set_generic_gpio_pin ( bool  enable)

Set the generic gpio pin output state.

This function is used to set the output state of the generic gpio pin

Parameters
[in]enablepin output is set to high level when enable is true

Definition at line 184 of file i2c_application_system_stm32.c.

◆ i2c_application_system_set_ready_pin()

void i2c_application_system_set_ready_pin ( bool  enable)

Set the ready pin state.

This function is used to set the state of the ready pin

Parameters
[in]enablepin is set to high level when enable is true

Definition at line 155 of file i2c_application_system_stm32.c.

◆ i2c_application_system_setup_generic_gpio_pin()

void i2c_application_system_setup_generic_gpio_pin ( bool  enable)

Setup the generic gpio pin.

This function is used to setup the generic gpio pin

Parameters
[in]enablepin is set to output driver when enable is true

Definition at line 163 of file i2c_application_system_stm32.c.

◆ i2c_application_system_test_wakeup_pin()

bool i2c_application_system_test_wakeup_pin ( void  )

Check if wakeup pin is high.

This function is used to test if the system should power down

Returns
true if wakeup pin is high

Definition at line 147 of file i2c_application_system_stm32.c.

◆ i2c_application_system_wait_for_interrupt()

void i2c_application_system_wait_for_interrupt ( void  )

Wait for interrupt to occur.

Definition at line 141 of file i2c_application_system_stm32.c.