Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DueXn.h « DuetNG « src - github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e943b11648c4f33c32a627bad6e090529a552898 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * DueXn.h
 *
 *  Created on: 19 Oct 2016
 *      Author: David
 */

#ifndef SRC_DUETNG_DUEXN_H_
#define SRC_DUETNG_DUEXN_H_

#include "ecv.h"
#include "Core.h"

enum class ExpansionBoardType : uint8_t
{
	none,
	DueX0,
	DueX2,
	DueX5
};

namespace DuetExpansion
{
	ExpansionBoardType Init();						// Initialise the device and identify which expansion board is attached
	const char* array null GetExpansionBoardName();	// Return the name of the expansion board, or nullptr if no expansion board
	void SetPinMode(Pin pin, PinMode mode);			// Set the I/O mode of a pin
	bool DigitalRead(Pin pin);						// Read a pin
	void DigitalWrite(Pin pin, bool high);			// Write a pin
	void AnalogOut(Pin pin, float pwm);				// Set the PWM value on this pin
	uint16_t DiagnosticRead();						// Diagnose the SX1509 by setting all pins as inputs and reading them
};

#endif /* SRC_DUETNG_DUEXN_H_ */