-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from vladkorotnev/develop
PIS-OS 1.2 / microPIS-OS 1.0
- Loading branch information
Showing
76 changed files
with
1,736 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
captures/ | ||
.vscode/c_cpp_properties.json | ||
.env | ||
/src/weather_icons/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
#include <stdint.h> | ||
#include <strings.h> | ||
|
||
typedef uint32_t partition_handle_t; | ||
|
||
void unmount_partition(partition_handle_t); | ||
bool mount_settings(const void** out_ptr, partition_handle_t* out_handle, size_t* out_size); | ||
bool mount_crash(const void** out_ptr, partition_handle_t* out_handle, size_t* out_size); | ||
|
||
bool begin_settings_write(); | ||
void write_settings_chunk(const char *, size_t); | ||
void end_settings_write(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef FEATUREFLAG_H_ | ||
#define FEATUREFLAG_H_ | ||
|
||
#define HAS(x) defined(HAS_##x) | ||
|
||
// ---- SOFTWARE FEATURE FLAGS | ||
#define HAS_WORDNIK_API | ||
// #define HAS_OTAFVU | ||
//#define HAS_SWITCHBOT_METER_INTEGRATION // <- low on RAM with the board used in big-clock: wait until they disable HTTPS enforcement, or buy bigger ESP board | ||
|
||
// ---- HARDWARE | ||
|
||
#ifdef ESP32 | ||
#define HAS_BLUETOOTH_LE | ||
#endif | ||
|
||
#ifdef DEVICE_PLASMA_CLOCK | ||
#include <devices/big_clock.h> | ||
#endif | ||
|
||
#ifdef DEVICE_MICROPISOS | ||
#include <devices/smol_clock.h> | ||
#endif | ||
|
||
// ---- DEPENDENCY RULES | ||
#if !HAS(BLUETOOTH_LE) | ||
#if HAS(SWITCHBOT_METER_INTEGRATION) | ||
#undef HAS_SWITCHBOT_METER_INTEGRATION | ||
#endif | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include <hal/gpio_hal.h> | ||
|
||
#define HAS_OUTPUT_WS0010 | ||
#define HAS_TEMP_SENSOR | ||
|
||
// Plasma Information System OS (not DOS, there's no disk in it!) | ||
#define PRODUCT_NAME "microPIS-OS" | ||
#define PRODUCT_VERSION "1.0" | ||
|
||
// ---- Connection to beeper ---- | ||
const gpio_num_t HWCONF_BEEPER_GPIO = GPIO_NUM_12; | ||
const uint8_t HWCONF_BEEPER_PWM_CHANNEL = 0; | ||
|
||
// ---- Connection to temperature sensor ---- | ||
const gpio_num_t HWCONF_I2C_SDA_GPIO = GPIO_NUM_26; | ||
const gpio_num_t HWCONF_I2C_SCL_GPIO = GPIO_NUM_25; | ||
|
||
// ---- Connection to display ---- | ||
const gpio_num_t HWCONF_WS0010_DATABUS_GPIOS[] = { | ||
GPIO_NUM_5, | ||
GPIO_NUM_0, | ||
GPIO_NUM_23, | ||
GPIO_NUM_2, | ||
GPIO_NUM_22, | ||
GPIO_NUM_15, | ||
GPIO_NUM_4, | ||
GPIO_NUM_21 | ||
}; | ||
const gpio_num_t HWCONF_WS0010_RS_GPIO = GPIO_NUM_19; | ||
const gpio_num_t HWCONF_WS0010_EN_GPIO = GPIO_NUM_18; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
#include <graphics/display_driver.h> | ||
#include <device_config.h> | ||
|
||
#if HAS(OUTPUT_WS0010) | ||
// Winstar WS0010 compatible OLED display | ||
class Ws0010OledDriver: public DisplayDriver { | ||
public: | ||
/// @brief Initialize the interface. Configures the GPIO and prepares the outputs for use, also disables the output and high voltage supply. | ||
/// @note Connect the RWB pin to be LOW as we won't be reading from the display. | ||
/// @param databus 8 pins connected to the display controller's data bus, DB0 to DB7 | ||
/// @param rs Pin connected to the display controller's RS pin | ||
/// @param en Pin connected to the display controller's E pin | ||
Ws0010OledDriver( | ||
const gpio_num_t databus[8], | ||
const gpio_num_t rs, | ||
const gpio_num_t en | ||
); | ||
|
||
/// @brief Reset the display controller | ||
void reset(); | ||
void clear(); | ||
|
||
/// @brief Enable or disable the high voltage supply | ||
void set_power(bool on); | ||
/// @brief Show or hide the display contents, while keeping the scanning active | ||
void set_show(bool show); | ||
|
||
#if HAS(VARYING_BRIGHTNESS) | ||
#warning WS0010 does not support brightness controls | ||
void set_bright(bool bright) { } | ||
#endif | ||
|
||
/// @brief Send an array of half-columns to the display controller | ||
void write_fanta(const uint8_t * strides, size_t count); | ||
|
||
private: | ||
gpio_num_t databus_gpios[8]; | ||
gpio_num_t rs_gpio; | ||
gpio_num_t en_gpio; | ||
bool is_writing_ddram; | ||
uint8_t ddram_ptr; | ||
|
||
void initialize(); | ||
inline void set_databus(uint8_t data); | ||
inline void set_is_command(bool); | ||
inline void pulse_clock(); | ||
void write_string(const char *); | ||
void write_stride(uint8_t stride); | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
#pragma once | ||
#include <plasma/font.h> | ||
#include <graphics/font.h> | ||
|
||
extern const font_definition_t xnu_font; | ||
extern const font_definition_t keyrus0808_font; | ||
extern const font_definition_t keyrus0816_font; | ||
extern const font_definition_t sg8bit_font; | ||
extern const font_definition_t one_pixel_bar_font; | ||
extern const font_definition_t fps_counter_font; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
#include <device_config.h> | ||
|
||
class DisplayDriver { | ||
public: | ||
/// @brief Reset the display controller | ||
virtual void reset(); | ||
/// @brief Send an array of half-columns to the display controller | ||
virtual void write_fanta(const uint8_t * strides, size_t count); | ||
|
||
/// @brief Enable or disable the display power | ||
virtual void set_power(bool on); | ||
/// @brief Show or hide the display contents, while keeping the scanning active | ||
virtual void set_show(bool show); | ||
|
||
#if HAS(VARYING_BRIGHTNESS) | ||
/// @brief Select between half or full brightness | ||
virtual void set_bright(bool bright); | ||
#endif | ||
}; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.