goodwatch/firmware
neuracr c9c493a635
Somfy shaders support (#142)
This is an implementation of the somfy RTS protocol to control                                                                                                                   
  window blinds using the goodwatch.  Contributed by
  Naton Talon and Guillaume Weghsteen.                                                                                                                                
                                                                                                                                                                                   
  With the RTS protocol, each remote has a unique id and a rolling code                                                                                                            
  associated. We a button is pressed, a packet is broadcasted and the                                                                                                              
  window blinds around are triggered depending on if the id is registered as                                                                                                       
  one of their controler(s) and if the rolling code matches.                                                                                                                       
                                                                                                                                                                                   
  This app lets you register your goodwatch as a new remote for your blind.                                                                                                        
  It will have its own rolling code and so will not desynchronize your real                                                                                                        
  remote. To register and use a remote:                                                                                                                                            
   - put the blind is learn mode by holding the red button at the back of an                                                                                                       
     already adopted remote. The shader will go up and down to mean it's in                                                                                                        
     learn mode.                                                                                                                                                                   
   - on the watch, press for instance '3' to select id '3' and then press '=' to                                                                                                   
     send the 'register' packet. The shaders will go up and down. From now on,                                                                                                     
     the shader will accept packets from your watch from your id '3'.                                                                                                              
   - you can now press '/' to go up, '*' for the 'MY' button, and '-' to go down.                                                                                                  
     If you want to change id (let's say 5), press 5 and then the command you want.                                                                                                
     Rolling codes are updated per id.                                                                                                                                             
                                                                                                                                                                                   
  Since the protocol contains rolling codes, checksums and is obfuscated, the                                                                                                      
  packets are recomputed for every keypress.                                                                                                                                       
  The packet is made of a prefix (wake up + preamble) to with manchester encoded                                                                                                   
  data is appended. The data itself is xor obfuscated. Take a look at                                                                                                              
  https://pushstack.wordpress.com/somfy-rts-protocol/ for more information.
2020-02-29 13:15:44 -05:00
..
apps Somfy shaders support (#142) 2020-02-29 13:15:44 -05:00
libs Hebrew Calender, GCC8 and Fall-Through Buttons (#141) 2020-01-22 19:21:04 -05:00
.gitignore Hebrew Calender, GCC8 and Fall-Through Buttons (#141) 2020-01-22 19:21:04 -05:00
adc10.h Adds symbols and beginning support for the ADC10 unit of the CC430F6147. #76 2018-07-04 13:52:13 -04:00
adc.c Cleanup. 2018-07-23 18:20:30 -04:00
adc.h Adds symbols and beginning support for the ADC10 unit of the CC430F6147. #76 2018-07-04 13:52:13 -04:00
api.h Proof of concept for a POCSAG/DAPNET receiver applet. Only shows first eight letters of message, doesn't trigger display at the right moment. #118 2019-04-20 13:20:20 -04:00
applist.c Somfy shaders support (#142) 2020-02-29 13:15:44 -05:00
applist.h Somfy shaders support (#142) 2020-02-29 13:15:44 -05:00
apps.c typo in tx handler check 2018-11-11 17:42:55 -06:00
apps.h Hebrew Calender, GCC8 and Fall-Through Buttons (#141) 2020-01-22 19:21:04 -05:00
bcd.c int2bcd ROM table, eliminates all divisions in clock applet displaying the time. #96 2018-07-23 19:07:59 -04:00
bcd.h int2bcd ROM table, eliminates all divisions in clock applet displaying the time. #96 2018-07-23 19:07:59 -04:00
buzz.c Drops power consumption to 3.5µA by always running in fast mode. #103 2018-08-31 15:04:30 -04:00
buzz.h use Travis' buzz driver instead of mine, re-add alarm app to list 2018-02-10 12:28:12 -05:00
cc430f6137_symbols.ld GCC7 is linking and fits within firmware. This required a printf() replacement. #119 2019-05-19 11:50:38 -04:00
cc430f6137.ld GCC7 is linking and fits within firmware. This required a printf() replacement. #119 2019-05-19 11:50:38 -04:00
codeplug.c Codeplug is now stored in regular flash, rather than info flash. Fixes tuner in SBW-flashed devices. 2018-11-11 12:24:20 -05:00
codeplug.h Functional VFO mode in Tuner applet. Close #51. 2018-04-15 18:21:30 -04:00
codeplug.txt Updated the codeplug a bit. 2018-11-11 13:08:59 -05:00
configdefault.h Proof of concept for a POCSAG/DAPNET receiver applet. Only shows first eight letters of message, doesn't trigger display at the right moment. #118 2019-04-20 13:20:20 -04:00
configtemplate.h Proof of concept for a POCSAG/DAPNET receiver applet. Only shows first eight letters of message, doesn't trigger display at the right moment. #118 2019-04-20 13:20:20 -04:00
configure Configuration script and template. 2017-11-28 18:29:52 -05:00
descriptor.c Beginnings of a module to parse the descriptor tables. We don't investigate the TLV yet, but it's enough to read the model number. #75 2018-04-21 14:04:00 -04:00
descriptor.h Beginnings of a module to parse the descriptor tables. We don't investigate the TLV yet, but it's enough to read the model number. #75 2018-04-21 14:04:00 -04:00
dmesg.c GCC7 is linking and fits within firmware. This required a printf() replacement. #119 2019-05-19 11:50:38 -04:00
dmesg.h GCC7 is linking and fits within firmware. This required a printf() replacement. #119 2019-05-19 11:50:38 -04:00
Doxyfile Remaining doxygen headers and Doxyfile. Close #39. 2017-11-14 14:07:10 -05:00
energytrace-txt.gnuplot Better ranging on the text power plot. 2018-08-30 12:30:54 -04:00
energytrace.gnuplot Comments and cleanup. 2018-09-05 12:54:55 -04:00
keypad.c Fixed some bugs that broken GCC7 compatibility within modules. Still won't link. #119 2019-05-18 11:54:51 -04:00
keypad.h Fixed some bugs that broken GCC7 compatibility within modules. Still won't link. #119 2019-05-18 11:54:51 -04:00
lcd.c Comments and cleanup. 2018-09-05 12:54:55 -04:00
lcd.h Remaining doxygen headers and Doxyfile. Close #39. 2017-11-14 14:07:10 -05:00
lcdtext.c Corrects the coordinates for the leftmost decimal point thanks to a report by @BitBangingBytes. Close #113. 2018-11-12 20:18:15 -05:00
lcdtext.h Counter now shows the RSSI of the selected channel. 2018-07-29 16:29:51 -04:00
main.c GCC7 is linking and fits within firmware. This required a printf() replacement. #119 2019-05-19 11:50:38 -04:00
Makefile Somfy shaders support (#142) 2020-02-29 13:15:44 -05:00
Makefile.gcc4 Hebrew Calender, GCC8 and Fall-Through Buttons (#141) 2020-01-22 19:21:04 -05:00
memory.x Dmesg can now be dumped by 'make dmesg'. Close #45. 2017-11-18 14:56:46 -05:00
monitor.c Codeplug frequency no longer set by monitor on every configuration. 2018-09-23 13:27:27 -04:00
monitor.h Failed attempt at #56. 2017-12-10 12:27:40 -05:00
msp430.x Imported linker scripts, so we can force dmesg to a static address. #45 2017-11-18 14:29:58 -05:00
optim.c Cleanup of the new BCD/HEX conversion. 2018-05-24 14:17:51 -04:00
optim.h Cleanup of the new BCD/HEX conversion. 2018-05-24 14:17:51 -04:00
packet.c Idles the radio between LCD frames, dropping power consumption of POCSAG to 4mA, 24 hours of life. #118 2019-05-11 15:29:37 -04:00
packet.h Doubles packet buffer size, in anticipation of long packet support. #107 2018-10-08 21:19:47 -04:00
periph.x Adds symbols and beginning support for the ADC10 unit of the CC430F6147. #76 2018-07-04 13:52:13 -04:00
power.c Idles the radio between LCD frames, dropping power consumption of POCSAG to 4mA, 24 hours of life. #118 2019-05-11 15:29:37 -04:00
power.h Power management and basics of the radio toward #44. 2017-11-16 12:53:12 -05:00
printf.c GCC7 is linking and fits within firmware. This required a printf() replacement. #119 2019-05-19 11:50:38 -04:00
printf.h GCC7 is linking and fits within firmware. This required a printf() replacement. #119 2019-05-19 11:50:38 -04:00
radio.c Update docs for radio crystal bringup 2019-10-29 13:23:58 -07:00
radio.h Functional OOK emulation example. #85 2018-04-05 15:32:05 -04:00
README.md README for the firmware directory. 2017-09-29 15:39:05 -04:00
ref.c Now setting sampled mode. I expect that this was already the default. 2018-07-23 18:23:18 -04:00
ref.h VCC now properly measured in both CC430F6137 (ADC12) and CC430F6147 (ADC10) devices.) #76 2018-07-07 15:54:14 -04:00
rng.c Saves almost a kilobyte by implementing rand() and srand() locally in GCC8. #119 2019-12-13 07:54:04 -05:00
rng.h Cleanup to the new RNG, #63. 2018-01-27 14:50:28 -05:00
rtc.c Initial implementation of audio Morse for reading the time when the + button is held. #117 2019-02-22 22:12:31 -05:00
rtc.h Workaround for the RTC3 errata. Close #47. 2017-11-28 12:54:30 -05:00
rtcasm-r12.S RTC errata fix for both R12 and R15 calling conventions. #119 2019-12-13 07:11:13 -05:00
rtcasm-r15.S RTC errata fix for both R12 and R15 calling conventions. #119 2019-12-13 07:11:13 -05:00
rtcasm.h Noted that the RTC bug is specific to the '6137. The '6147 is unaffected. 2018-07-29 11:03:15 -04:00
sidebutton.c Minor cleanup, shabbat mode fixes. 2018-08-18 14:04:37 -04:00
sidebutton.h Remaining doxygen headers and Doxyfile. Close #39. 2017-11-14 14:07:10 -05:00
stdio.h Adds forgotten stdio.h file for GCC7 support. #119 2019-05-25 12:33:40 -04:00
uart.c Fixes SET button and adjusts Makefile to flash codeplug with firmware over SBW. 2018-09-26 17:17:58 -04:00
uart.h UART buffer is now 256 bytes. 2018-09-23 13:57:49 -04:00
ucs.c Attempts to lock the crystal more than once. Sometimes helps on startup fault. 2019-09-01 20:48:59 -04:00
ucs.h Proper UCS driver. Close #20. 2017-12-09 07:34:21 -05:00

Howdy y'all,

The GoodWatch firmware is in this directory. You will find user-level applications in the apps/ subdirectory, while *.c in the root directory contain low-level drivers.

To add your own application, for one of the smaller examples, such as stopwatch.c. Your app must provide functions for _init() (to run at startup), _draw() (to run every quarter-second for rendering), and _exit() which should just return 0 unless you need to intercept the Mode button, in which case it may return 1 to delay the exit. Add these three functions to a line of the apps[] structure in applist.h.

In general, we try not to over-abstract the hardware because we don't intend the design to be portable away from the CC430. Include <msp430.h> if you need to access the CC430's IO registers or "api.h" for all the standard functions of the GoodWatch firmware.

Cheers,

--Travis