Skip to content

Commit

Permalink
support nice nano
Browse files Browse the repository at this point in the history
  • Loading branch information
tokyo2006 committed Nov 21, 2024
1 parent d6fb5e8 commit 1f6e699
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 10 deletions.
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ All the necessary stuff for [Prospector](https://github.com/carrefinho/prospecto

## Features

- Highest active layer roller
- Peripheral battery bar
- Peripheral connection status
- Caps word indicator
* Highest active layer roller
* Peripheral battery bar
* Peripheral connection status
* Caps word indicator

## Installation

Expand Down Expand Up @@ -66,15 +66,27 @@ keymap {
## Configuration

To customize, add config options to your `config/[YOUR KEYBOARD SHIELD].conf` like so:

```ini
CONFIG_PROSPECTOR_USE_AMBIENT_LIGHT_SENSOR=n
CONFIG_PROSPECTOR_FIXED_BRIGHTESS=80
```

### Available config options:
| Name | Description | Default |
| ------------------------------------------------- | --------------------------------------------------------------------------| ------------ |
| `CONFIG_PROSPECTOR_USE_AMBIENT_LIGHT_SENSOR` | Use ambient light sensor for auto brightness, set to `n` if building without one | y |
| `CONFIG_PROSPECTOR_FIXED_BRIGHTESS` | Set fixed display brightess when not using ambient light sensor | 50 (1-100) |
| `CONFIG_PROSPECTOR_PROSPECTOR_ROTATE_DISPLAY_180` | Rotate the display 180 degrees | n |
| `CONFIG_PROSPECTOR_LAYER_ROLLER_ALL_CAPS` | Convert layer names to all caps | n |

| Name | Description | Default |
| ------------------------------------------------- | -------------------------------------------------------------------------------- | ---------- |
| `CONFIG_PROSPECTOR_USE_AMBIENT_LIGHT_SENSOR` | Use ambient light sensor for auto brightness, set to `n` if building without one | y |
| `CONFIG_PROSPECTOR_FIXED_BRIGHTESS` | Set fixed display brightess when not using ambient light sensor | 50 (1-100) |
| `CONFIG_PROSPECTOR_PROSPECTOR_ROTATE_DISPLAY_180` | Rotate the display 180 degrees | n |
| `CONFIG_PROSPECTOR_LAYER_ROLLER_ALL_CAPS` | Convert layer names to all caps | n |

### Nice!Nano IO connect list:

| nice*\_nano\_v2.overlay* | display |
| :----------------------- | :------ |
| SPIM\_SCK | SCL |
| SPIM\_MOSI | SDA |
| cmd-data-gpios | DC |
| reset-gpios | RES |

Binary file added boards/shields/prospector_adapter/.DS_Store
Binary file not shown.
98 changes: 98 additions & 0 deletions boards/shields/prospector_adapter/boards/nice_nano_v2.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/ {
pwmleds {
compatible = "pwm-leds";
disp_bl: pwm_led_1 {
pwms = <&pwm1 0 PWM_MSEC(1) PWM_POLARITY_NORMAL>;
};
};
};

&spi2 {
status = "disabled";
};

&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>, //SCL
<NRF_PSEL(SPIM_MOSI, 1, 15)>, //SDA
<NRF_PSEL(SPIM_MISO, 1, 11)>;
};
};

spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
<NRF_PSEL(SPIM_MOSI, 1, 15)>,
<NRF_PSEL(SPIM_MISO, 1, 11)>;
low-power-enable;
};
};

pwm1_default: pwm1_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 10)>;
nordic,invert;
};
};

pwm1_sleep: pwm1_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 10)>;
low-power-enable;
};
};
};

disp_spi: &spi3 {
status = "okay";
pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; //CS

st7789: st7789v@0 {
compatible = "sitronix,st7789v";
spi-max-frequency = <31000000>;
reg = <0>;
cmd-data-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; //DC
reset-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; // RES
width = <240>;
height = <280>;
x-offset = <0>;
y-offset = <20>;
vcom = <0x19>;
gctrl = <0x35>;
vrhs = <0x12>;
vdvs = <0x20>;
mdac = <0x00>;
gamma = <0x01>;
colmod = <0x05>;
lcm = <0x2c>;
porch-param = [ 0c 0c 00 33 33 ];
cmd2en-param = [ 5a 69 02 01 ];
pwctrl1-param = [ a4 a1 ];
pvgam-param = [ D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23 ];
nvgam-param = [ D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23 ];
ram-param = [ 00 F0 ];
rgb-param = [ CD 08 14 ];
};
};

&i2c0 {
status = "okay";

apds9960: apds9960@39 {
compatible = "avago,apds9960";
status = "okay";
reg = <0x39>;
int-gpios = <&gpio1 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
};

&pwm1 {
status = "okay";
pinctrl-0 = <&pwm1_default>;
pinctrl-1 = <&pwm1_sleep>;
pinctrl-names = "default", "sleep";
};

0 comments on commit 1f6e699

Please sign in to comment.