Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RV-8263-C8 driver #283

Merged
merged 6 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@ include_directories(src/applications)
include_directories(src/ui/watchfaces)

if (CONFIG_DT_HAS_NORDIC_NPM1300_ENABLED)
add_subdirectory(src/fuel_gauge)
add_subdirectory(src/fuel_gauge)
else()
add_subdirectory(src/basic_battery)
add_subdirectory(src/basic_battery)
endif()

target_sources(app PRIVATE src/main.c)
# TODO
target_sources(app PRIVATE src/zsw_clock.c)
#if (CONFIG_RTC)
# target_sources(app PRIVATE src/zsw_rtc.c)
#else()
#endif()

target_sources(app PRIVATE src/main.c)
target_sources(app PRIVATE src/zsw_cpu_freq.c)
target_sources(app PRIVATE src/zsw_retained_ram_storage.c)
target_sources(app PRIVATE src/zsw_coredump.c)
Expand Down
47 changes: 24 additions & 23 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,30 @@ menu "ZSWatch"
prompt "Activate the application 'PPT remote'"
default n

menu "Configuration"
menu "Compass"
depends on APPLICATIONS_USE_COMPASS

config APPLICATIONS_CONFIGURATION_COMPASS_REFRESH_INTERVAL_MS
int
prompt "Refresh interval in milliseconds"
default 50

config APPLICATIONS_CONFIGURATION_COMPASS_CALIBRATION_TIME_S
int
prompt "Calibration time in seconds"
default 30
endmenu

menu "Sensors Summary"
depends on APPLICATIONS_USE_SENSORS_SUMMARY

config APPLICATIONS_CONFIGURATION_SENSORS_SUMMARY_REFRESH_INTERVAL_MS
int
prompt "Refresh interval in milliseconds"
default 100
endmenu
endmenu
endmenu

menu "Watchface"
Expand Down Expand Up @@ -107,29 +131,6 @@ menu "ZSWatch"
default 85
endmenu

menu "Sensors Summary"
depends on APPLICATIONS_USE_SENSORS_SUMMARY

config DEFAULT_CONFIGURATION_SENSORS_SUMMARY_REFRESH_INTERVAL_MS
int
prompt "Refresh interval in milliseconds"
default 100
endmenu

menu "Compass"
depends on APPLICATIONS_USE_COMPASS

config DEFAULT_CONFIGURATION_COMPASS_REFRESH_INTERVAL_MS
int
prompt "Refresh interval in milliseconds"
default 50

config DEFAULT_CONFIGURATION_COMPASS_CALIBRATION_TIME_S
int
prompt "Calibration time in seconds"
default 30
endmenu

menu "Power Management"
config POWER_MANAGEMENT_IDLE_TIMEOUT_SECONDS
int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
};
};

&uart0 {
status = "disabled";
};

