#ifndef DCCD_APP_H_
#define DCCD_APP_H_

/**** Includes ****/
#include <stdint.h>
#include "dccd_hw.h"
#include "user_force.h"
#include "mode.h"
#include "handbrake.h"
#include "brakes.h"
#include "coil_reg.h"
#include "display.h"
#include "tps.h"

namespace dccd {

/**** Public definitions ****/
class DccdApp
{
	public:
	DccdApp(void);
	~DccdApp(void);
	
	void init(DccdHw* dccd_hw);
	void process(void);

	UserForce user_force;
	ModeBtn mode_btn;
	Handbrake hbrake;
	Brakes brakes;
	CoilReg coil_reg;
	DccdDisplay dsp;
	Thtrottle tps;
	
	int8_t hbrake_force;
	int8_t brakes_open_force;
	int8_t brakes_lock_force;
	uint8_t tps_enabled;
	int8_t tps_lock_force;
	
	#ifdef TESTING
	protected:
	#endif
	DccdHw* hardware;
	
	int8_t calc_next_force(void);
	void dsp_logic(void);
};

/**** Public function declarations ****/

#ifdef TESTING
#endif

} //namespace

#endif /* DCCD_APP_H_ */