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: 4965d7f660bca8fdedd3e927f836ea8c12a925ac (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
34
35
36
37
38
39
/*
 * DueXn.h
 *
 *  Created on: 19 Oct 2016
 *      Author: David
 */

#ifndef SRC_DUETNG_DUEXN_H_
#define SRC_DUETNG_DUEXN_H_

#include <RepRapFirmware.h>

enum class ExpansionBoardType : uint8_t
{
	none,
	DueX0,
	DueX2,
	DueX2_v0_11 = DueX2 + 1,
	DueX5,
	DueX5_v0_11 = DueX5 + 1
};

namespace DuetExpansion
{
	ExpansionBoardType DueXnInit() noexcept;								// Look for a DueXn, initialise it and return which expansion board is attached
	void Exit();															// Stop the expander polling task
	void AdditionalOutputInit() noexcept;									// Look for an additional output pin expander
	void DueXnTaskInit() noexcept;											// Create the DueXn task and enable the associated interrupt from the DueXn
	const char* _ecv_array null GetExpansionBoardName() noexcept;			// Return the name of the expansion board, or nullptr if no expansion board
	const char* _ecv_array null GetAdditionalExpansionBoardName() noexcept;	// Return the name of the additional expansion board, or nullptr if no expansion board
	void SetPinMode(Pin pin, PinMode mode) noexcept;						// Set the I/O mode of a pin
	bool DigitalRead(Pin pin) noexcept;										// Read a pin
	void DigitalWrite(Pin pin, bool high) noexcept;							// Write a pin
	void AnalogOut(Pin pin, float pwm) noexcept;							// Set the PWM value on this pin
	uint16_t DiagnosticRead() noexcept;										// Diagnose the SX1509 by setting all pins as inputs and reading them
	void Diagnostics(MessageType mtype) noexcept;							// Print diagnostic data
}

#endif /* SRC_DUETNG_DUEXN_H_ */