Skip to content

Commit

Permalink
Merge pull request #8 from Utyff/Utyf
Browse files Browse the repository at this point in the history
Support RGB Led and One Led, some small fixes, add RBG scheme and Gerber files
  • Loading branch information
xyzroe authored May 19, 2022
2 parents d5e35b9 + 256055d commit c4e4467
Show file tree
Hide file tree
Showing 10 changed files with 321 additions and 177 deletions.
36 changes: 36 additions & 0 deletions README-RGB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Zintercom

## Firmware options
Each firmware version has 6 variants.
For different zigbee modules and power supply.

- EndDevice - for battery power
- Router - for external power


- PA1 - for E18-MS1PA1 module
- PA2 - for E18-MS1PA2 module
- no suffix - for E18-MS1 module

## Using battery as power supply
The firmware for the battery has the following differences.
- The device is mostly asleep.
- Wakes up once every 30 minutes (parameter - time_report) and sends a report.
- Zigbee commands are only executed when the device wakes up.
- RGB lights up for 2 seconds after changing the mode with the button.
- When the "no sound" mode is turned on, the constant consumption is 3 mA. In this mode AAA batteries will last 1-2 months.

## RGB Software
Release 2.0.0 support new RGB hardware and legacy hardware with one Led.

## RGB Hardware
Schematics and PCB - https://oshwlab.com/Utyf/zcom

![](hardware/Schematic_Zintercom_rgb.png)

![](images/front_side_rgb.png)


### Files to reproduce
* [Gerbers](https://github.com/diyruz/Zintercom/tree/master/hardware)
* [Firmware](https://github.com/diyruz/Zintercom/releases)
76 changes: 55 additions & 21 deletions Source/hal_board_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,44 @@
#define HAL_LED_BLINK_DELAY() st( { volatile uint32 i; for (i=0; i<0x5800; i++) { }; } )

#if defined(HAL_BOARD_TARGET)
//led
#define LED1_BV BV(4)
#define LED1_SBIT P0_4
#define LED1_DDR P0DIR
// blue
#define LED1_BV BV(7)
#define LED1_SBIT P1_7
#define LED1_DDR P1DIR
#define LED1_POLARITY ACTIVE_HIGH
//catch
#define LED2_BV BV(1)
#define LED2_SBIT P0_1
#define LED2_DDR P0DIR
// green
#define LED2_BV BV(6)
#define LED2_SBIT P1_6
#define LED2_DDR P1DIR
#define LED2_POLARITY ACTIVE_HIGH
//answer
#define LED3_BV BV(2)
#define LED3_SBIT P0_2
#define LED3_DDR P0DIR
// red
#define LED3_BV BV(5)
#define LED3_SBIT P1_5
#define LED3_DDR P1DIR
#define LED3_POLARITY ACTIVE_HIGH
//handset
#define LED4_BV BV(3)
#define LED4_SBIT P0_3
// old led
#define LED4_BV BV(4)
#define LED4_SBIT P0_4
#define LED4_DDR P0DIR
#define LED4_POLARITY ACTIVE_HIGH

// Catch control pin
#define CATCH_BV BV(1)
#define CATCH_PIN P0_1
#define CATCH_DDR P0DIR
#define CATCH_SSR P0SEL
// Answer control pin
#define ANSWER_BV BV(2)
#define ANSWER_PIN P0_2
#define ANSWER_DDR P0DIR
#define ANSWER_SSR P0SEL
// Handset control pin
#define HANDSET_BV BV(3)
#define HANDSET_PIN P0_3
#define HANDSET_DDR P0DIR
#define HANDSET_SSR P0SEL

#elif defined(HAL_BOARD_CHDTECH_DEV)
//blue//d3
//blue//d3
#define LED1_BV BV(4)
#define LED1_SBIT P1_4
#define LED1_DDR P1DIR
Expand All @@ -100,13 +114,33 @@
#define LED3_DDR P1DIR
#define LED3_POLARITY ACTIVE_LOW
//ex
#define LED4_BV BV(5)
#define LED4_SBIT P1_5
#define LED4_DDR P1DIR
#define LED4_POLARITY ACTIVE_LOW
#define LED4_BV BV(4)
#define LED4_SBIT P0_4
#define LED4_DDR P0DIR
#define LED4_POLARITY ACTIVE_HIGH
// Catch control pin
#define CATCH_BV BV(1)
#define CATCH_PIN P0_1
#define CATCH_DDR P0DIR
#define CATCH_SSR P0SEL
// Answer control pin
#define ANSWER_BV BV(2)
#define ANSWER_PIN P1_2
#define ANSWER_DDR P1DIR
#define ANSWER_SSR P1SEL
// Handset control pin
#define HANDSET_BV BV(3)
#define HANDSET_PIN P1_3
#define HANDSET_DDR P1DIR
#define HANDSET_SSR P1SEL
#endif

#define BLUE_LED HAL_LED_1
#define GREEN_LED HAL_LED_2
#define RED_LED HAL_LED_3
#define OLD_LED HAL_LED_4

#define INFO_LED HAL_LED_1 | HAL_LED_4

/* ------------------------------------------------------------------------------------------------
* Push Button Configuration
Expand Down
6 changes: 3 additions & 3 deletions Source/preinclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
#define INT_HEAP_LEN 2060
#endif

#define BTN_HOLD_TIME 1000
#define FACTORY_RESET_HOLD_TIME_LONG 5000
#define BTN_HOLD_TIME 2000
#define FACTORY_RESET_HOLD_TIME_LONG 10000

#if defined( DO_DEBUG_UART )
#define HAL_UART_ISR 2
#define HAL_UART_ISR 0
#define HAL_UART TRUE
#define HAL_UART_DMA 1
#endif
Expand Down
Loading

0 comments on commit c4e4467

Please sign in to comment.