/*
 * platform.c
 *
 *  Created on: 29.09.2022
 *      Author: jonas
 */

#include "platform.h"
#include "McuLib.h"
#include "McuWait.h"
#include "McuLED.h"
#include "McuGPIO.h"
#include "McuRTOS.h"
#include "McuRTT.h"
#include "McuShell.h"
#include "shell.h"
#include "McuShellUart.h"
#include "McuLog.h"
#include "debounce.h"
#include "buttons.h"

void PL_Init(void){

	/* Enable clock for used PORTS */
    CLOCK_EnableClock(kCLOCK_PortA);
    CLOCK_EnableClock(kCLOCK_PortB);
    CLOCK_EnableClock(kCLOCK_PortC);

	McuLib_Init();
	McuRTOS_Init();
	McuWait_Init();
	McuGPIO_Init();
	McuLED_Init();
	McuRTOS_Init();
	BTN_Init();
	Debounce_Init();
	McuRTT_Init();
	McuShell_Init();
	McuShellUart_Init();
	McuLog_Init();
	McuLog_set_console(McuRTT_GetStdio(), 0);
	SHELL_Init();
}


void PL_Deinit(void){
	SHELL_Deinit();
	McuLog_Deinit();
	McuShellUart_Deinit();
	McuShell_Deinit();
	McuRTT_Deinit();
	Debounce_Deinit();
	BTN_Deinit();
	McuRTOS_Deinit();
	McuLED_Deinit();
	McuGPIO_Deinit();
	McuWait_Deinit();
	McuRTOS_Deinit();
	McuLib_Deinit();
}
