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

ZProbeProgrammer.h « src - github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 02e37973d1654b5a4c0a92bb4455eda03302f3b6 (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
/*
 * ZProbeProgrammer.h
 *
 *  Created on: 22 Jul 2017
 *      Author: David
 */

#ifndef SRC_ZPROBEPROGRAMMER_H_
#define SRC_ZPROBEPROGRAMMER_H_

#include "SoftTimer.h"

class ZProbeProgrammer
{
public:
	ZProbeProgrammer();

	void SendProgram(const uint32_t zProbeProgram[], size_t len);

private:
	static bool TimerInterrupt(void *param, uint32_t& when);
	bool Interrupt(uint32_t& when);

	SoftTimer timer;
	uint8_t progBytes[MaxZProbeProgramBytes];
	size_t numBytes;
	size_t bytesSent;
	unsigned int bitsSent;
	SoftTimer::Ticks bitTime;
	SoftTimer::Ticks startTime;

	static const unsigned int bitsPerSecond = 1000;
};

#endif /* SRC_ZPROBEPROGRAMMER_H_ */