/***************************************************************************/
/*                             Druckersoftware                             */
/*                    Copyright (C) Carl Valentin GmbH                     */
/***************************************************************************/

/*
 * KM_DmaChan_ControlModulAccess.h
 *
 *  Created on: May 31, 2016
 *      Author: preitinger
 */

#ifndef KM_DMACHAN_CONTROLMODULACCESS_H_
#define KM_DMACHAN_CONTROLMODULACCESS_H_

/*. IMPORT ================================================================*/
#include "KM_DmaChan_MappedIo.h"
/*. ENDIMPORT =============================================================*/

/*. EXPORT ================================================================*/

/*-------------------------------- Makros ---------------------------------*/

/*--------------------------- Typdeklarationen ----------------------------*/

typedef struct SDmaChan_ControlModulAccess {
	// private:
	DmaChan_MappedIo _mappedIo;
} DmaChan_ControlModulAccess;

/*------------------------------ Prototypen -------------------------------*/

int
DmaChan_ControlModulAccess_create(DmaChan_ControlModulAccess* this);

void
DmaChan_ControlModulAccess_delete(DmaChan_ControlModulAccess* this);

void
DmaChan_ControlModulAccess_setCrossbarMapping(DmaChan_ControlModulAccess* this, int channel, int crossbarEvt);

/**
 * \param off relativ zu 0x44e10000 | 0x800, also 0x44e10800, was erstes register fuer pinmux ist (siehe SPRUH...)
 * \param mode 0-7, der pinmux-mode (siehe Tabelle_fuer_pinmux_epc35.txt von Kurz
 * \param pullEnabled ueberhaupt pull (egal ob up oder down, das wird dann ggf. in upSelected spezifiziert
 * \param upSelected
 * \param receiverEnabled  true bedeutet (auch) input, false (nur) output
 */
void
DmaChan_ControlModulAccess_setPinMux(DmaChan_ControlModulAccess* this,
		int off, int mode, bool pullEnabled, bool upSelected, bool receiverEnabled);

/*------------------------ Konstantendeklarationen ------------------------*/

/*. ENDEXPORT =============================================================*/

#endif /* KM_DMACHAN_CONTROLMODULACCESS_H_ */
