diff options
author | ConfuSomu | 2021-02-20 12:55:39 -0500 |
---|---|---|
committer | ConfuSomu | 2021-02-20 12:55:39 -0500 |
commit | 8ad7e71440e603e94e972c099769ef2fc5e470e1 (patch) | |
tree | 4042a8583cd881ae760f542394bb87d39b0e05dd /init.hpp | |
parent | f2d591ce164086cdb0e57a49e867058e59457795 (diff) | |
download | pico-watch-8ad7e71440e603e94e972c099769ef2fc5e470e1.tar pico-watch-8ad7e71440e603e94e972c099769ef2fc5e470e1.tar.gz pico-watch-8ad7e71440e603e94e972c099769ef2fc5e470e1.zip |
Adopt C++
A large number of changes had to be made to use C++. "extern C" had to
be added for a few headers not adapted to C++. See
https://github.com/raspberrypi/pico-sdk/pull/106 for fix in affected
files. They will be removed when the pull request is merged in
pico-sdk's master branch.
Diffstat (limited to 'init.hpp')
-rw-r--r-- | init.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/init.hpp b/init.hpp new file mode 100644 index 0000000..f63187f --- /dev/null +++ b/init.hpp @@ -0,0 +1,31 @@ +#ifndef __INIT_H__ +#define __INIT_H__ + +// To modify the I2C port used, change the `#define I2C_PORT` in "oled/BitBang_I2C.c" +// Pin numbers are GPIO pins. +#define SDA_PIN 6 +#define SCL_PIN 7 +#define RESET_PIN -1 +#define OLED_DEFAULT_CONTRAST 40 +extern SSOLED oled; + +// Initial date & time +// The idea is to have the compiler set the date at compile-time. +// DOTW: 0 is Sunday +#define INIT_DATETIME_YEAR 2020 +#define INIT_DATETIME_MONTH 06 +#define INIT_DATETIME_DAY 05 +#define INIT_DATETIME_DOTW 5 +#define INIT_DATETIME_HOUR 15 +#define INIT_DATETIME_MIN 45 +#define INIT_DATETIME_SEC 00 + + +// Init every componement +void init_all(); +// Init OLED display +void init_display(); +// Init onboard RTC +void init_rtc(); + +#endif
\ No newline at end of file |