cursada_mc2
Base de control de temperatura para EDU-CIAA-NXP
Loading...
Searching...
No Matches
app.c File Reference

Implementacion de la capa principal de aplicacion. More...

+ Include dependency graph for app.c:

Go to the source code of this file.

Macros

#define APP_CONTROL_GPIO_SCU_PORT   4U
 
#define APP_CONTROL_GPIO_SCU_PIN   0U
 
#define APP_CONTROL_GPIO_SCU_MODE   (MD_PUP)
 
#define APP_CONTROL_GPIO_SCU_FUNC   FUNC0
 
#define APP_CONTROL_GPIO_PORT   2U
 
#define APP_CONTROL_GPIO_PIN   0U
 
#define APP_LOOP_DELTA_MS   20U
 
#define APP_TIMER_TICK_MS   1U
 

Functions

static int16_t app_convertir_temperatura_raw_a_deci (int16_t temperatura_cruda)
 
static void app_salida_control_init (void)
 
static void app_salida_control_escribir (bool activa)
 
static void app_step_20ms (void)
 
void app_init (void)
 Inicializa los modulos de la aplicacion.
 
void app_process (void)
 Ejecuta una iteracion del lazo principal de la aplicacion.
 

Variables

static ds18b20_driver_t app_sensor_temperatura_
 
static bool app_sensor_inicializado_ = false
 
static uint16_t app_sensor_ticks_actualizacion_ = 0U
 
static uint16_t app_sensor_ticks_reintento_ = 0U
 
static const onewire_pin_config_t app_pin_ds18b20_
 
static uint32_t app_ultimo_tick_procesado_ms_ = 0U
 

Macro Definition Documentation

◆ APP_CONTROL_GPIO_PIN

#define APP_CONTROL_GPIO_PIN   0U

Definition at line 40 of file app.c.

◆ APP_CONTROL_GPIO_PORT

#define APP_CONTROL_GPIO_PORT   2U

Definition at line 39 of file app.c.

◆ APP_CONTROL_GPIO_SCU_FUNC

#define APP_CONTROL_GPIO_SCU_FUNC   FUNC0

Definition at line 38 of file app.c.

◆ APP_CONTROL_GPIO_SCU_MODE

#define APP_CONTROL_GPIO_SCU_MODE   (MD_PUP)

Definition at line 37 of file app.c.

◆ APP_CONTROL_GPIO_SCU_PIN

#define APP_CONTROL_GPIO_SCU_PIN   0U

Definition at line 36 of file app.c.

◆ APP_CONTROL_GPIO_SCU_PORT

#define APP_CONTROL_GPIO_SCU_PORT   4U

Definition at line 35 of file app.c.

◆ APP_LOOP_DELTA_MS

#define APP_LOOP_DELTA_MS   20U

Definition at line 42 of file app.c.

◆ APP_TIMER_TICK_MS

#define APP_TIMER_TICK_MS   1U

Definition at line 43 of file app.c.

Function Documentation

◆ app_convertir_temperatura_raw_a_deci()

static int16_t app_convertir_temperatura_raw_a_deci ( int16_t  temperatura_cruda)
static

Definition at line 47 of file app.c.

Referenced by app_step_20ms().

◆ app_init()

◆ app_process()

void app_process ( void  )

Debe llamarse de forma periodica desde el while(1) principal.

Definition at line 183 of file app.c.

References APP_LOOP_DELTA_MS, app_step_20ms(), app_ultimo_tick_procesado_ms_, and board_timer_get_ticks().

Referenced by main().

◆ app_salida_control_escribir()

static void app_salida_control_escribir ( bool  activa)
static

Definition at line 70 of file app.c.

References APP_CONTROL_GPIO_PIN, APP_CONTROL_GPIO_PORT, LED1, led_turn_off(), and led_turn_on().

Referenced by app_step_20ms().

◆ app_salida_control_init()

static void app_salida_control_init ( void  )
static

◆ app_step_20ms()

Variable Documentation

◆ app_pin_ds18b20_

const onewire_pin_config_t app_pin_ds18b20_
static
Initial value:
= {
.scu_port = 6U,
.scu_pin = 1U,
.scu_mode = (uint16_t) (MD_PUP | MD_EZI | MD_ZI),
.scu_func = FUNC0,
.gpio_port = 3U,
.gpio_pin = 0U,
}

Definition at line 25 of file app.c.

Referenced by app_init(), and app_step_20ms().

◆ app_sensor_inicializado_

bool app_sensor_inicializado_ = false
static

Definition at line 21 of file app.c.

Referenced by app_init(), and app_step_20ms().

◆ app_sensor_temperatura_

ds18b20_driver_t app_sensor_temperatura_
static

Definition at line 20 of file app.c.

Referenced by app_init(), and app_step_20ms().

◆ app_sensor_ticks_actualizacion_

uint16_t app_sensor_ticks_actualizacion_ = 0U
static

Definition at line 22 of file app.c.

Referenced by app_step_20ms().

◆ app_sensor_ticks_reintento_

uint16_t app_sensor_ticks_reintento_ = 0U
static

Definition at line 23 of file app.c.

Referenced by app_init(), and app_step_20ms().

◆ app_ultimo_tick_procesado_ms_

uint32_t app_ultimo_tick_procesado_ms_ = 0U
static

Definition at line 45 of file app.c.

Referenced by app_init(), and app_process().