Files
BionxControl/bcdrivertinycan.h

64 lines
1.7 KiB
C
Raw Normal View History

2025-12-26 14:07:55 +01:00
/***************************************************************************
BionxControl
2026-01-03 23:51:14 +01:00
© 2025 -2026 christoph holzheuer
2025-12-26 14:07:55 +01:00
christoph.holzheuer@gmail.com
Using:
mhs_can_drv.c
© 2011 - 2023 by MHS-Elektronik GmbH & Co. KG, Germany
Klaus Demlehner, klaus@mhs-elektronik.de
@see www.mhs-elektronik.de
Based on Bionx data type descriptions from:
BigXionFlasher USB V 0.2.4 rev. 97
© 2011-2013 by Thomas Koenig <info@bigxionflasher.org>
@see www.bigxionflasher.org
Bionx Bike Info
© 2018 Thorsten Schmidt (tschmidt@ts-soft.de)
@see www.ts-soft.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@see https://github.com/bikemike/bionx-bikeinfo
***************************************************************************/
2025-12-30 10:12:01 +01:00
#ifndef BCDRIVERTINYCAN_H
#define BCDRIVERTINYCAN_H
2025-12-20 16:33:00 +01:00
2025-12-30 10:12:01 +01:00
#include <bcdriver.h>
2025-12-20 16:33:00 +01:00
2025-12-30 10:12:01 +01:00
class BCDriverTinyCan : public BCDriver
2025-12-20 16:33:00 +01:00
{
public:
2026-01-03 20:10:30 +01:00
virtual ~BCDriverTinyCan();
2025-12-20 16:33:00 +01:00
2026-01-03 20:10:30 +01:00
BCDriver::DriverStateResult loadAndStartDriver() override;
2026-01-03 23:51:14 +01:00
void resetDriver();
2025-12-20 16:33:00 +01:00
2026-01-03 20:10:30 +01:00
TransmitResult readRawByte ( uint32_t deviceID, uint8_t registerID ) const override;
TransmitResult writeRawByte( uint32_t deviceID, uint8_t registerID, uint8_t value ) const override;
2026-01-01 00:40:27 +01:00
2026-01-03 20:10:30 +01:00
private:
2025-12-20 16:33:00 +01:00
2026-01-03 20:10:30 +01:00
BCDriver::DriverStateResult loadDriver();
BCDriver::DriverStateResult setConsoleSlaveMode();
2026-01-03 23:51:14 +01:00
2025-12-30 14:42:49 +01:00
static constexpr int cRetries = 5;
static constexpr int cTimeOuts = 20;
2026-01-01 00:40:27 +01:00
static constexpr int cTIMEOUT_MS = 10; // 10ms
static constexpr int cTIMEOUT_COUNT = 10;
2025-12-20 16:33:00 +01:00
};
2025-12-30 10:12:01 +01:00
#endif // BCDRIVERTINYCAN_H