/**
 * @file ft_sender.h
 *
 * @brief This file contains function prototypes of shutdown function
 *
 * @copyright Copyright 2023 Antaris, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

#ifndef _OTSU_INC_OTSU_SHUTDOWN_H_
#define _OTSU_INC_OTSU_SHUTDOWN_H_


#include "stdint.h"
#include "exo_osal.h"
#include "exo_io_al_sos_timer.h"
#include "otsu_tctm_msg_def.h"


/******************************************************************************/
/*         Definition of exported types (typedef, enum, struct, union)        */
/******************************************************************************/


typedef uint16_t (*shut_notify_api)(uint16_t shutdown_timeout);




#if 0
/*!
 * @brief This API used to register APP for getting notification when shutdown has initiated
 *
 */
uint8_t otsu_register_shutdwn_notify(uint16_t app_id, shut_notify_api app_notify_api);
/* internal FT functions */
uint8_t otsu_publish_shutdwn_msg_to_apps(uint16_t shtdwn_timeout);
void otsu_init_obc_shutdwn_notify(void);
#endif


/******************************************************************************/
/*               Declaration of global function prototypes                    */
/******************************************************************************/

/**
* @brief This is the callback function which will be invoked by shutdown timer
*
* @param[in]  time : time to set
*
* @return none
* @retval void : none
*/
void shtdwn_timeout_expired_cb(void *args);



/**
* @brief This function used to set shutdown time
*
* @param[in]  time : time to set
*
* @return none
* @retval void : none
*/
void shtdwn_time_config(uint16_t time);
//timer trigger for next event

/**
* @brief This function used to start the os timer
*
* @param[in]  time : time to set
*
* @return none
* @retval void : none
*/
void shtdwn_timer_trig(void);  //timer in seconds

/**
* @brief This function used to initialise the os timer
*
* @param[in]  time : time to set
*
* @return none
* @retval void : none
*/
void shtdwn_timer_init();

/**
* @brief This function used to de initialise the os timer
*
* @param[in]  time : time to set
*
* @return none
* @retval void : none
*/
void shtdwn_timer_deinit();


/**
* @brief This is the callback function which will be invoked by RTC timer for scheduled boot purpose
* (this callback is only for testing purpose)
*
* @param[in]  time : time to set
*
* @return none
* @retval void : none
*/
void shtdwn_rtc_time_expired_cb(void);


#endif /* _OTSU_INC_OTSU_SHUTDOWN_H_ */
