MySensors Library & Examples
2.3.2-62-ge298769
hal
architecture
STM32F1
MyHwSTM32F1.h
1
/*
2
* The MySensors Arduino library handles the wireless radio link and protocol
3
* between your home built sensors/actuators and HA controller of choice.
4
* The sensors forms a self healing radio network with optional repeaters. Each
5
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
6
* network topology allowing messages to be routed to nodes.
7
*
8
* Created by Henrik Ekblad <
[email protected]
>
9
* Copyright (C) 2013-2022 Sensnology AB
10
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
11
*
12
* Documentation: http://www.mysensors.org
13
* Support Forum: http://forum.mysensors.org
14
*
15
* This program is free software; you can redistribute it and/or
16
* modify it under the terms of the GNU General Public License
17
* version 2 as published by the Free Software Foundation.
18
*/
19
20
#ifndef MyHwSTM32F1_h
21
#define MyHwSTM32F1_h
22
23
#include <libmaple/iwdg.h>
24
#include <itoa.h>
25
#include <EEPROM.h>
26
#include <SPI.h>
27
28
#ifdef __cplusplus
29
#include <Arduino.h>
30
#endif
31
32
#define CRYPTO_LITTLE_ENDIAN
33
34
#ifndef MY_SERIALDEVICE
35
#define MY_SERIALDEVICE Serial
36
#endif
37
38
#ifndef MY_DEBUGDEVICE
39
#define MY_DEBUGDEVICE MY_SERIALDEVICE
40
#endif
41
42
#ifndef MY_STM32F1_TEMPERATURE_OFFSET
43
#define MY_STM32F1_TEMPERATURE_OFFSET (0.0f)
44
#endif
45
46
#ifndef MY_STM32F1_TEMPERATURE_GAIN
47
#define MY_STM32F1_TEMPERATURE_GAIN (1.0f)
48
#endif
49
50
// SS default
51
#ifndef SS
52
#define SS PA4
53
#endif
54
55
// mapping
56
#define vsnprintf_P vsnprintf
57
//#define strncpy_P strncpy
58
#define printf_P printf
59
#define yield() // not defined
60
61
#ifndef digitalPinToInterrupt
62
#define digitalPinToInterrupt(__pin) (__pin)
63
#endif
64
65
#define hwDigitalWrite(__pin, __value) digitalWrite(__pin, __value)
66
#define hwDigitalRead(__pin) digitalRead(__pin)
67
#define hwPinMode(__pin, __value) pinMode(__pin, __value)
68
#define hwWatchdogReset() iwdg_feed()
69
#define hwReboot() nvic_sys_reset()
70
#define hwMillis() millis()
71
#define hwGetSleepRemaining() (0ul)
72
73
extern
void
serialEventRun(
void
)
__attribute__
((weak));
74
bool
hwInit(
void
);
75
void
hwRandomNumberInit(
void
);
76
void
hwReadConfigBlock(
void
*buf,
void
*addr,
size_t
length);
77
void
hwWriteConfigBlock(
void
*buf,
void
*addr,
size_t
length);
78
void
hwWriteConfig(
const
int
addr, uint8_t value);
79
uint8_t hwReadConfig(
const
int
addr);
80
81
// SOFTSPI
82
#ifdef MY_SOFTSPI
83
#error Soft SPI is not available on this architecture!
84
#endif
85
#define hwSPI SPI
86
87
88
#ifndef DOXYGEN
89
#define MY_CRITICAL_SECTION
90
#endif
/* DOXYGEN */
91
92
#endif
__attribute__
struct @4::@5 __attribute__
Doxygen will complain without this comment.
Definition:
DigitalPin.h:65
Copyright (C) 2013-2019 Sensnology AB. Generated by
doxygen
1.8.17