&i2c1 {
bmi270: bmi270@68 {
compatible = "bosch,bmi270-plus";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@

};

&uart0 {
status = "disabled";
};

&i2c1 {
bmi270: bmi270@68 {
compatible = "bosch,bmi270-plus";
Expand Down
5 changes: 3 additions & 2 deletions app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
CONFIG_ZSWATCH_PCB_REV=5
CONFIG_BT_DIS_HW_REV_STR="5"

#---------------
# FLASH
#-----------------
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_STREAM_FLASH=y
Expand Down Expand Up @@ -46,3 +44,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_NVS=y

CONFIG_DEBUG_COREDUMP_BACKEND_OTHER=y

CONFIG_RTC=y
CONFIG_RTC_UPDATE=y
61 changes: 43 additions & 18 deletions app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<NRF_PSEL(QSPI_IO3, 0, 16)>;
low-power-enable;
};

group2 {
psels = <NRF_PSEL(QSPI_CSN, 0, 18)>;
low-power-enable;
Expand Down Expand Up @@ -125,21 +126,25 @@

buttons: buttons {
compatible = "gpio-keys";

button1: button_1 {
label = "top-right";
gpios = <&gpio0 27 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_1>;
};

button2: button_2 {
label = "bottom-left";
gpios = <&gpio1 10 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_2>;
};

button3: button_3 {
label = "bottom-right";
gpios = <&gpio0 31 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_KP0>;
};

button4: button_4 {
label = "top-left";
gpios = <&gpio0 26 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
Expand Down Expand Up @@ -167,39 +172,54 @@

pwmleds {
compatible = "pwm-leds";

display_blk: pwm_led_0 {
pwms = <&pwm0 0 PWM_USEC(15) PWM_POLARITY_INVERTED>;
};

vibrator_pwm: pwm_led_1 {
pwms = <&pwm1 0 PWM_MSEC(20) 0>;
};

buzzer_pwm: pwm_led_2 {
pwms = <&pwm2 0 PWM_HZ(880) PWM_POLARITY_NORMAL>;
};
};
};

&uart0 {
status = "disabled";
};

&i2c1 {
bmi270: bmi270@68 {
compatible = "bosch,bmi270-plus";
reg = <0x68>;
status = "okay";
int-gpios = <&gpio1 4 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
// NOTE: The swap is performed AFTER the axis inversion. So we have to invert the y axis of the sensor
// to get the x axis of the watch coordinate system.
swap-xy;
invert-y;
};
rv_8263_c8: rv-8263-c8@51 {
compatible = "microcrystal,rv-8263-c8";
reg = <0x51>;
status = "okay";
clkout = <0>;
int-gpios = <&gpio1 13 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
};

bmi270: bmi270@68 {
compatible = "bosch,bmi270-plus";
reg = <0x68>;
status = "okay";
int-gpios = <&gpio1 4 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
// NOTE: The swap is performed AFTER the axis inversion. So we have to invert the y axis of the sensor
// to get the x axis of the watch coordinate system.
swap-xy;
invert-y;
};

apds9306: apds9306@52 {
compatible = "avago,apds9306";
reg = <0x52>;
status = "okay";
gain = <0>;
resolution = <0>;
frequency = <0>;
};

apds9306: apds9306@52 {
compatible = "avago,apds9306";
reg = <0x52>;
status = "okay";
gain = <0>;
resolution = <0>;
frequency = <0>;
};
npm1300_pmic: pmic@6b {
compatible = "nordic,npm1300";
reg = <0x6b>;
Expand Down Expand Up @@ -254,6 +274,7 @@
thermistor-beta = <3380>; // Not used
charging-enable;
};

npm1300_buttons: buttons {
compatible = "gpio-keys";
status = "disabled";
Expand Down Expand Up @@ -287,6 +308,7 @@
pinctrl-0 = <&qspi_default>;
pinctrl-1 = <&qspi_sleep>;
pinctrl-names = "default", "sleep";

mx25u51245g: mx25u51245g@0 {
compatible = "nordic,qspi-nor";
reg = <0>;
Expand All @@ -312,6 +334,7 @@
/ {
fstab {
compatible = "zephyr,fstab";

lvgl_lfs: lvgl_lfs {
compatible = "zephyr,fstab,littlefs";
mount-point = "/lvgl_lfs";
Expand Down Expand Up @@ -339,10 +362,12 @@
label = "littlefs_storage";
reg = <0x00000000 0x00200000>;
};

lvgl_raw_partition: partition@200000 {
label = "lvgl_raw_partition";
reg = <0x00200000 0x00200000>;
};

storage_partition: partition@400000 {
label = "storage_partition";
reg = <0x400000 0x100000 >;
Expand Down
94 changes: 47 additions & 47 deletions app/child_image/hci_ipc.conf
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
CONFIG_BT_EXT_ADV=y
CONFIG_BT_CTLR=y
CONFIG_BT_LL_SW_SPLIT=y
CONFIG_BT_CTLR_ADV_EXT=y
CONFIG_BT_CTLR_ADV_PERIODIC=y
CONFIG_BT_CTLR_DF=y
CONFIG_BT_CTLR_DF_SCAN_CTE_RX=n
CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=n
CONFIG_BT_CTLR_DF_CTE_RX=n
# Limit number of possible connection to decrease memory usage
CONFIG_BT_MAX_CONN=1
# Enable chaining of multiple CTEs in periodic advertising
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y
CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16
CONFIG_BT_CTLR_TX_PWR_0=y
CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191
# Enable chaining of multiple CTEs in periodic advertising
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y
CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16
CONFIG_BT_CTLR_DF_ANT_SWITCH_TX=n
CONFIG_BT_BROADCASTER=y
CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
CONFIG_BT_CTLR_ADV_AUX_SET=2
CONFIG_BT_TICKER_UPDATE=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
# DFU over BT requires
# increase of ble throughput
CONFIG_BT_BUF_ACL_RX_SIZE=502
CONFIG_BT_BUF_ACL_TX_SIZE=502
# Temporary fix as there is a strange behaviour with some Android
# phones.
CONFIG_BT_DATA_LEN_UPDATE=n
#CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_EXT_ADV=y

CONFIG_BT_CTLR=y
CONFIG_BT_LL_SW_SPLIT=y

CONFIG_BT_CTLR_ADV_EXT=y
CONFIG_BT_CTLR_ADV_PERIODIC=y

CONFIG_BT_CTLR_DF=y

CONFIG_BT_CTLR_DF_SCAN_CTE_RX=n
CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=n
CONFIG_BT_CTLR_DF_CTE_RX=n

# Limit number of possible connection to decrease memory usage
CONFIG_BT_MAX_CONN=1

# Enable chaining of multiple CTEs in periodic advertising
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y
CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16

CONFIG_BT_CTLR_TX_PWR_0=y
CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191

# Enable chaining of multiple CTEs in periodic advertising
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y
CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16

CONFIG_BT_CTLR_DF_ANT_SWITCH_TX=n
CONFIG_BT_BROADCASTER=y

CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
CONFIG_BT_CTLR_ADV_AUX_SET=2
CONFIG_BT_TICKER_UPDATE=y

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
# DFU over BT requires
# increase of ble throughput
CONFIG_BT_BUF_ACL_RX_SIZE=502
CONFIG_BT_BUF_ACL_TX_SIZE=502

# Temporary fix as there is a strange behaviour with some Android
# phones.
CONFIG_BT_DATA_LEN_UPDATE=n
#CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
2 changes: 1 addition & 1 deletion app/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_subdirectory(display)
add_subdirectory(input)

add_subdirectory_ifdef(CONFIG_SENSOR sensor)
add_subdirectory_ifdef(CONFIG_SENSOR sensor)
5 changes: 1 addition & 4 deletions app/drivers/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
rsource "display/Kconfig"
rsource "input/Kconfig"

menu "Drivers"
rsource "sensor/Kconfig"
endmenu
rsource "sensor/Kconfig"
2 changes: 1 addition & 1 deletion app/drivers/display/gc9a01/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
zephyr_sources(gc9a01.c)
zephyr_sources(buydisplay_gc9a01.c)
2 changes: 1 addition & 1 deletion app/drivers/display/gc9a01/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
menuconfig GC9A01
bool "GC9A01 compatible display controller driver"
bool "GC9A01 Display"
default n
select SPI
help
Expand Down
Loading
Loading