├── .gitignore
├── README.md
├── code
├── air_quality_monitor
│ ├── .vscode
│ │ ├── c_cpp_properties.json
│ │ └── settings.json
│ ├── Python_script
│ │ └── adafruit_dashboard.py
│ ├── ble_app_uart.eww
│ ├── hex
│ │ ├── ble_app_uart_pca10040_s132.hex
│ │ ├── ble_app_uart_pca10040e_s112.hex
│ │ ├── ble_app_uart_pca10056_s140.hex
│ │ └── license.txt
│ ├── main.c
│ ├── pca10040
│ │ └── s132
│ │ │ ├── arm4
│ │ │ ├── ble_app_uart_pca10040_s132.uvopt
│ │ │ └── ble_app_uart_pca10040_s132.uvproj
│ │ │ ├── arm5_no_packs
│ │ │ ├── ble_app_uart_pca10040_s132.uvoptx
│ │ │ └── ble_app_uart_pca10040_s132.uvprojx
│ │ │ ├── armgcc
│ │ │ ├── Makefile
│ │ │ └── ble_app_uart_gcc_nrf52.ld
│ │ │ ├── config
│ │ │ ├── custom_board.h
│ │ │ └── sdk_config.h
│ │ │ ├── iar
│ │ │ ├── ble_app_uart_iar_nRF5x.icf
│ │ │ ├── ble_app_uart_pca10040_s132.ewd
│ │ │ └── ble_app_uart_pca10040_s132.ewp
│ │ │ └── ses
│ │ │ ├── ble_app_uart_pca10040_s132.emProject
│ │ │ └── flash_placement.xml
│ ├── pca10040e
│ │ └── s112
│ │ │ ├── arm4
│ │ │ ├── ble_app_uart_pca10040e_s112.uvopt
│ │ │ └── ble_app_uart_pca10040e_s112.uvproj
│ │ │ ├── arm5_no_packs
│ │ │ ├── ble_app_uart_pca10040e_s112.uvoptx
│ │ │ └── ble_app_uart_pca10040e_s112.uvprojx
│ │ │ ├── armgcc
│ │ │ ├── Makefile
│ │ │ └── ble_app_uart_gcc_nrf52.ld
│ │ │ ├── config
│ │ │ └── sdk_config.h
│ │ │ ├── iar
│ │ │ ├── ble_app_uart_iar_nRF5x.icf
│ │ │ ├── ble_app_uart_pca10040e_s112.ewd
│ │ │ └── ble_app_uart_pca10040e_s112.ewp
│ │ │ └── ses
│ │ │ ├── ble_app_uart_pca10040e_s112.emProject
│ │ │ └── flash_placement.xml
│ └── pca10056
│ │ └── s140
│ │ ├── arm4
│ │ ├── ble_app_uart_pca10056_s140.uvopt
│ │ └── ble_app_uart_pca10056_s140.uvproj
│ │ ├── arm5_no_packs
│ │ ├── ble_app_uart_pca10056_s140.uvoptx
│ │ └── ble_app_uart_pca10056_s140.uvprojx
│ │ ├── armgcc
│ │ ├── Makefile
│ │ └── ble_app_uart_gcc_nrf52.ld
│ │ ├── config
│ │ └── sdk_config.h
│ │ ├── iar
│ │ ├── ble_app_uart_iar_nRF5x.icf
│ │ ├── ble_app_uart_pca10056_s140.ewd
│ │ └── ble_app_uart_pca10056_s140.ewp
│ │ └── ses
│ │ ├── ble_app_uart_pca10056_s140.emProject
│ │ └── flash_placement.xml
├── hackaBLE-epaper-demo
│ ├── ble_cus.c
│ ├── ble_cus.h
│ ├── epaper_driver
│ │ ├── epd1in54b.c
│ │ ├── epd1in54b.h
│ │ ├── epdif.c
│ │ ├── epdif.h
│ │ ├── epdpaint.c
│ │ ├── epdpaint.h
│ │ ├── font12.c
│ │ ├── font16.c
│ │ ├── font20.c
│ │ ├── font24.c
│ │ ├── font8.c
│ │ ├── fonts.h
│ │ ├── imagedata.c
│ │ └── imagedata.h
│ ├── image.h
│ ├── main.c
│ ├── pca10040
│ │ └── s132
│ │ │ ├── armgcc
│ │ │ ├── Makefile
│ │ │ └── ble_app_template_gcc_nrf52.ld
│ │ │ └── config
│ │ │ └── sdk_config.h
│ └── pca10056
│ │ └── s140
│ │ ├── armgcc
│ │ ├── Makefile
│ │ └── ble_app_template_gcc_nrf52.ld
│ │ └── config
│ │ └── sdk_config.h
├── hackaBLE-epaper-image-transfer
│ ├── ble_cus.c
│ ├── ble_cus.h
│ ├── epaper.c
│ ├── epaper.h
│ ├── epaper_driver
│ │ ├── Release_Notes.html
│ │ ├── epd1in54b.c
│ │ ├── epd1in54b.h
│ │ ├── epdif.c
│ │ ├── epdif.h
│ │ ├── epdpaint.c
│ │ ├── epdpaint.h
│ │ └── fonts
│ │ │ ├── font12.c
│ │ │ ├── font16.c
│ │ │ ├── font20.c
│ │ │ ├── font24.c
│ │ │ ├── font8.c
│ │ │ └── fonts.h
│ ├── image.h
│ ├── main.c
│ ├── pca10040
│ │ └── s132
│ │ │ ├── armgcc
│ │ │ ├── Makefile
│ │ │ └── ble_app_template_gcc_nrf52.ld
│ │ │ └── config
│ │ │ └── sdk_config.h
│ ├── pca10056
│ │ └── s140
│ │ │ ├── armgcc
│ │ │ ├── Makefile
│ │ │ └── ble_app_template_gcc_nrf52.ld
│ │ │ └── config
│ │ │ └── sdk_config.h
│ └── scripts
│ │ ├── bluepy-exp.py
│ │ ├── example.js
│ │ ├── gen_img.py
│ │ ├── image.js
│ │ ├── qr.png
│ │ ├── transfer_image.js
│ │ └── transfer_image2.js
├── web-bluetooth-demo
│ ├── README.md
│ └── index.js
└── zephyr_ble_th
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── README.md
│ ├── prj.conf
│ └── src
│ └── main.c
├── docs
├── hackaBLEv0.2
│ ├── hackaBLE-dims.png
│ ├── hackaBLE-pinout.png
│ ├── hackaBLE-prog1.jpg
│ ├── hackaBLE-prog2.jpg
│ └── hackaBLE1.jpg
├── hackaBLEv0.3
│ ├── hackaBLE-pinout_V0.3.1.png
│ ├── hackable_v0.3.jpg
│ └── thumbnail.jpg
├── hackaBLEv2.2
│ ├── hackaBLE_Dimensions.png
│ ├── hackable_back.jpg
│ ├── hackable_front.jpg
│ ├── hackable_pinout.png
│ └── thumbnail.jpg
└── schematic.pdf
├── hackable_footprint.kicad_mod
├── pcb
├── README.md
├── ver0.2
│ ├── hackaBLE .dcm
│ ├── hackaBLE-cache.lib
│ ├── hackaBLE.bak
│ ├── hackaBLE.kicad_pcb
│ ├── hackaBLE.kicad_pcb-bak
│ ├── hackaBLE.lib
│ ├── hackaBLE.net
│ ├── hackaBLE.pretty
│ │ ├── 5pin_header.kicad_mod
│ │ ├── 6pin_header.kicad_mod
│ │ ├── ABS07_crystal.kicad_mod
│ │ ├── CR2302_SparkfunHolder.kicad_mod
│ │ ├── CREE-CA.kicad_mod
│ │ ├── MDBT42.kicad_mod
│ │ ├── Pin_Header_Straight_1x02_Pitch2.54.kicad_mod
│ │ ├── Pin_Header_Straight_1x04_Pitch2.54.kicad_mod
│ │ ├── Pin_Header_Straight_1x05_Pitch2.54.kicad_mod
│ │ ├── Pin_Header_Straight_1x06_Pitch2.54.kicad_mod
│ │ ├── Pin_Header_Straight_1x07_Pitch2.54.kicad_mod
│ │ ├── Pin_Header_Straight_1x12_Pitch1.27mm.kicad_mod
│ │ └── peter-switch.kicad_mod
│ ├── hackaBLE.pro
│ └── hackaBLE.sch
├── ver0.3
│ ├── hackaBLE.kicad_pcb
│ ├── hackaBLE.pro
│ ├── hackaBLE.sch
│ └── hackaBLE_Schematic.pdf
└── ver2.2
│ ├── BOM hackaBLE 2.2.xlsx
│ ├── PCB Specifications.txt
│ ├── gerbers
│ ├── hackaBLE-B.Cu.gbl
│ ├── hackaBLE-B.Mask.gbs
│ ├── hackaBLE-B.Paste.gbp
│ ├── hackaBLE-B.SilkS.gbo
│ ├── hackaBLE-Edge.Cuts.gm1
│ ├── hackaBLE-F.Cu.gtl
│ ├── hackaBLE-F.Mask.gts
│ ├── hackaBLE-F.Paste.gtp
│ ├── hackaBLE-F.SilkS.gto
│ ├── hackaBLE-all.pos
│ ├── hackaBLE-brd.svg
│ └── hackaBLE.drl
│ ├── hackaBLE
│ ├── hackaBLE-cache.lib
│ ├── hackaBLE-rescue.lib
│ ├── hackaBLE.bak
│ ├── hackaBLE.bck
│ ├── hackaBLE.dcm
│ ├── hackaBLE.html
│ ├── hackaBLE.kicad_pcb
│ ├── hackaBLE.kicad_pcb-bak
│ ├── hackaBLE.lib
│ ├── hackaBLE.net
│ ├── hackaBLE.pdf
│ ├── hackaBLE.pretty
│ ├── 32MHz_crystal.kicad_mod
│ ├── 5pin_header.kicad_mod
│ ├── ABS07_crystal.kicad_mod
│ ├── Antenna-2.45GHZ_mirror.kicad_mod
│ ├── PTS810_Switch.kicad_mod
│ ├── PinHeaderStraight1x09_Pitch2.54mm.kicad_mod
│ ├── Pin_Header_Straight_1x02_Pitch2.54.kicad_mod
│ ├── Pin_Header_Straight_1x04_Pitch2.54.kicad_mod
│ ├── RGB_LED.kicad_mod
│ ├── SMD_0402.kicad_mod
│ ├── SMD_C0402.kicad_mod
│ ├── logo.kicad_mod
│ └── nRF52832.kicad_mod
│ ├── hackaBLE.pro
│ ├── hackaBLE.sch
│ └── hackaBLE.xml
└── programming_guide.md
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode/
2 | _build/
3 | node_modules/
4 | package-lock.json
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > **Note**: This repository has been moved to our GitLab page on May 2019, and will not receive any updates or be monitored. Please follow this link to go to the new repository: https://gitlab.com/electronutlabs-public/ElectronutLabs-HackaBLE
2 |
3 | 
4 |
5 | ## What is hackaBLE ?
6 |
7 | **hackaBLE** is a tiny (~ 18 mm x 28 mm) Open Source Nordic nRF52832 based BLE development board you can embed in your BLE projects. It's designed such that you can use it in three ways:
8 |
9 | - On a breadboard
10 | - On a custom PCB, hand-soldered easily using the castellated 2.54 mm pitch headers
11 | - On a custom PCB, using a stencil and oven, making use of extra pads underneath the PCB
12 |
13 | hackaBLE uses offers more value than just using the BLE module directly - since it incorporates the necessary passive components - including the ones for the buck converter for power saving - and adds an RGB LED and a button for convenience. It's also much easier to solder than the bare modules.
14 |
15 | **Features**
16 |
17 | - Raytac MDBT42 based on Nordic Semiconductor's nRF52832 SOC with chip antenna
18 | - RGB LED
19 | - Button user configurable, set as RESET by default
20 | - SWD programming headers
21 | - MCP1702 3.3 V LDO
22 | - Reverse current protection.
23 |
24 | Currently, there are two versions available in the market. Select your version of hackaBLE from below and follow the documentation.
25 |
26 |
27 |
28 | 
29 |
30 |
31 |
32 | 
33 |
34 |
35 |
36 |
37 | ## hackaBLE v0.3
38 |
39 | 
40 |
41 | This is the latest version of hackaBLE it uses **Raytac's nRF52832 module** by Nordic Semiconductors. This version uses MCP1702, a 3.3 V voltage and protection diode at the input which enables hackaBLE to consume very low current and also provides reverse current protection. It also comes with an RGB LED, user reset button and SWD programming headers.
42 |
43 | ### hackaBLE v0.3 pinout
44 |
45 | 
46 |
47 | ### hackaBLE v0.3 PCB Footprint
48 |
49 | 
50 |
51 | ### hackaBLE v0.3 Schematic and Datasheet
52 |
53 | - [schematic](pcb/ver0.3/hackaBLE_Schematic.pdf)
54 | - datasheet
55 |
56 |
57 |
58 |
59 | ## hackaBLE v2.2
60 |
61 | 
62 |
63 | hackaBLE v2.2 is a redesigned hackaBLE that used the BLE SoC directly rather than a module. This version of hackaBLE also comes with an RGB LED, button, and SWD programming headers. It has onboard BLE antenna.
64 |
65 | **[CAUTION]** hackaBLE v2.2 does not come with a regulator since it's designed for low power applications. MAX input to VDD is 3.6 V.
66 |
67 | ### hackaBLE v2.2 pinout
68 | 
69 |
70 | ### Schematic for hackaBLE v2.2
71 |
72 | - [Schematic](pcb/ver2.2/hackaBLE.pdf)
73 |
74 | ## Programming hackaBLE
75 |
76 | hackaBLE uses the Nordic nRF52832 which in turn is based on an ARM Cortex-M4 core. So you can really program it with any ARM compatible programmer. We do have a convenient solution though, in the form of our [Bumpy][3] Blackmagic probe compatible SWD debugger and our [PogoProg][4].
77 |
78 | 
79 |
80 | 
81 |
82 | As shown above, use the four SWD pins of PogoProg on hackaBLE to upload or debug hackaBLE.
83 |
84 | Please [read the bumpy documentation][3] on using Bumpy to program hackaBLE.
85 |
86 | For more details on nRF52 programming, please read our guide on [getting started with Nordic nRF5 SDK][1].
87 |
88 | ### Program using Arduino IDE
89 |
90 | hackable does not ship with a bootloader, but it is supported in Arduino. Please visit [here](https://github.com/electronut/ElectronutLabs-bluey#Arduino) for details (but select Hackable in the board's menu).
91 |
92 | [Here's](https://electronut.in/using-hackable-with-arduino/) a blog article which will help you create a BLE custom characteristic and program it to hackaBLE using Arduino IDE.
93 |
94 | For more detailed programming guide go [here](https://docs.electronut.in/hackaBLE/programming_guide/)
95 |
96 | ## Soldering headers hackaBLE
97 |
98 | hackaBLE can be used on a breadboard. Here's a video that shows how to solder headers on to hackaBLE.
99 |
100 | [](http://www.youtube.com/watch?v=VOO5d_ryxtU)
101 |
102 | ## Buy a hackaBLE!
103 |
104 | hackaBLE is available for purchase from our [Tindie store][2]. Please email us at **info@electronut.in** if you have any questions.
105 |
106 |
107 | [1]: https://github.com/electronut/ElectronutLabs-bluey/blob/master/nrf5-sdk-setup.md
108 | [2]: https://www.tindie.com/stores/ElectronutLabs/
109 | [3]: https://gitlab.com/electronut/ElectronutLabs-Bumpy
110 | [4]: https://gitlab.com/electronutlabs-public/ElectronutLabs-PogoProg
111 |
112 | ## Code Repository
113 |
114 | You can find all code and design files related to HackaBLE in this [repository](https://gitlab.com/electronutlabs-public/ElectronutLabs-HackaBLE).
115 |
116 | ## About Electronut Labs
117 |
118 | **Electronut Labs** is an Embedded Systems company based in Bangalore, India. More
119 | information at our [website](https://electronut.in).
120 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/.vscode/c_cpp_properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "Mac",
5 | "includePath": [
6 | "/usr/include",
7 | "/usr/local/include",
8 | "${workspaceRoot}"
9 | ],
10 | "defines": [],
11 | "intelliSenseMode": "clang-x64",
12 | "browse": {
13 | "path": [
14 | "/usr/include",
15 | "/usr/local/include",
16 | "${workspaceRoot}"
17 | ],
18 | "limitSymbolsToIncludedHeaders": true,
19 | "databaseFilename": ""
20 | },
21 | "macFrameworkPath": [
22 | "/System/Library/Frameworks",
23 | "/Library/Frameworks"
24 | ]
25 | },
26 | {
27 | "name": "Linux",
28 | "includePath": [
29 | "/usr/include",
30 | "/usr/local/include",
31 | "${workspaceRoot}"
32 | ],
33 | "defines": [],
34 | "intelliSenseMode": "clang-x64",
35 | "browse": {
36 | "path": [
37 | "/usr/include",
38 | "/usr/local/include",
39 | "${workspaceRoot}"
40 | ],
41 | "limitSymbolsToIncludedHeaders": true,
42 | "databaseFilename": ""
43 | }
44 | },
45 | {
46 | "name": "Win32",
47 | "includePath": [
48 | "D:/nRF5_SDK_14.2.0_17b948a/nRF5_SDK_14.2.0_17b948a/",
49 | "D:/nRF5_SDK_14.2.0_17b948a/nRF5_SDK_14.2.0_17b948a/components/",
50 | "${workspaceRoot}"
51 | ],
52 | "defines": [
53 | "_DEBUG",
54 | "UNICODE",
55 | "_UNICODE"
56 | ],
57 | "intelliSenseMode": "msvc-x64",
58 | "browse": {
59 | "path": [
60 | "D:/nRF5_SDK_14.2.0_17b948a/nRF5_SDK_14.2.0_17b948a/",
61 | "D:/nRF5_SDK_14.2.0_17b948a/nRF5_SDK_14.2.0_17b948a/components/",
62 | "${workspaceRoot}"
63 | ],
64 | "limitSymbolsToIncludedHeaders": true,
65 | "databaseFilename": ""
66 | },
67 | "cStandard": "c11",
68 | "cppStandard": "c++17"
69 | }
70 | ],
71 | "version": 3
72 | }
--------------------------------------------------------------------------------
/code/air_quality_monitor/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "C_Cpp.intelliSenseEngineFallback": "Enabled",
3 | "files.associations": {
4 | "nrf_sdh.h": "c",
5 | "nordic_common.h": "c",
6 | "app_uart.h": "c",
7 | "nrf.h": "c",
8 | "ble_conn_params.h": "c",
9 | "ble_hci.h": "c",
10 | "compiler_abstraction.h": "c",
11 | "nrf51_to_nrf52810.h": "c",
12 | "nrf_sdh_soc.h": "c",
13 | "bsp_btn_ble.h": "c",
14 | "bsp.h": "c",
15 | "boards.h": "c",
16 | "pca10040.h": "c",
17 | "nrf_log.h": "c"
18 | }
19 | }
--------------------------------------------------------------------------------
/code/air_quality_monitor/Python_script/adafruit_dashboard.py:
--------------------------------------------------------------------------------
1 | """
2 | This program connects to the hackaBLE Nordic nRF52 dev board
3 | made by Electronut Labs. The firmware on hackaBLE has to be running the
4 | "air_quality_monitor" code present in this directory.
5 | This code is expected to be run on a Raspverry Pi 3.
6 | It assumes that you have bluez installed - it uses hcidump and hcitool.
7 | The code reads advertisement packets from bluey, parses the
8 | Temperature, Humidity, and dust sensor values
9 | posts that to adafruit.io dashboard via adafruit.io cloud server
10 | Electronut Labs
11 | electronut.in
12 | References:
13 | 1. ElectronutLabs-bluey/code/bluey-beacon/bluey_beacon.py
14 | """
15 |
16 | import re
17 | import sys
18 | import os
19 | import urllib2
20 | import time
21 | import subprocess
22 |
23 | import time
24 |
25 | # Import Adafruit IO MQTT client.
26 | from Adafruit_IO import MQTTClient
27 |
28 |
29 | # Set to your Adafruit IO key & username below.
30 | ADAFRUIT_IO_KEY = 'b9627e9bd96f4178975454873cb67491'
31 | ADAFRUIT_IO_USERNAME = 'Vaishali94' # See https://accounts.adafruit.com
32 | # to find your username.
33 |
34 |
35 | # Define callback functions which will be called when certain events happen.
36 | def connected(client):
37 | print('Connected to Adafruit IO! Listening for Dust_sensor changes...')
38 | # Subscribe to changes on a feed named DemoFeed.
39 | # client.subscribe('Dust_sensor')
40 |
41 | def disconnected(client):
42 | # Disconnected function will be called when the client disconnects.
43 | print('Disconnected from Adafruit IO!')
44 | sys.exit(1)
45 |
46 | def message(client, feed_id, payload):
47 | print('Feed {0} received new value: {1}'.format(feed_id, payload))
48 |
49 | # Create an MQTT client instance.
50 | client = MQTTClient(ADAFRUIT_IO_USERNAME, ADAFRUIT_IO_KEY)
51 |
52 |
53 | # Setup the callback functions defined above.
54 | client.on_connect = connected
55 | client.on_disconnect = disconnected
56 | client.on_message = message
57 |
58 | # Connect to the Adafruit IO server.
59 |
60 |
61 |
62 | """
63 | This class uses hctool and hcidump to parse BLE adv data.
64 | """
65 | class BLEScanner:
66 |
67 | hcitool = None
68 | hcidump = None
69 |
70 | def start(self):
71 | print('Start receiving broadcasts')
72 | DEVNULL = subprocess.DEVNULL if sys.version_info > (3, 0) else open(os.devnull, 'wb')
73 |
74 | subprocess.call('sudo hciconfig hci0 reset', shell = True, stdout = DEVNULL)
75 | self.hcitool = subprocess.Popen(['sudo', '-n', 'hcitool', 'lescan', '--duplicates'], stdout = DEVNULL)
76 | self.hcidump = subprocess.Popen(['sudo', '-n', 'hcidump', '--raw'], stdout=subprocess.PIPE)
77 |
78 | def stop(self):
79 | print('Stop receiving broadcasts')
80 | subprocess.call(['sudo', 'kill', str(self.hcidump.pid), '-s', 'SIGINT'])
81 | subprocess.call(['sudo', '-n', 'kill', str(self.hcitool.pid), '-s', "SIGINT"])
82 |
83 | def get_lines(self):
84 | data = None
85 | try:
86 | print("reading hcidump...\n")
87 | #for line in hcidump.stdout:
88 | while True:
89 | line = self.hcidump.stdout.readline()
90 | #print (line)
91 | line = line.decode()
92 | if line.startswith('> '):
93 | yield data
94 | data = line[2:].strip().replace(' ', '')
95 | elif line.startswith('< '):
96 | data = None
97 | else:
98 | if data:
99 | data += line.strip().replace(' ', '')
100 | except KeyboardInterrupt as ex:
101 | print("kbi")
102 | return
103 | except Exception as ex:
104 | print(ex)
105 | return
106 |
107 |
108 | # main() function
109 | def main():
110 | # use sys.argv if needed
111 | if len(sys.argv) < 2:
112 | print('Usage: python bluey-beacon.py MACADDR')
113 | exit(0)
114 | print 'starting...'
115 |
116 | deviceId = sys.argv[1]
117 | scanner = BLEScanner()
118 | scanner.start()
119 | client.connect()
120 | client.loop_background()
121 | print('Publishing a new message every 10 seconds (press Ctrl-C to quit)...')
122 | data = None
123 | while True:
124 | for line in scanner.get_lines():
125 | if line:
126 | found_mac = line[14:][:12]
127 | reversed_mac = ''.join(
128 | reversed([found_mac[i:i + 2] for i in range(0, len(found_mac), 2)]))
129 | mac = ':'.join(a+b for a,b in zip(reversed_mac[::2], reversed_mac[1::2]))
130 | #print(mac)
131 | data = line[26:]
132 | #print(data)
133 | if mac == deviceId and len(data) == 56:
134 | #print(data)
135 | if u'416972514D' in data:
136 | data2 = data[24:40]
137 | print(data2)
138 | x1 = int(data2[0:4], 16)
139 | x2 = int(data2[4:8], 16)
140 | x3 = int(data2[8:12], 16)
141 | x4 = int(data2[12:14], 16)
142 | x5 = int(data2[14:16], 16)
143 | if x1 <= 1000 and x2<=1000 and x3<=1000:
144 | print("%x %x %x\n" % (x1, x2, x3))
145 | #value = random.randint(0, 100)
146 | #time.sleep(10)
147 | #T, H, L = decodeData(x1, x2, x3, x4)
148 | print('Publishing {0} to AIR QUALITY MONITOR.'.format(x1))
149 | print('Publishing {0} to AIR QUALITY MONITOR.'.format(x2))
150 | print('Publishing {0} to AIR QUALITY MONITOR.'.format(x3))
151 | print('Publishing {0} to AIR QUALITY MONITOR.'.format(x4))
152 | print('Publishing {0} to AIR QUALITY MONITOR.'.format(x5))
153 | client.publish('pm0-1', x1)
154 | client.publish('pm2-5', x2)
155 | client.publish('pm10', x3)
156 | client.publish('temperature', x4)
157 | client.publish('humidity', x5)
158 | time.sleep(20)
159 |
160 | scanner.stop()
161 | exit(0)
162 |
163 | # call main
164 | if __name__ == '__main__':
165 | main()
166 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/ble_app_uart.eww:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $WS_DIR$\pca10040\s132\iar\ble_app_uart_pca10040_s132.ewp
5 |
6 | $WS_DIR$\pca10056\s140\iar\ble_app_uart_pca10056_s140.ewp
7 |
8 | $WS_DIR$\pca10040e\s112\iar\ble_app_uart_pca10040e_s112.ewp
9 |
10 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/hex/license.txt:
--------------------------------------------------------------------------------
1 | The provided HEX files were compiled using the projects located in the folders for the respective boards (pca10xxx).
2 |
3 | For license and copyright information, see the individual .c and .h files that are included in the projects.
4 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10040/s132/arm4/ble_app_uart_pca10040_s132.uvopt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1.0
5 |
6 | ### uVision Project, (C) Keil Software
7 |
8 | nrf52832_xxaa
9 | 0x4
10 | ARM-ADS
11 |
12 | 1
13 |
14 | Segger\JL2CM3.dll
15 |
16 |
17 |
18 | 0
19 | JL2CM3
20 | -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(0BB11477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0nrf52xxx -FS00 -FL0200000 -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000
21 |
22 |
23 | 0
24 | UL2CM3
25 | UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0nrf52xxx -FS00 -FL0200000)
26 |
27 |
28 |
29 |
30 | flash_s132_nrf52_5.0.0_softdevice
31 | 0x4
32 | ARM-ADS
33 |
34 | Segger\JL2CM3.dll
35 |
36 |
37 |
38 | 0
39 | JL2CM3
40 | -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(0BB11477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0nrf52xxx_ecb -FS00 -FL0200000 -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000
41 |
42 |
43 | 0
44 | UL2CM3
45 | UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0nrf52xxx -FS00 -FL0200000)
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10040/s132/armgcc/ble_app_uart_gcc_nrf52.ld:
--------------------------------------------------------------------------------
1 | /* Linker script to configure memory regions. */
2 |
3 | SEARCH_DIR(.)
4 | GROUP(-lgcc -lc -lnosys)
5 |
6 | MEMORY
7 | {
8 | FLASH (rx) : ORIGIN = 0x23000, LENGTH = 0x5d000
9 | RAM (rwx) : ORIGIN = 0x20002a68, LENGTH = 0xd598
10 |
11 | }
12 |
13 | SECTIONS
14 | {
15 | }
16 |
17 | SECTIONS
18 | {
19 | . = ALIGN(4);
20 | .mem_section_dummy_ram :
21 | {
22 | }
23 | .log_dynamic_data :
24 | {
25 | PROVIDE(__start_log_dynamic_data = .);
26 | KEEP(*(SORT(.log_dynamic_data*)))
27 | PROVIDE(__stop_log_dynamic_data = .);
28 | } > RAM
29 | .fs_data :
30 | {
31 | PROVIDE(__start_fs_data = .);
32 | KEEP(*(.fs_data))
33 | PROVIDE(__stop_fs_data = .);
34 | } > RAM
35 | .cli_sorted_cmd_ptrs :
36 | {
37 | PROVIDE(__start_cli_sorted_cmd_ptrs = .);
38 | KEEP(*(.cli_sorted_cmd_ptrs))
39 | PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
40 | } > RAM
41 |
42 | } INSERT AFTER .data;
43 |
44 | SECTIONS
45 | {
46 | .mem_section_dummy_rom :
47 | {
48 | }
49 | .sdh_soc_observers :
50 | {
51 | PROVIDE(__start_sdh_soc_observers = .);
52 | KEEP(*(SORT(.sdh_soc_observers*)))
53 | PROVIDE(__stop_sdh_soc_observers = .);
54 | } > FLASH
55 | .sdh_ble_observers :
56 | {
57 | PROVIDE(__start_sdh_ble_observers = .);
58 | KEEP(*(SORT(.sdh_ble_observers*)))
59 | PROVIDE(__stop_sdh_ble_observers = .);
60 | } > FLASH
61 | .pwr_mgmt_data :
62 | {
63 | PROVIDE(__start_pwr_mgmt_data = .);
64 | KEEP(*(SORT(.pwr_mgmt_data*)))
65 | PROVIDE(__stop_pwr_mgmt_data = .);
66 | } > FLASH
67 | .log_const_data :
68 | {
69 | PROVIDE(__start_log_const_data = .);
70 | KEEP(*(SORT(.log_const_data*)))
71 | PROVIDE(__stop_log_const_data = .);
72 | } > FLASH
73 | .sdh_req_observers :
74 | {
75 | PROVIDE(__start_sdh_req_observers = .);
76 | KEEP(*(SORT(.sdh_req_observers*)))
77 | PROVIDE(__stop_sdh_req_observers = .);
78 | } > FLASH
79 | .sdh_state_observers :
80 | {
81 | PROVIDE(__start_sdh_state_observers = .);
82 | KEEP(*(SORT(.sdh_state_observers*)))
83 | PROVIDE(__stop_sdh_state_observers = .);
84 | } > FLASH
85 | .sdh_stack_observers :
86 | {
87 | PROVIDE(__start_sdh_stack_observers = .);
88 | KEEP(*(SORT(.sdh_stack_observers*)))
89 | PROVIDE(__stop_sdh_stack_observers = .);
90 | } > FLASH
91 | .cli_command :
92 | {
93 | PROVIDE(__start_cli_command = .);
94 | KEEP(*(.cli_command))
95 | PROVIDE(__stop_cli_command = .);
96 | } > FLASH
97 |
98 |
99 | } INSERT AFTER .text
100 |
101 | INCLUDE "nrf5x_common.ld"
102 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10040/s132/iar/ble_app_uart_iar_nRF5x.icf:
--------------------------------------------------------------------------------
1 | /*###ICF### Section handled by ICF editor, don't touch! ****/
2 | /*-Editor annotation file-*/
3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4 | /*-Specials-*/
5 | define symbol __ICFEDIT_intvec_start__ = 0x23000;
6 | /*-Memory Regions-*/
7 | define symbol __ICFEDIT_region_ROM_start__ = 0x23000;
8 | define symbol __ICFEDIT_region_ROM_end__ = 0x7ffff;
9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20002a68;
10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000ffff;
11 | export symbol __ICFEDIT_region_RAM_start__;
12 | export symbol __ICFEDIT_region_RAM_end__;
13 | /*-Sizes-*/
14 | define symbol __ICFEDIT_size_cstack__ = 0x800;
15 | define symbol __ICFEDIT_size_heap__ = 0x200;
16 | /**** End of ICF editor section. ###ICF###*/
17 |
18 | define memory mem with size = 4G;
19 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
20 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
21 |
22 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
23 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
24 |
25 | initialize by copy { readwrite };
26 | do not initialize { section .noinit };
27 |
28 | keep { section .intvec };
29 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
30 | place in ROM_region { readonly };
31 | place in RAM_region { readwrite,
32 | block CSTACK,
33 | block HEAP };
34 |
35 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10040/s132/ses/flash_placement.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10040e/s112/arm4/ble_app_uart_pca10040e_s112.uvopt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1.0
5 |
6 | ### uVision Project, (C) Keil Software
7 |
8 | nrf52810_xxaa
9 | 0x4
10 | ARM-ADS
11 |
12 | 1
13 |
14 | Segger\JL2CM3.dll
15 |
16 |
17 |
18 | 0
19 | JL2CM3
20 | -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(0BB11477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0nrf52xxx -FS00 -FL0200000 -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000
21 |
22 |
23 | 0
24 | UL2CM3
25 | UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0nrf52xxx -FS00 -FL0200000)
26 |
27 |
28 |
29 |
30 | flash_s112_nrf52810_5.1.0_softdevice
31 | 0x4
32 | ARM-ADS
33 |
34 | Segger\JL2CM3.dll
35 |
36 |
37 |
38 | 0
39 | JL2CM3
40 | -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(0BB11477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0nrf52xxx_ecb -FS00 -FL0200000 -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000
41 |
42 |
43 | 0
44 | UL2CM3
45 | UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0nrf52xxx -FS00 -FL0200000)
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10040e/s112/armgcc/ble_app_uart_gcc_nrf52.ld:
--------------------------------------------------------------------------------
1 | /* Linker script to configure memory regions. */
2 |
3 | SEARCH_DIR(.)
4 | GROUP(-lgcc -lc -lnosys)
5 |
6 | MEMORY
7 | {
8 | FLASH (rx) : ORIGIN = 0x18000, LENGTH = 0x18000
9 | RAM (rwx) : ORIGIN = 0x200025b8, LENGTH = 0x3a48
10 |
11 | }
12 |
13 | SECTIONS
14 | {
15 | }
16 |
17 | SECTIONS
18 | {
19 | . = ALIGN(4);
20 | .mem_section_dummy_ram :
21 | {
22 | }
23 | .log_dynamic_data :
24 | {
25 | PROVIDE(__start_log_dynamic_data = .);
26 | KEEP(*(SORT(.log_dynamic_data*)))
27 | PROVIDE(__stop_log_dynamic_data = .);
28 | } > RAM
29 | .fs_data :
30 | {
31 | PROVIDE(__start_fs_data = .);
32 | KEEP(*(.fs_data))
33 | PROVIDE(__stop_fs_data = .);
34 | } > RAM
35 | .cli_sorted_cmd_ptrs :
36 | {
37 | PROVIDE(__start_cli_sorted_cmd_ptrs = .);
38 | KEEP(*(.cli_sorted_cmd_ptrs))
39 | PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
40 | } > RAM
41 |
42 | } INSERT AFTER .data;
43 |
44 | SECTIONS
45 | {
46 | .mem_section_dummy_rom :
47 | {
48 | }
49 | .sdh_soc_observers :
50 | {
51 | PROVIDE(__start_sdh_soc_observers = .);
52 | KEEP(*(SORT(.sdh_soc_observers*)))
53 | PROVIDE(__stop_sdh_soc_observers = .);
54 | } > FLASH
55 | .sdh_ble_observers :
56 | {
57 | PROVIDE(__start_sdh_ble_observers = .);
58 | KEEP(*(SORT(.sdh_ble_observers*)))
59 | PROVIDE(__stop_sdh_ble_observers = .);
60 | } > FLASH
61 | .pwr_mgmt_data :
62 | {
63 | PROVIDE(__start_pwr_mgmt_data = .);
64 | KEEP(*(SORT(.pwr_mgmt_data*)))
65 | PROVIDE(__stop_pwr_mgmt_data = .);
66 | } > FLASH
67 | .log_const_data :
68 | {
69 | PROVIDE(__start_log_const_data = .);
70 | KEEP(*(SORT(.log_const_data*)))
71 | PROVIDE(__stop_log_const_data = .);
72 | } > FLASH
73 | .sdh_req_observers :
74 | {
75 | PROVIDE(__start_sdh_req_observers = .);
76 | KEEP(*(SORT(.sdh_req_observers*)))
77 | PROVIDE(__stop_sdh_req_observers = .);
78 | } > FLASH
79 | .sdh_state_observers :
80 | {
81 | PROVIDE(__start_sdh_state_observers = .);
82 | KEEP(*(SORT(.sdh_state_observers*)))
83 | PROVIDE(__stop_sdh_state_observers = .);
84 | } > FLASH
85 | .sdh_stack_observers :
86 | {
87 | PROVIDE(__start_sdh_stack_observers = .);
88 | KEEP(*(SORT(.sdh_stack_observers*)))
89 | PROVIDE(__stop_sdh_stack_observers = .);
90 | } > FLASH
91 | .cli_command :
92 | {
93 | PROVIDE(__start_cli_command = .);
94 | KEEP(*(.cli_command))
95 | PROVIDE(__stop_cli_command = .);
96 | } > FLASH
97 |
98 |
99 | } INSERT AFTER .text
100 |
101 | INCLUDE "nrf5x_common.ld"
102 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10040e/s112/iar/ble_app_uart_iar_nRF5x.icf:
--------------------------------------------------------------------------------
1 | /*###ICF### Section handled by ICF editor, don't touch! ****/
2 | /*-Editor annotation file-*/
3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4 | /*-Specials-*/
5 | define symbol __ICFEDIT_intvec_start__ = 0x18000;
6 | /*-Memory Regions-*/
7 | define symbol __ICFEDIT_region_ROM_start__ = 0x18000;
8 | define symbol __ICFEDIT_region_ROM_end__ = 0x2ffff;
9 | define symbol __ICFEDIT_region_RAM_start__ = 0x200025b8;
10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20005fff;
11 | export symbol __ICFEDIT_region_RAM_start__;
12 | export symbol __ICFEDIT_region_RAM_end__;
13 | /*-Sizes-*/
14 | define symbol __ICFEDIT_size_cstack__ = 0x800;
15 | define symbol __ICFEDIT_size_heap__ = 0x200;
16 | /**** End of ICF editor section. ###ICF###*/
17 |
18 | define memory mem with size = 4G;
19 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
20 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
21 |
22 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
23 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
24 |
25 | initialize by copy { readwrite };
26 | do not initialize { section .noinit };
27 |
28 | keep { section .intvec };
29 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
30 | place in ROM_region { readonly };
31 | place in RAM_region { readwrite,
32 | block CSTACK,
33 | block HEAP };
34 |
35 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10040e/s112/ses/flash_placement.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10056/s140/arm4/ble_app_uart_pca10056_s140.uvopt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1.0
5 |
6 | ### uVision Project, (C) Keil Software
7 |
8 | nrf52840_xxaa
9 | 0x4
10 | ARM-ADS
11 |
12 | 1
13 |
14 | Segger\JL2CM3.dll
15 |
16 |
17 |
18 | 0
19 | JL2CM3
20 | -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(0BB11477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0nrf52xxx -FS00 -FL0200000 -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000
21 |
22 |
23 | 0
24 | UL2CM3
25 | UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0nrf52xxx -FS00 -FL0200000)
26 |
27 |
28 |
29 |
30 | flash_s140_nrf52840_5.0.0-2.alpha_softdevice
31 | 0x4
32 | ARM-ADS
33 |
34 | Segger\JL2CM3.dll
35 |
36 |
37 |
38 | 0
39 | JL2CM3
40 | -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(0BB11477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0nrf52xxx_ecb -FS00 -FL0200000 -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000
41 |
42 |
43 | 0
44 | UL2CM3
45 | UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0nrf52xxx -FS00 -FL0200000)
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10056/s140/armgcc/ble_app_uart_gcc_nrf52.ld:
--------------------------------------------------------------------------------
1 | /* Linker script to configure memory regions. */
2 |
3 | SEARCH_DIR(.)
4 | GROUP(-lgcc -lc -lnosys)
5 |
6 | MEMORY
7 | {
8 | FLASH (rx) : ORIGIN = 0x22000, LENGTH = 0xde000
9 | RAM (rwx) : ORIGIN = 0x20002a18, LENGTH = 0x3d5e8
10 |
11 | }
12 |
13 | SECTIONS
14 | {
15 | }
16 |
17 | SECTIONS
18 | {
19 | . = ALIGN(4);
20 | .mem_section_dummy_ram :
21 | {
22 | }
23 | .log_dynamic_data :
24 | {
25 | PROVIDE(__start_log_dynamic_data = .);
26 | KEEP(*(SORT(.log_dynamic_data*)))
27 | PROVIDE(__stop_log_dynamic_data = .);
28 | } > RAM
29 | .fs_data :
30 | {
31 | PROVIDE(__start_fs_data = .);
32 | KEEP(*(.fs_data))
33 | PROVIDE(__stop_fs_data = .);
34 | } > RAM
35 | .cli_sorted_cmd_ptrs :
36 | {
37 | PROVIDE(__start_cli_sorted_cmd_ptrs = .);
38 | KEEP(*(.cli_sorted_cmd_ptrs))
39 | PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
40 | } > RAM
41 |
42 | } INSERT AFTER .data;
43 |
44 | SECTIONS
45 | {
46 | .mem_section_dummy_rom :
47 | {
48 | }
49 | .sdh_soc_observers :
50 | {
51 | PROVIDE(__start_sdh_soc_observers = .);
52 | KEEP(*(SORT(.sdh_soc_observers*)))
53 | PROVIDE(__stop_sdh_soc_observers = .);
54 | } > FLASH
55 | .sdh_ble_observers :
56 | {
57 | PROVIDE(__start_sdh_ble_observers = .);
58 | KEEP(*(SORT(.sdh_ble_observers*)))
59 | PROVIDE(__stop_sdh_ble_observers = .);
60 | } > FLASH
61 | .pwr_mgmt_data :
62 | {
63 | PROVIDE(__start_pwr_mgmt_data = .);
64 | KEEP(*(SORT(.pwr_mgmt_data*)))
65 | PROVIDE(__stop_pwr_mgmt_data = .);
66 | } > FLASH
67 | .log_const_data :
68 | {
69 | PROVIDE(__start_log_const_data = .);
70 | KEEP(*(SORT(.log_const_data*)))
71 | PROVIDE(__stop_log_const_data = .);
72 | } > FLASH
73 | .sdh_req_observers :
74 | {
75 | PROVIDE(__start_sdh_req_observers = .);
76 | KEEP(*(SORT(.sdh_req_observers*)))
77 | PROVIDE(__stop_sdh_req_observers = .);
78 | } > FLASH
79 | .sdh_state_observers :
80 | {
81 | PROVIDE(__start_sdh_state_observers = .);
82 | KEEP(*(SORT(.sdh_state_observers*)))
83 | PROVIDE(__stop_sdh_state_observers = .);
84 | } > FLASH
85 | .sdh_stack_observers :
86 | {
87 | PROVIDE(__start_sdh_stack_observers = .);
88 | KEEP(*(SORT(.sdh_stack_observers*)))
89 | PROVIDE(__stop_sdh_stack_observers = .);
90 | } > FLASH
91 | .cli_command :
92 | {
93 | PROVIDE(__start_cli_command = .);
94 | KEEP(*(.cli_command))
95 | PROVIDE(__stop_cli_command = .);
96 | } > FLASH
97 |
98 |
99 | } INSERT AFTER .text
100 |
101 | INCLUDE "nrf5x_common.ld"
102 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10056/s140/iar/ble_app_uart_iar_nRF5x.icf:
--------------------------------------------------------------------------------
1 | /*###ICF### Section handled by ICF editor, don't touch! ****/
2 | /*-Editor annotation file-*/
3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4 | /*-Specials-*/
5 | define symbol __ICFEDIT_intvec_start__ = 0x22000;
6 | /*-Memory Regions-*/
7 | define symbol __ICFEDIT_region_ROM_start__ = 0x22000;
8 | define symbol __ICFEDIT_region_ROM_end__ = 0xfffff;
9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20002a18;
10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2003ffff;
11 | export symbol __ICFEDIT_region_RAM_start__;
12 | export symbol __ICFEDIT_region_RAM_end__;
13 | /*-Sizes-*/
14 | define symbol __ICFEDIT_size_cstack__ = 0x800;
15 | define symbol __ICFEDIT_size_heap__ = 0x200;
16 | /**** End of ICF editor section. ###ICF###*/
17 |
18 | define memory mem with size = 4G;
19 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
20 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
21 |
22 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
23 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
24 |
25 | initialize by copy { readwrite };
26 | do not initialize { section .noinit };
27 |
28 | keep { section .intvec };
29 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
30 | place in ROM_region { readonly };
31 | place in RAM_region { readwrite,
32 | block CSTACK,
33 | block HEAP };
34 |
35 |
--------------------------------------------------------------------------------
/code/air_quality_monitor/pca10056/s140/ses/flash_placement.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-demo/ble_cus.h:
--------------------------------------------------------------------------------
1 | #ifndef BLE_CUS_H__
2 | #define BLE_CUS_H__
3 |
4 | #include
5 | #include
6 | #include "ble.h"
7 | #include "ble_srv_common.h"
8 |
9 | /**@brief Macro for defining a ble_hrs instance.
10 | *
11 | * @param _name Name of the instance.
12 | * @hideinitializer
13 | */
14 | #define BLE_CUS_DEF(_name) \
15 | static ble_cus_t _name; \
16 | NRF_SDH_BLE_OBSERVER(_name ## _obs, \
17 | BLE_HRS_BLE_OBSERVER_PRIO, \
18 | ble_cus_on_ble_evt, &_name)
19 |
20 |
21 |
22 | // CUSTOM_SERVICE_UUID_BASE 7289793f-57ee-475b-bf86-cf0898f095d9
23 |
24 | #define CUSTOM_SERVICE_UUID_BASE {0xD9, 0x95, 0xF0, 0x98, 0x08, 0xCF, 0x86, 0xBF, 0x5B, \
25 | 0x47, 0xEE, 0x57, 0x3F, 0x79, 0x89, 0x72}
26 |
27 | #define CUSTOM_SERVICE_UUID 0x1400
28 | #define CUSTOM_VALUE_CHAR_UUID 0x1401
29 |
30 | /**@brief Custom Service event type. */
31 | typedef enum
32 | {
33 | BLE_CUS_EVT_NOTIFICATION_ENABLED, /**< Custom value notification enabled event. */
34 | BLE_CUS_EVT_NOTIFICATION_DISABLED, /**< Custom value notification disabled event. */
35 | BLE_CUS_EVT_DISCONNECTED,
36 | BLE_CUS_EVT_CONNECTED
37 | } ble_cus_evt_type_t;
38 |
39 | /**@brief Custom Service event. */
40 | typedef struct
41 | {
42 | ble_cus_evt_type_t evt_type; /**< Type of event. */
43 | } ble_cus_evt_t;
44 |
45 | // Forward declaration of the ble_cus_t type.
46 | typedef struct ble_cus_s ble_cus_t;
47 |
48 |
49 | /**@brief Custom Service event handler type. */
50 | typedef void (*ble_cus_evt_handler_t) (ble_cus_t * p_bas, ble_cus_evt_t * p_evt);
51 |
52 | /**@brief Battery Service init structure. This contains all options and data needed for
53 | * initialization of the service.*/
54 | typedef struct
55 | {
56 | ble_cus_evt_handler_t evt_handler; /**< Event handler to be called for handling events in the Custom Service. */
57 | uint8_t initial_custom_value; /**< Initial custom value */
58 | ble_srv_cccd_security_mode_t custom_value_char_attr_md; /**< Initial security level for Custom characteristics attribute */
59 | } ble_cus_init_t;
60 |
61 | /**@brief Custom Service structure. This contains various status information for the service. */
62 | struct ble_cus_s
63 | {
64 | ble_cus_evt_handler_t evt_handler; /**< Event handler to be called for handling events in the Custom Service. */
65 | uint16_t service_handle; /**< Handle of Custom Service (as provided by the BLE stack). */
66 | ble_gatts_char_handles_t custom_value_handles; /**< Handles related to the Custom Value characteristic. */
67 | uint16_t conn_handle; /**< Handle of the current connection (as provided by the BLE stack, is BLE_CONN_HANDLE_INVALID if not in a connection). */
68 | uint8_t uuid_type;
69 | };
70 |
71 | /**@brief Function for initializing the Custom Service.
72 | *
73 | * @param[out] p_cus Custom Service structure. This structure will have to be supplied by
74 | * the application. It will be initialized by this function, and will later
75 | * be used to identify this particular service instance.
76 | * @param[in] p_cus_init Information needed to initialize the service.
77 | *
78 | * @return NRF_SUCCESS on successful initialization of service, otherwise an error code.
79 | */
80 | uint32_t ble_cus_init(ble_cus_t * p_cus, const ble_cus_init_t * p_cus_init);
81 |
82 | /**@brief Function for handling the Application's BLE Stack events.
83 | *
84 | * @details Handles all events from the BLE stack of interest to the Battery Service.
85 | *
86 | * @note
87 | *
88 | * @param[in] p_cus Custom Service structure.
89 | * @param[in] p_ble_evt Event received from the BLE stack.
90 | */
91 | void ble_cus_on_ble_evt( ble_evt_t const * p_ble_evt, void * p_context);
92 |
93 | /**@brief Function for updating the custom value.
94 | *
95 | * @details The application calls this function when the cutom value should be updated. If
96 | * notification has been enabled, the custom value characteristic is sent to the client.
97 | *
98 | * @note
99 | *
100 | * @param[in] p_bas Custom Service structure.
101 | * @param[in] Custom value
102 | *
103 | * @return NRF_SUCCESS on success, otherwise an error code.
104 | */
105 |
106 | uint32_t ble_cus_custom_value_update(ble_cus_t * p_cus, uint8_t custom_value);
107 |
108 | #endif // BLE_CUS_H__
109 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-demo/epaper_driver/epd1in54b.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @filename : epd1in54b.h
3 | * @brief : Header file for Dual-color e-paper library epd1in54b.c
4 | * @author : Yehui from Waveshare
5 | *
6 | * Copyright (C) Waveshare August 2 2017
7 | *
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy
9 | * of this software and associated documnetation files (the "Software"), to deal
10 | * in the Software without restriction, including without limitation the rights
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | * copies of the Software, and to permit persons to whom the Software is
13 | * furished to do so, subject to the following conditions:
14 | *
15 | * The above copyright notice and this permission notice shall be included in
16 | * all copies or substantial portions of the Software.
17 | *
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | * THE SOFTWARE.
25 | */
26 |
27 | #ifndef EPD1IN54B_H
28 | #define EPD1IN54B_H
29 |
30 | #include "fonts.h"
31 |
32 | // Display resolution
33 | #define EPD_WIDTH 200
34 | #define EPD_HEIGHT 200
35 |
36 | // EPD1IN54B commands
37 | #define PANEL_SETTING 0x00
38 | #define POWER_SETTING 0x01
39 | #define POWER_OFF 0x02
40 | #define POWER_OFF_SEQUENCE_SETTING 0x03
41 | #define POWER_ON 0x04
42 | #define POWER_ON_MEASURE 0x05
43 | #define BOOSTER_SOFT_START 0x06
44 | #define DEEP_SLEEP 0x07
45 | #define DATA_START_TRANSMISSION_1 0x10
46 | #define DATA_STOP 0x11
47 | #define DISPLAY_REFRESH 0x12
48 | #define DATA_START_TRANSMISSION_2 0x13
49 | #define PLL_CONTROL 0x30
50 | #define TEMPERATURE_SENSOR_COMMAND 0x40
51 | #define TEMPERATURE_SENSOR_CALIBRATION 0x41
52 | #define TEMPERATURE_SENSOR_WRITE 0x42
53 | #define TEMPERATURE_SENSOR_READ 0x43
54 | #define VCOM_AND_DATA_INTERVAL_SETTING 0x50
55 | #define LOW_POWER_DETECTION 0x51
56 | #define TCON_SETTING 0x60
57 | #define TCON_RESOLUTION 0x61
58 | #define SOURCE_AND_GATE_START_SETTING 0x62
59 | #define GET_STATUS 0x71
60 | #define AUTO_MEASURE_VCOM 0x80
61 | #define VCOM_VALUE 0x81
62 | #define VCM_DC_SETTING_REGISTER 0x82
63 | #define PROGRAM_MODE 0xA0
64 | #define ACTIVE_PROGRAM 0xA1
65 | #define READ_OTP_DATA 0xA2
66 |
67 | extern const unsigned char lut_vcom0[];
68 | extern const unsigned char lut_vcom1[];
69 | extern const unsigned char lut_w[];
70 | extern const unsigned char lut_b[];
71 | extern const unsigned char lut_g1[];
72 | extern const unsigned char lut_g2[];
73 | extern const unsigned char lut_red0[];
74 | extern const unsigned char lut_red1[];
75 |
76 | typedef struct EPD_t {
77 | int reset_pin;
78 | int dc_pin;
79 | int cs_pin;
80 | int busy_pin;
81 | int width;
82 | int height;
83 | } EPD;
84 |
85 | /* Hardware operating functions */
86 | int EPD_Init(EPD* epd);
87 | void EPD_WaitUntilIdle(EPD* epd);
88 | void EPD_DelayMs(EPD* epd, unsigned int delay_time);
89 | void EPD_Reset(EPD* epd);
90 | void EPD_SetLutBw(EPD* epd);
91 | void EPD_SetLutRed(EPD* epd);
92 | void EPD_DisplayFrame(EPD* epd, const unsigned char* frame_buffer_black, const unsigned char* frame_buffer_red);
93 | void EPD_Sleep(EPD* epd);
94 | void EPD_DigitalWrite(EPD* epd, int pin, int value);
95 | int EPD_DigitalRead(EPD* epd, int pin);
96 | void EPD_SendCommand(EPD* epd, unsigned char command);
97 | void EPD_SendData(EPD* epd, unsigned char data);
98 |
99 | #endif /* EPD1IN54B_H */
100 |
101 | /* END OF FILE */
102 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-demo/epaper_driver/epdif.c:
--------------------------------------------------------------------------------
1 | /**
2 | * @filename : epdif.c
3 | * @brief : Implements EPD interface functions
4 | * Users have to implement all the functions in epdif.cpp
5 | * @author : Yehui from Waveshare
6 | *
7 | * Copyright (C) Waveshare July 7 2017
8 | *
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy
10 | * of this software and associated documnetation files (the "Software"), to deal
11 | * in the Software without restriction, including without limitation the rights
12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | * copies of the Software, and to permit persons to whom the Software is
14 | * furished to do so, subject to the following conditions:
15 | *
16 | * The above copyright notice and this permission notice shall be included in
17 | * all copies or substantial portions of the Software.
18 | *
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | * THE SOFTWARE.
26 | */
27 |
28 | #include "nrf_delay.h"
29 | #include "nrf_gpio.h"
30 | #include "nrf_drv_spi.h"
31 |
32 | #include "nrf_log.h"
33 | #include "nrf_log_ctrl.h"
34 | #include "nrf_log_default_backends.h"
35 |
36 | #include "epdif.h"
37 |
38 | extern nrf_drv_spi_t spi;
39 |
40 |
41 | EPD_Pin epd_cs_pin = {
42 | SPI_CS_Pin,
43 | };
44 |
45 | EPD_Pin epd_rst_pin = {
46 | RST_Pin,
47 | };
48 |
49 | EPD_Pin epd_dc_pin = {
50 | DC_Pin,
51 | };
52 |
53 | EPD_Pin epd_busy_pin = {
54 | BUSY_Pin,
55 | };
56 |
57 | EPD_Pin pins[4];
58 |
59 | void EpdDigitalWriteCallback(int pin_num, int value) {
60 | if (value == HIGH) {
61 | nrf_gpio_pin_set(pins[pin_num].pin);
62 | } else {
63 | nrf_gpio_pin_clear(pins[pin_num].pin);
64 | }
65 | }
66 |
67 | int EpdDigitalReadCallback(int pin_num) {
68 | if (nrf_gpio_pin_read(pins[pin_num].pin)) {
69 | return HIGH;
70 | } else {
71 | return LOW;
72 | }
73 | }
74 |
75 | void EpdDelayMsCallback(unsigned int delaytime) {
76 | nrf_delay_ms(delaytime);
77 | }
78 |
79 | void EpdSpiTransferCallback(unsigned char data) {
80 | nrf_gpio_pin_clear(pins[CS_PIN].pin);
81 | //- HAL_SPI_Transmit(&hspi1, &data, 1, 1000);
82 | nrf_drv_spi_transfer(&spi, &data, 1, NULL, 0);
83 | nrf_gpio_pin_set(pins[CS_PIN].pin);
84 | }
85 |
86 | int EpdInitCallback(void) {
87 | pins[CS_PIN] = epd_cs_pin;
88 | pins[RST_PIN] = epd_rst_pin;
89 | pins[DC_PIN] = epd_dc_pin;
90 | pins[BUSY_PIN] = epd_busy_pin;
91 |
92 | return 0;
93 | }
94 |
95 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-demo/epaper_driver/epdif.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @filename : epdif.h
3 | * @brief : Header file of epdif.c providing EPD interface functions
4 | * Users have to implement all the functions in epdif.cpp
5 | * @author : Yehui from Waveshare
6 | *
7 | * Copyright (C) Waveshare July 7 2017
8 | *
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy
10 | * of this software and associated documnetation files (the "Software"), to deal
11 | * in the Software without restriction, including without limitation the rights
12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | * copies of the Software, and to permit persons to whom the Software is
14 | * furished to do so, subject to the following conditions:
15 | *
16 | * The above copyright notice and this permission notice shall be included in
17 | * all copies or substantial portions of the Software.
18 | *
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | * THE SOFTWARE.
26 | */
27 |
28 | #ifndef EPDIF_H
29 | #define EPDIF_H
30 |
31 | #define BUSY_Pin 2
32 | #define RST_Pin 3
33 | #define DC_Pin 4
34 | #define SPI_CS_Pin 5
35 | #define SPI_SCK_Pin 6
36 | #define SPI_MOSI_Pin 7
37 |
38 | // Pin definition
39 | #define CS_PIN 0
40 | #define RST_PIN 1
41 | #define DC_PIN 2
42 | #define BUSY_PIN 3
43 |
44 | // Pin level definition
45 | #define LOW 0
46 | #define HIGH 1
47 |
48 | typedef struct {
49 | //- GPIO_TypeDef* port;
50 | int pin;
51 | } EPD_Pin;
52 |
53 | int EpdInitCallback(void);
54 | void EpdDigitalWriteCallback(int pin, int value);
55 | int EpdDigitalReadCallback(int pin);
56 | void EpdDelayMsCallback(unsigned int delaytime);
57 | void EpdSpiTransferCallback(unsigned char data);
58 |
59 | #endif /* EPDIF_H */
60 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-demo/epaper_driver/epdpaint.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @filename : epdpaint.h
3 | * @brief : Header file for epdpaint.cpp
4 | * @author : Yehui from Waveshare
5 | *
6 | * Copyright (C) Waveshare July 28 2017
7 | *
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy
9 | * of this software and associated documnetation files (the "Software"), to deal
10 | * in the Software without restriction, including without limitation the rights
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | * copies of the Software, and to permit persons to whom the Software is
13 | * furished to do so, subject to the following conditions:
14 | *
15 | * The above copyright notice and this permission notice shall be included in
16 | * all copies or substantial portions of the Software.
17 | *
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | * THE SOFTWARE.
25 | */
26 |
27 | #ifndef EPDPAINT_H
28 | #define EPDPAINT_H
29 |
30 | // Display orientation
31 | #define ROTATE_0 0
32 | #define ROTATE_90 1
33 | #define ROTATE_180 2
34 | #define ROTATE_270 3
35 |
36 | // Color inverse. 1 or 0 = set or reset a bit if set a colored pixel
37 | #define IF_INVERT_COLOR 0
38 |
39 | #include "fonts.h"
40 |
41 | typedef struct Paint_t {
42 | unsigned char* image;
43 | int width;
44 | int height;
45 | int rotate;
46 | } Paint;
47 |
48 | void Paint_Init(Paint* paint, unsigned char* image, int width, int height);
49 | void Paint_Clear(Paint* paint, int colored);
50 | int Paint_GetWidth(Paint* paint);
51 | void Paint_SetWidth(Paint* paint, int width);
52 | int Paint_GetHeight(Paint* paint);
53 | void Paint_SetHeight(Paint* paint, int height);
54 | int Paint_GetRotate(Paint* paint);
55 | void Paint_SetRotate(Paint* paint, int rotate);
56 | unsigned char* Paint_GetImage(Paint* paint);
57 | void Paint_DrawBitmap(Paint* paint, int x, int y, const unsigned char* bitmap_buffer, int width, int height, int colored);
58 | void Paint_DrawAbsolutePixel(Paint* paint, int x, int y, int colored);
59 | void Paint_DrawPixel(Paint* paint, int x, int y, int colored);
60 | void Paint_DrawCharAt(Paint* paint, int x, int y, char ascii_char, sFONT* font, int colored);
61 | void Paint_DrawStringAt(Paint* paint, int x, int y, const char* text, sFONT* font, int colored);
62 | void Paint_DrawLine(Paint* paint, int x0, int y0, int x1, int y1, int colored);
63 | void Paint_DrawHorizontalLine(Paint* paint, int x, int y, int width, int colored);
64 | void Paint_DrawVerticalLine(Paint* paint, int x, int y, int height, int colored);
65 | void Paint_DrawRectangle(Paint* paint, int x0, int y0, int x1, int y1, int colored);
66 | void Paint_DrawFilledRectangle(Paint* paint, int x0, int y0, int x1, int y1, int colored);
67 | void Paint_DrawCircle(Paint* paint, int x, int y, int radius, int colored);
68 | void Paint_DrawFilledCircle(Paint* paint, int x, int y, int radius, int colored);
69 |
70 | #endif
71 |
72 | /* END OF FILE */
73 |
74 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-demo/epaper_driver/fonts.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file fonts.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 18-February-2014
7 | * @brief Header for fonts.c file
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * © COPYRIGHT(c) 2014 STMicroelectronics
12 | *
13 | * Redistribution and use in source and binary forms, with or without modification,
14 | * are permitted provided that the following conditions are met:
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | * 2. Redistributions in binary form must reproduce the above copyright notice,
18 | * this list of conditions and the following disclaimer in the documentation
19 | * and/or other materials provided with the distribution.
20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 | * may be used to endorse or promote products derived from this software
22 | * without specific prior written permission.
23 | *
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | *
35 | ******************************************************************************
36 | */
37 |
38 | /* Define to prevent recursive inclusion -------------------------------------*/
39 | #ifndef __FONTS_H
40 | #define __FONTS_H
41 |
42 | /* Max size of bitmap will based on a font24 (17x24) */
43 | #define MAX_HEIGHT_FONT 24
44 | #define MAX_WIDTH_FONT 17
45 | #define OFFSET_BITMAP 54
46 |
47 | #ifdef __cplusplus
48 | extern "C" {
49 | #endif
50 |
51 | /* Includes ------------------------------------------------------------------*/
52 | #include
53 |
54 | typedef struct _tFont
55 | {
56 | const uint8_t *table;
57 | uint16_t Width;
58 | uint16_t Height;
59 |
60 | } sFONT;
61 |
62 | extern sFONT Font24;
63 | extern sFONT Font20;
64 | extern sFONT Font16;
65 | extern sFONT Font12;
66 | extern sFONT Font8;
67 |
68 | #ifdef __cplusplus
69 | }
70 | #endif
71 |
72 | #endif /* __FONTS_H */
73 |
74 |
75 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
76 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-demo/epaper_driver/imagedata.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @filename : imagedata.h
3 | * @brief : head file for imagedata.c
4 | *
5 | * Copyright (C) Waveshare July 4 2017
6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy
8 | * of this software and associated documnetation files (the "Software"), to deal
9 | * in the Software without restriction, including without limitation the rights
10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | * copies of the Software, and to permit persons to whom the Software is
12 | * furished to do so, subject to the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be included in
15 | * all copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | * THE SOFTWARE.
24 | */
25 |
26 | extern const unsigned char IMAGE_BLACK[];
27 | extern const unsigned char IMAGE_RED[];
28 |
29 | /* FILE END */
30 |
31 |
32 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-demo/pca10040/s132/armgcc/ble_app_template_gcc_nrf52.ld:
--------------------------------------------------------------------------------
1 | /* Linker script to configure memory regions. */
2 |
3 | SEARCH_DIR(.)
4 | GROUP(-lgcc -lc -lnosys)
5 |
6 | MEMORY
7 | {
8 | FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
9 | RAM (rwx) : ORIGIN = 0x20002220, LENGTH = 0xdde0
10 | }
11 |
12 | SECTIONS
13 | {
14 | }
15 |
16 | SECTIONS
17 | {
18 | . = ALIGN(4);
19 | .mem_section_dummy_ram :
20 | {
21 | }
22 | .cli_sorted_cmd_ptrs :
23 | {
24 | PROVIDE(__start_cli_sorted_cmd_ptrs = .);
25 | KEEP(*(.cli_sorted_cmd_ptrs))
26 | PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
27 | } > RAM
28 | .fs_data :
29 | {
30 | PROVIDE(__start_fs_data = .);
31 | KEEP(*(.fs_data))
32 | PROVIDE(__stop_fs_data = .);
33 | } > RAM
34 | .log_dynamic_data :
35 | {
36 | PROVIDE(__start_log_dynamic_data = .);
37 | KEEP(*(SORT(.log_dynamic_data*)))
38 | PROVIDE(__stop_log_dynamic_data = .);
39 | } > RAM
40 | .log_filter_data :
41 | {
42 | PROVIDE(__start_log_filter_data = .);
43 | KEEP(*(SORT(.log_filter_data*)))
44 | PROVIDE(__stop_log_filter_data = .);
45 | } > RAM
46 |
47 | } INSERT AFTER .data;
48 |
49 | SECTIONS
50 | {
51 | .mem_section_dummy_rom :
52 | {
53 | }
54 | .sdh_soc_observers :
55 | {
56 | PROVIDE(__start_sdh_soc_observers = .);
57 | KEEP(*(SORT(.sdh_soc_observers*)))
58 | PROVIDE(__stop_sdh_soc_observers = .);
59 | } > FLASH
60 | .pwr_mgmt_data :
61 | {
62 | PROVIDE(__start_pwr_mgmt_data = .);
63 | KEEP(*(SORT(.pwr_mgmt_data*)))
64 | PROVIDE(__stop_pwr_mgmt_data = .);
65 | } > FLASH
66 | .sdh_ble_observers :
67 | {
68 | PROVIDE(__start_sdh_ble_observers = .);
69 | KEEP(*(SORT(.sdh_ble_observers*)))
70 | PROVIDE(__stop_sdh_ble_observers = .);
71 | } > FLASH
72 | .sdh_stack_observers :
73 | {
74 | PROVIDE(__start_sdh_stack_observers = .);
75 | KEEP(*(SORT(.sdh_stack_observers*)))
76 | PROVIDE(__stop_sdh_stack_observers = .);
77 | } > FLASH
78 | .sdh_req_observers :
79 | {
80 | PROVIDE(__start_sdh_req_observers = .);
81 | KEEP(*(SORT(.sdh_req_observers*)))
82 | PROVIDE(__stop_sdh_req_observers = .);
83 | } > FLASH
84 | .sdh_state_observers :
85 | {
86 | PROVIDE(__start_sdh_state_observers = .);
87 | KEEP(*(SORT(.sdh_state_observers*)))
88 | PROVIDE(__stop_sdh_state_observers = .);
89 | } > FLASH
90 | .nrf_queue :
91 | {
92 | PROVIDE(__start_nrf_queue = .);
93 | KEEP(*(.nrf_queue))
94 | PROVIDE(__stop_nrf_queue = .);
95 | } > FLASH
96 | .nrf_balloc :
97 | {
98 | PROVIDE(__start_nrf_balloc = .);
99 | KEEP(*(.nrf_balloc))
100 | PROVIDE(__stop_nrf_balloc = .);
101 | } > FLASH
102 | .cli_command :
103 | {
104 | PROVIDE(__start_cli_command = .);
105 | KEEP(*(.cli_command))
106 | PROVIDE(__stop_cli_command = .);
107 | } > FLASH
108 | .crypto_data :
109 | {
110 | PROVIDE(__start_crypto_data = .);
111 | KEEP(*(SORT(.crypto_data*)))
112 | PROVIDE(__stop_crypto_data = .);
113 | } > FLASH
114 | .log_const_data :
115 | {
116 | PROVIDE(__start_log_const_data = .);
117 | KEEP(*(SORT(.log_const_data*)))
118 | PROVIDE(__stop_log_const_data = .);
119 | } > FLASH
120 | .log_backends :
121 | {
122 | PROVIDE(__start_log_backends = .);
123 | KEEP(*(SORT(.log_backends*)))
124 | PROVIDE(__stop_log_backends = .);
125 | } > FLASH
126 |
127 | } INSERT AFTER .text
128 |
129 | INCLUDE "nrf_common.ld"
130 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-demo/pca10056/s140/armgcc/ble_app_template_gcc_nrf52.ld:
--------------------------------------------------------------------------------
1 | /* Linker script to configure memory regions. */
2 |
3 | SEARCH_DIR(.)
4 | GROUP(-lgcc -lc -lnosys)
5 |
6 | MEMORY
7 | {
8 | FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
9 | RAM (rwx) : ORIGIN = 0x20002220, LENGTH = 0xdde0
10 | }
11 |
12 | SECTIONS
13 | {
14 | }
15 |
16 | SECTIONS
17 | {
18 | . = ALIGN(4);
19 | .mem_section_dummy_ram :
20 | {
21 | }
22 | .cli_sorted_cmd_ptrs :
23 | {
24 | PROVIDE(__start_cli_sorted_cmd_ptrs = .);
25 | KEEP(*(.cli_sorted_cmd_ptrs))
26 | PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
27 | } > RAM
28 | .fs_data :
29 | {
30 | PROVIDE(__start_fs_data = .);
31 | KEEP(*(.fs_data))
32 | PROVIDE(__stop_fs_data = .);
33 | } > RAM
34 | .log_dynamic_data :
35 | {
36 | PROVIDE(__start_log_dynamic_data = .);
37 | KEEP(*(SORT(.log_dynamic_data*)))
38 | PROVIDE(__stop_log_dynamic_data = .);
39 | } > RAM
40 | .log_filter_data :
41 | {
42 | PROVIDE(__start_log_filter_data = .);
43 | KEEP(*(SORT(.log_filter_data*)))
44 | PROVIDE(__stop_log_filter_data = .);
45 | } > RAM
46 |
47 | } INSERT AFTER .data;
48 |
49 | SECTIONS
50 | {
51 | .mem_section_dummy_rom :
52 | {
53 | }
54 | .sdh_soc_observers :
55 | {
56 | PROVIDE(__start_sdh_soc_observers = .);
57 | KEEP(*(SORT(.sdh_soc_observers*)))
58 | PROVIDE(__stop_sdh_soc_observers = .);
59 | } > FLASH
60 | .pwr_mgmt_data :
61 | {
62 | PROVIDE(__start_pwr_mgmt_data = .);
63 | KEEP(*(SORT(.pwr_mgmt_data*)))
64 | PROVIDE(__stop_pwr_mgmt_data = .);
65 | } > FLASH
66 | .sdh_ble_observers :
67 | {
68 | PROVIDE(__start_sdh_ble_observers = .);
69 | KEEP(*(SORT(.sdh_ble_observers*)))
70 | PROVIDE(__stop_sdh_ble_observers = .);
71 | } > FLASH
72 | .sdh_stack_observers :
73 | {
74 | PROVIDE(__start_sdh_stack_observers = .);
75 | KEEP(*(SORT(.sdh_stack_observers*)))
76 | PROVIDE(__stop_sdh_stack_observers = .);
77 | } > FLASH
78 | .sdh_req_observers :
79 | {
80 | PROVIDE(__start_sdh_req_observers = .);
81 | KEEP(*(SORT(.sdh_req_observers*)))
82 | PROVIDE(__stop_sdh_req_observers = .);
83 | } > FLASH
84 | .sdh_state_observers :
85 | {
86 | PROVIDE(__start_sdh_state_observers = .);
87 | KEEP(*(SORT(.sdh_state_observers*)))
88 | PROVIDE(__stop_sdh_state_observers = .);
89 | } > FLASH
90 | .nrf_queue :
91 | {
92 | PROVIDE(__start_nrf_queue = .);
93 | KEEP(*(.nrf_queue))
94 | PROVIDE(__stop_nrf_queue = .);
95 | } > FLASH
96 | .nrf_balloc :
97 | {
98 | PROVIDE(__start_nrf_balloc = .);
99 | KEEP(*(.nrf_balloc))
100 | PROVIDE(__stop_nrf_balloc = .);
101 | } > FLASH
102 | .cli_command :
103 | {
104 | PROVIDE(__start_cli_command = .);
105 | KEEP(*(.cli_command))
106 | PROVIDE(__stop_cli_command = .);
107 | } > FLASH
108 | .crypto_data :
109 | {
110 | PROVIDE(__start_crypto_data = .);
111 | KEEP(*(SORT(.crypto_data*)))
112 | PROVIDE(__stop_crypto_data = .);
113 | } > FLASH
114 | .log_const_data :
115 | {
116 | PROVIDE(__start_log_const_data = .);
117 | KEEP(*(SORT(.log_const_data*)))
118 | PROVIDE(__stop_log_const_data = .);
119 | } > FLASH
120 | .log_backends :
121 | {
122 | PROVIDE(__start_log_backends = .);
123 | KEEP(*(SORT(.log_backends*)))
124 | PROVIDE(__stop_log_backends = .);
125 | } > FLASH
126 |
127 | } INSERT AFTER .text
128 |
129 | INCLUDE "nrf_common.ld"
130 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/ble_cus.h:
--------------------------------------------------------------------------------
1 | #ifndef BLE_CUS_H__
2 | #define BLE_CUS_H__
3 |
4 | #include
5 | #include
6 | #include "ble.h"
7 | #include "ble_srv_common.h"
8 |
9 | /**@brief Macro for defining a ble_hrs instance.
10 | *
11 | * @param _name Name of the instance.
12 | * @hideinitializer
13 | */
14 | #define BLE_CUS_DEF(_name) \
15 | static ble_cus_t _name; \
16 | NRF_SDH_BLE_OBSERVER(_name ## _obs, \
17 | BLE_HRS_BLE_OBSERVER_PRIO, \
18 | ble_cus_on_ble_evt, &_name)
19 |
20 |
21 |
22 | // CUSTOM_SERVICE_UUID_BASE 7289793f-57ee-475b-bf86-cf0898f095d9
23 |
24 | #define CUSTOM_SERVICE_UUID_BASE {0xD9, 0x95, 0xF0, 0x98, 0x08, 0xCF, 0x86, 0xBF, 0x5B, \
25 | 0x47, 0xEE, 0x57, 0x3F, 0x79, 0x89, 0x72}
26 |
27 | #define CUSTOM_SERVICE_UUID 0x1400
28 |
29 | #define NO_OF_CHARACTERISTCS 1
30 | #define EPAPER_CHARACTERISTC_UUID 0x1401
31 | #define EPAPER_CHARACTERISTC_VALUE_LENGTH 18
32 |
33 | /**@brief Custom Service event type. */
34 | typedef enum
35 | {
36 | BLE_CUS_EVT_NOTIFICATION_ENABLED, /**< Custom value notification enabled event. */
37 | BLE_CUS_EVT_NOTIFICATION_DISABLED, /**< Custom value notification disabled event. */
38 | BLE_CUS_EVT_DISCONNECTED,
39 | BLE_CUS_EVT_CONNECTED
40 | } ble_cus_evt_type_t;
41 |
42 | /**@brief Custom Service event. */
43 | typedef struct
44 | {
45 | ble_cus_evt_type_t evt_type; /**< Type of event. */
46 | } ble_cus_evt_t;
47 |
48 | // Forward declaration of the ble_cus_t type.
49 | typedef struct ble_cus_s ble_cus_t;
50 |
51 |
52 | /**@brief Custom Service event handler type. */
53 | typedef void (*ble_cus_evt_handler_t) (ble_cus_t * p_bas, ble_cus_evt_t * p_evt);
54 |
55 | /**@brief Battery Service init structure. This contains all options and data needed for
56 | * initialization of the service.*/
57 | typedef struct
58 | {
59 | ble_cus_evt_handler_t evt_handler; /**< Event handler to be called for handling events in the Custom Service. */
60 | uint8_t initial_custom_value; /**< Initial custom value */
61 | ble_srv_cccd_security_mode_t custom_value_char_attr_md; /**< Initial security level for Custom characteristics attribute */
62 | } ble_cus_init_t;
63 |
64 | /**@brief Custom Service structure. This contains various status information for the service. */
65 | struct ble_cus_s
66 | {
67 | ble_cus_evt_handler_t evt_handler; /**< Event handler to be called for handling events in the Custom Service. */
68 | uint16_t service_handle; /**< Handle of Custom Service (as provided by the BLE stack). */
69 | ble_gatts_char_handles_t custom_value_handles[NO_OF_CHARACTERISTCS]; /**< Handles related to the Custom Value characteristic. */
70 | uint16_t conn_handle; /**< Handle of the current connection (as provided by the BLE stack, is BLE_CONN_HANDLE_INVALID if not in a connection). */
71 | uint8_t uuid_type;
72 | };
73 |
74 | /**@brief Function for initializing the Custom Service.
75 | *
76 | * @param[out] p_cus Custom Service structure. This structure will have to be supplied by
77 | * the application. It will be initialized by this function, and will later
78 | * be used to identify this particular service instance.
79 | * @param[in] p_cus_init Information needed to initialize the service.
80 | *
81 | * @return NRF_SUCCESS on successful initialization of service, otherwise an error code.
82 | */
83 | uint32_t ble_cus_init(ble_cus_t * p_cus, const ble_cus_init_t * p_cus_init);
84 |
85 | /**@brief Function for handling the Application's BLE Stack events.
86 | *
87 | * @details Handles all events from the BLE stack of interest to the Battery Service.
88 | *
89 | * @note
90 | *
91 | * @param[in] p_cus Custom Service structure.
92 | * @param[in] p_ble_evt Event received from the BLE stack.
93 | */
94 | void ble_cus_on_ble_evt( ble_evt_t const * p_ble_evt, void * p_context);
95 |
96 | /**@brief Function for updating the custom value.
97 | *
98 | * @details The application calls this function when the cutom value should be updated. If
99 | * notification has been enabled, the custom value characteristic is sent to the client.
100 | *
101 | * @note
102 | *
103 | * @param[in] p_bas Custom Service structure.
104 | * @param[in] Custom value
105 | *
106 | * @return NRF_SUCCESS on success, otherwise an error code.
107 | */
108 |
109 | uint32_t ble_cus_custom_value_update(ble_cus_t * p_cus, uint8_t charac_no, uint8_t *charac_value, uint16_t * charac_len);
110 |
111 | #endif // BLE_CUS_H__
112 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/epaper.c:
--------------------------------------------------------------------------------
1 | /** @file epaper.c
2 | *
3 | * @brief E-paper functions abstraction
4 | *
5 | * @par
6 | * COPYRIGHT NOTICE: (c) 2018 Electronut Labs.
7 | * All rights reserved.
8 | */
9 |
10 | #include "epaper.h"
11 |
12 | #include "epd1in54b.h"
13 | #include "epdif.h"
14 | #include "epdpaint.h"
15 | #include "image.h"
16 | #include "fonts.h"
17 |
18 | EPD epd;
19 |
20 | unsigned char frame_buffer_black_arr[EPD_WIDTH * EPD_HEIGHT / 8];
21 | unsigned char *frame_buffer_black = frame_buffer_black_arr;
22 | unsigned char frame_buffer_red_arr[EPD_WIDTH * EPD_HEIGHT / 8];
23 | unsigned char *frame_buffer_red = frame_buffer_red_arr;
24 |
25 | Paint paint_black;
26 | Paint paint_red;
27 |
28 | int epaper_init()
29 | {
30 | epaper_GPIO_Init();
31 | spi_epd_init();
32 |
33 | return EPD_Init(&epd);
34 | }
35 |
36 | // Display default image
37 | void epaper_default_image()
38 | {
39 | Paint_Init(&paint_black, frame_buffer_black, epd.width, epd.height);
40 | Paint_Init(&paint_red, frame_buffer_red, epd.width, epd.height);
41 | Paint_Clear(&paint_black, UNCOLORED);
42 | Paint_Clear(&paint_red, UNCOLORED);
43 |
44 | Paint_SetRotate(&paint_red, 3);
45 | Paint_DrawStringAt(&paint_red, 40, 40, "hackBLE", &Font24, COLORED);
46 | Paint_DrawBitmap(&paint_black, 100, 0, bwData, image_width, image_height, COLORED);
47 |
48 | EPD_DisplayFrame(&epd, frame_buffer_black, frame_buffer_red);
49 | }
50 |
51 | void epaper_clear()
52 | {
53 | Paint_Init(&paint_black, frame_buffer_black, epd.width, epd.height);
54 | Paint_Init(&paint_red, frame_buffer_red, epd.width, epd.height);
55 | Paint_Clear(&paint_black, UNCOLORED);
56 | Paint_Clear(&paint_red, UNCOLORED);
57 |
58 | EPD_DisplayFrame(&epd, frame_buffer_black, frame_buffer_red);
59 | }
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/epaper.h:
--------------------------------------------------------------------------------
1 | /** @file epaper.h
2 | *
3 | * @brief E-paper functions abstraction
4 | *
5 | * @par
6 | * COPYRIGHT NOTICE: (c) 2018 Electronut Labs.
7 | * All rights reserved.
8 | */
9 |
10 | #ifndef _ADM_EPAPER_H
11 | #define _ADM_EPAPER_H
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | #include "epd1in54b.h"
18 | #include "epdpaint.h"
19 |
20 | extern EPD epd;
21 | extern unsigned char *frame_buffer_black;
22 | extern unsigned char *frame_buffer_red;
23 | extern Paint paint_black;
24 | extern Paint paint_red;
25 |
26 | /**
27 | * @brief Initialize epaper display
28 | *
29 | * @return int
30 | */
31 | int epaper_init();
32 |
33 | /**
34 | * @brief clear epaper display
35 | *
36 | */
37 | void epaper_clear();
38 |
39 | /**
40 | * @brief display default image
41 | *
42 | */
43 | void epaper_default_image();
44 |
45 | #ifdef __cplusplus
46 | }
47 | #endif
48 |
49 | #endif
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/epaper_driver/epd1in54b.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @filename : epd1in54b.h
3 | * @brief : Header file for Dual-color e-paper library epd1in54b.c
4 | * @author : Yehui from Waveshare
5 | *
6 | * Copyright (C) Waveshare August 2 2017
7 | *
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy
9 | * of this software and associated documnetation files (the "Software"), to deal
10 | * in the Software without restriction, including without limitation the rights
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | * copies of the Software, and to permit persons to whom the Software is
13 | * furished to do so, subject to the following conditions:
14 | *
15 | * The above copyright notice and this permission notice shall be included in
16 | * all copies or substantial portions of the Software.
17 | *
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | * THE SOFTWARE.
25 | */
26 |
27 | #ifndef EPD1IN54B_H
28 | #define EPD1IN54B_H
29 |
30 | #include "fonts.h"
31 |
32 | // Display resolution
33 | #define EPD_WIDTH 200
34 | #define EPD_HEIGHT 200
35 |
36 | // EPD1IN54B commands
37 | #define PANEL_SETTING 0x00
38 | #define POWER_SETTING 0x01
39 | #define POWER_OFF 0x02
40 | #define POWER_OFF_SEQUENCE_SETTING 0x03
41 | #define POWER_ON 0x04
42 | #define POWER_ON_MEASURE 0x05
43 | #define BOOSTER_SOFT_START 0x06
44 | #define DEEP_SLEEP 0x07
45 | #define DATA_START_TRANSMISSION_1 0x10
46 | #define DATA_STOP 0x11
47 | #define DISPLAY_REFRESH 0x12
48 | #define DATA_START_TRANSMISSION_2 0x13
49 | #define PLL_CONTROL 0x30
50 | #define TEMPERATURE_SENSOR_COMMAND 0x40
51 | #define TEMPERATURE_SENSOR_CALIBRATION 0x41
52 | #define TEMPERATURE_SENSOR_WRITE 0x42
53 | #define TEMPERATURE_SENSOR_READ 0x43
54 | #define VCOM_AND_DATA_INTERVAL_SETTING 0x50
55 | #define LOW_POWER_DETECTION 0x51
56 | #define TCON_SETTING 0x60
57 | #define TCON_RESOLUTION 0x61
58 | #define SOURCE_AND_GATE_START_SETTING 0x62
59 | #define GET_STATUS 0x71
60 | #define AUTO_MEASURE_VCOM 0x80
61 | #define VCOM_VALUE 0x81
62 | #define VCM_DC_SETTING_REGISTER 0x82
63 | #define PROGRAM_MODE 0xA0
64 | #define ACTIVE_PROGRAM 0xA1
65 | #define READ_OTP_DATA 0xA2
66 |
67 | extern const unsigned char lut_vcom0[];
68 | extern const unsigned char lut_vcom1[];
69 | extern const unsigned char lut_w[];
70 | extern const unsigned char lut_b[];
71 | extern const unsigned char lut_g1[];
72 | extern const unsigned char lut_g2[];
73 | extern const unsigned char lut_red0[];
74 | extern const unsigned char lut_red1[];
75 |
76 | typedef struct EPD_t {
77 | int reset_pin;
78 | int dc_pin;
79 | int cs_pin;
80 | int busy_pin;
81 | int width;
82 | int height;
83 | } EPD;
84 |
85 | /* Hardware operating functions */
86 | int EPD_Init(EPD* epd);
87 | void EPD_WaitUntilIdle(EPD* epd);
88 | void EPD_DelayMs(EPD* epd, unsigned int delay_time);
89 | void EPD_Reset(EPD* epd);
90 | void EPD_SetLutBw(EPD* epd);
91 | void EPD_SetLutRed(EPD* epd);
92 | void EPD_DisplayFrame(EPD* epd, const unsigned char* frame_buffer_black, const unsigned char* frame_buffer_red);
93 | void EPD_Sleep(EPD* epd);
94 | void EPD_DigitalWrite(EPD* epd, int pin, int value);
95 | int EPD_DigitalRead(EPD* epd, int pin);
96 | void EPD_SendCommand(EPD* epd, unsigned char command);
97 | void EPD_SendData(EPD* epd, unsigned char data);
98 |
99 | #endif /* EPD1IN54B_H */
100 |
101 | /* END OF FILE */
102 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/epaper_driver/epdif.c:
--------------------------------------------------------------------------------
1 | /** @file epdif.c
2 | *
3 | * @brief Implements EPD interface functions
4 | *
5 | * @par
6 | * COPYRIGHT NOTICE: (c) 2018 Electronut Labs.
7 | * All rights reserved.
8 | */
9 |
10 | #include "nrf_log.h"
11 | #include "nrf_log_ctrl.h"
12 | #include "nrf_log_default_backends.h"
13 |
14 | #include "epdif.h"
15 |
16 | EPD_Pin epd_cs_pin = {
17 | EPD_SPI_CS_PIN,
18 | };
19 |
20 | EPD_Pin epd_rst_pin = {
21 | EPD_RST_PIN,
22 | };
23 |
24 | EPD_Pin epd_dc_pin = {
25 | EPD_DC_PIN,
26 | };
27 |
28 | EPD_Pin epd_busy_pin = {
29 | EPD_BUSY_PIN,
30 | };
31 |
32 | EPD_Pin pins[4];
33 |
34 | void epaper_GPIO_Init(void)
35 | {
36 | nrf_gpio_pin_clear(EPD_DC_PIN);
37 | nrf_gpio_pin_clear(EPD_RST_PIN);
38 | nrf_gpio_pin_clear(EPD_SPI_CS_PIN);
39 |
40 | nrf_gpio_cfg_output(EPD_DC_PIN);
41 | nrf_gpio_cfg_output(EPD_RST_PIN);
42 | nrf_gpio_cfg_output(EPD_SPI_CS_PIN);
43 | nrf_gpio_cfg_input(EPD_BUSY_PIN, NRF_GPIO_PIN_NOPULL);
44 | }
45 |
46 | #define SPI_INSTANCE 1 /**< SPI instance index. */
47 | const nrf_drv_spi_t spi_epd = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */
48 |
49 | void spi_epd_init()
50 | {
51 | nrf_drv_spi_config_t spi_config_epd = NRF_DRV_SPI_DEFAULT_CONFIG;
52 | spi_config_epd.frequency = NRF_DRV_SPI_FREQ_1M;
53 | spi_config_epd.mode = NRF_DRV_SPI_MODE_0;
54 | spi_config_epd.bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;
55 | spi_config_epd.miso_pin = NRF_DRV_SPI_PIN_NOT_USED;
56 | spi_config_epd.mosi_pin = EPD_SPI_MOSI_PIN;
57 | spi_config_epd.sck_pin = EPD_SPI_SCK_PIN;
58 | spi_config_epd.ss_pin = EPD_SPI_CS_PIN;
59 |
60 | APP_ERROR_CHECK(nrf_drv_spi_init(&spi_epd, &spi_config_epd, NULL, NULL));
61 | }
62 |
63 | void EpdDigitalWriteCallback(int pin_num, int value) {
64 | if (value == HIGH) {
65 | nrf_gpio_pin_set(pins[pin_num].pin);
66 | } else {
67 | nrf_gpio_pin_clear(pins[pin_num].pin);
68 | }
69 | }
70 |
71 | int EpdDigitalReadCallback(int pin_num) {
72 | if (nrf_gpio_pin_read(pins[pin_num].pin)) {
73 | return HIGH;
74 | } else {
75 | return LOW;
76 | }
77 | }
78 |
79 | void EpdDelayMsCallback(unsigned int delaytime) {
80 | nrf_delay_ms(delaytime);
81 | }
82 |
83 | void EpdSpiTransferCallback(unsigned char data)
84 | {
85 | nrf_gpio_pin_clear(pins[CS_PIN].pin);
86 | nrf_drv_spi_transfer(&spi_epd, &data, 1, NULL, 0);
87 | nrf_gpio_pin_set(pins[CS_PIN].pin);
88 | }
89 |
90 | int EpdInitCallback(void) {
91 | pins[CS_PIN] = epd_cs_pin;
92 | pins[RST_PIN] = epd_rst_pin;
93 | pins[DC_PIN] = epd_dc_pin;
94 | pins[BUSY_PIN] = epd_busy_pin;
95 |
96 | return 0;
97 | }
98 |
99 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/epaper_driver/epdif.h:
--------------------------------------------------------------------------------
1 | /** @file epdif.h
2 | *
3 | * @brief Header file of epdif.c providing EPD interface functions
4 | *
5 | * @par
6 | * COPYRIGHT NOTICE: (c) 2018 Electronut Labs.
7 | * All rights reserved.
8 | */
9 |
10 | #ifndef EPDIF_H
11 | #define EPDIF_H
12 |
13 | #include "nrf_delay.h"
14 | #include "nrf_gpio.h"
15 | #include "nrf_drv_spi.h"
16 |
17 | #define EPD_BUSY_PIN 2
18 | #define EPD_RST_PIN 3
19 | #define EPD_DC_PIN 4
20 | #define EPD_SPI_CS_PIN 5
21 | #define EPD_SPI_SCK_PIN 7
22 | #define EPD_SPI_MOSI_PIN 8
23 |
24 | // Pin definition
25 | #define CS_PIN 0
26 | #define RST_PIN 1
27 | #define DC_PIN 2
28 | #define BUSY_PIN 3
29 |
30 | // Pin level definition
31 | #define LOW 0
32 | #define HIGH 1
33 |
34 | typedef struct {
35 | int pin;
36 | } EPD_Pin;
37 |
38 | void epaper_GPIO_Init(void);
39 | void spi_epd_init();
40 |
41 | int EpdInitCallback(void);
42 | void EpdDigitalWriteCallback(int pin, int value);
43 | int EpdDigitalReadCallback(int pin);
44 | void EpdDelayMsCallback(unsigned int delaytime);
45 | void EpdSpiTransferCallback(unsigned char data);
46 |
47 | #endif /* EPDIF_H */
48 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/epaper_driver/epdpaint.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @filename : epdpaint.h
3 | * @brief : Header file for epdpaint.cpp
4 | * @author : Yehui from Waveshare
5 | *
6 | * Copyright (C) Waveshare July 28 2017
7 | *
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy
9 | * of this software and associated documnetation files (the "Software"), to deal
10 | * in the Software without restriction, including without limitation the rights
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | * copies of the Software, and to permit persons to whom the Software is
13 | * furished to do so, subject to the following conditions:
14 | *
15 | * The above copyright notice and this permission notice shall be included in
16 | * all copies or substantial portions of the Software.
17 | *
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | * THE SOFTWARE.
25 | */
26 |
27 | #ifndef EPDPAINT_H
28 | #define EPDPAINT_H
29 |
30 | // Display orientation
31 | #define ROTATE_0 0
32 | #define ROTATE_90 1
33 | #define ROTATE_180 2
34 | #define ROTATE_270 3
35 |
36 | // Color inverse. 1 or 0 = set or reset a bit if set a colored pixel
37 | #define IF_INVERT_COLOR 0
38 |
39 | #define COLORED 1
40 | #define UNCOLORED 0
41 |
42 | #include "fonts.h"
43 |
44 | typedef struct Paint_t {
45 | unsigned char* image;
46 | int width;
47 | int height;
48 | int rotate;
49 | } Paint;
50 |
51 | void Paint_Init(Paint* paint, unsigned char* image, int width, int height);
52 | void Paint_Clear(Paint* paint, int colored);
53 | int Paint_GetWidth(Paint* paint);
54 | void Paint_SetWidth(Paint* paint, int width);
55 | int Paint_GetHeight(Paint* paint);
56 | void Paint_SetHeight(Paint* paint, int height);
57 | int Paint_GetRotate(Paint* paint);
58 | void Paint_SetRotate(Paint* paint, int rotate);
59 | unsigned char* Paint_GetImage(Paint* paint);
60 | void Paint_DrawBitmap(Paint* paint, int x, int y, const unsigned char* bitmap_buffer, int width, int height, int colored);
61 | void Paint_DrawAbsolutePixel(Paint* paint, int x, int y, int colored);
62 | void Paint_DrawPixel(Paint* paint, int x, int y, int colored);
63 | void Paint_DrawCharAt(Paint* paint, int x, int y, char ascii_char, sFONT* font, int colored);
64 | void Paint_DrawStringAt(Paint* paint, int x, int y, const char* text, sFONT* font, int colored);
65 | void Paint_DrawLine(Paint* paint, int x0, int y0, int x1, int y1, int colored);
66 | void Paint_DrawHorizontalLine(Paint* paint, int x, int y, int width, int colored);
67 | void Paint_DrawVerticalLine(Paint* paint, int x, int y, int height, int colored);
68 | void Paint_DrawRectangle(Paint* paint, int x0, int y0, int x1, int y1, int colored);
69 | void Paint_DrawFilledRectangle(Paint* paint, int x0, int y0, int x1, int y1, int colored);
70 | void Paint_DrawCircle(Paint* paint, int x, int y, int radius, int colored);
71 | void Paint_DrawFilledCircle(Paint* paint, int x, int y, int radius, int colored);
72 |
73 | #endif
74 |
75 | /* END OF FILE */
76 |
77 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/epaper_driver/fonts/fonts.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file fonts.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 18-February-2014
7 | * @brief Header for fonts.c file
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * © COPYRIGHT(c) 2014 STMicroelectronics
12 | *
13 | * Redistribution and use in source and binary forms, with or without modification,
14 | * are permitted provided that the following conditions are met:
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | * 2. Redistributions in binary form must reproduce the above copyright notice,
18 | * this list of conditions and the following disclaimer in the documentation
19 | * and/or other materials provided with the distribution.
20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 | * may be used to endorse or promote products derived from this software
22 | * without specific prior written permission.
23 | *
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | *
35 | ******************************************************************************
36 | */
37 |
38 | /* Define to prevent recursive inclusion -------------------------------------*/
39 | #ifndef __FONTS_H
40 | #define __FONTS_H
41 |
42 | /* Max size of bitmap will based on a font24 (17x24) */
43 | #define MAX_HEIGHT_FONT 24
44 | #define MAX_WIDTH_FONT 17
45 | #define OFFSET_BITMAP 54
46 |
47 | #ifdef __cplusplus
48 | extern "C" {
49 | #endif
50 |
51 | /* Includes ------------------------------------------------------------------*/
52 | #include
53 |
54 | typedef struct _tFont
55 | {
56 | const uint8_t *table;
57 | uint16_t Width;
58 | uint16_t Height;
59 |
60 | } sFONT;
61 |
62 | extern sFONT Font24;
63 | extern sFONT Font20;
64 | extern sFONT Font16;
65 | extern sFONT Font12;
66 | extern sFONT Font8;
67 |
68 | #ifdef __cplusplus
69 | }
70 | #endif
71 |
72 | #endif /* __FONTS_H */
73 |
74 |
75 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
76 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/pca10040/s132/armgcc/ble_app_template_gcc_nrf52.ld:
--------------------------------------------------------------------------------
1 | /* Linker script to configure memory regions. */
2 |
3 | SEARCH_DIR(.)
4 | GROUP(-lgcc -lc -lnosys)
5 |
6 | MEMORY
7 | {
8 | FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
9 | RAM (rwx) : ORIGIN = 0x20002220, LENGTH = 0xdde0
10 | }
11 |
12 | SECTIONS
13 | {
14 | }
15 |
16 | SECTIONS
17 | {
18 | . = ALIGN(4);
19 | .mem_section_dummy_ram :
20 | {
21 | }
22 | .cli_sorted_cmd_ptrs :
23 | {
24 | PROVIDE(__start_cli_sorted_cmd_ptrs = .);
25 | KEEP(*(.cli_sorted_cmd_ptrs))
26 | PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
27 | } > RAM
28 | .fs_data :
29 | {
30 | PROVIDE(__start_fs_data = .);
31 | KEEP(*(.fs_data))
32 | PROVIDE(__stop_fs_data = .);
33 | } > RAM
34 | .log_dynamic_data :
35 | {
36 | PROVIDE(__start_log_dynamic_data = .);
37 | KEEP(*(SORT(.log_dynamic_data*)))
38 | PROVIDE(__stop_log_dynamic_data = .);
39 | } > RAM
40 | .log_filter_data :
41 | {
42 | PROVIDE(__start_log_filter_data = .);
43 | KEEP(*(SORT(.log_filter_data*)))
44 | PROVIDE(__stop_log_filter_data = .);
45 | } > RAM
46 |
47 | } INSERT AFTER .data;
48 |
49 | SECTIONS
50 | {
51 | .mem_section_dummy_rom :
52 | {
53 | }
54 | .sdh_soc_observers :
55 | {
56 | PROVIDE(__start_sdh_soc_observers = .);
57 | KEEP(*(SORT(.sdh_soc_observers*)))
58 | PROVIDE(__stop_sdh_soc_observers = .);
59 | } > FLASH
60 | .pwr_mgmt_data :
61 | {
62 | PROVIDE(__start_pwr_mgmt_data = .);
63 | KEEP(*(SORT(.pwr_mgmt_data*)))
64 | PROVIDE(__stop_pwr_mgmt_data = .);
65 | } > FLASH
66 | .sdh_ble_observers :
67 | {
68 | PROVIDE(__start_sdh_ble_observers = .);
69 | KEEP(*(SORT(.sdh_ble_observers*)))
70 | PROVIDE(__stop_sdh_ble_observers = .);
71 | } > FLASH
72 | .sdh_stack_observers :
73 | {
74 | PROVIDE(__start_sdh_stack_observers = .);
75 | KEEP(*(SORT(.sdh_stack_observers*)))
76 | PROVIDE(__stop_sdh_stack_observers = .);
77 | } > FLASH
78 | .sdh_req_observers :
79 | {
80 | PROVIDE(__start_sdh_req_observers = .);
81 | KEEP(*(SORT(.sdh_req_observers*)))
82 | PROVIDE(__stop_sdh_req_observers = .);
83 | } > FLASH
84 | .sdh_state_observers :
85 | {
86 | PROVIDE(__start_sdh_state_observers = .);
87 | KEEP(*(SORT(.sdh_state_observers*)))
88 | PROVIDE(__stop_sdh_state_observers = .);
89 | } > FLASH
90 | .nrf_queue :
91 | {
92 | PROVIDE(__start_nrf_queue = .);
93 | KEEP(*(.nrf_queue))
94 | PROVIDE(__stop_nrf_queue = .);
95 | } > FLASH
96 | .nrf_balloc :
97 | {
98 | PROVIDE(__start_nrf_balloc = .);
99 | KEEP(*(.nrf_balloc))
100 | PROVIDE(__stop_nrf_balloc = .);
101 | } > FLASH
102 | .cli_command :
103 | {
104 | PROVIDE(__start_cli_command = .);
105 | KEEP(*(.cli_command))
106 | PROVIDE(__stop_cli_command = .);
107 | } > FLASH
108 | .crypto_data :
109 | {
110 | PROVIDE(__start_crypto_data = .);
111 | KEEP(*(SORT(.crypto_data*)))
112 | PROVIDE(__stop_crypto_data = .);
113 | } > FLASH
114 | .log_const_data :
115 | {
116 | PROVIDE(__start_log_const_data = .);
117 | KEEP(*(SORT(.log_const_data*)))
118 | PROVIDE(__stop_log_const_data = .);
119 | } > FLASH
120 | .log_backends :
121 | {
122 | PROVIDE(__start_log_backends = .);
123 | KEEP(*(SORT(.log_backends*)))
124 | PROVIDE(__stop_log_backends = .);
125 | } > FLASH
126 |
127 | } INSERT AFTER .text
128 |
129 | INCLUDE "nrf_common.ld"
130 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/pca10056/s140/armgcc/ble_app_template_gcc_nrf52.ld:
--------------------------------------------------------------------------------
1 | /* Linker script to configure memory regions. */
2 |
3 | SEARCH_DIR(.)
4 | GROUP(-lgcc -lc -lnosys)
5 |
6 | MEMORY
7 | {
8 | FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
9 | RAM (rwx) : ORIGIN = 0x20002220, LENGTH = 0xdde0
10 | }
11 |
12 | SECTIONS
13 | {
14 | }
15 |
16 | SECTIONS
17 | {
18 | . = ALIGN(4);
19 | .mem_section_dummy_ram :
20 | {
21 | }
22 | .cli_sorted_cmd_ptrs :
23 | {
24 | PROVIDE(__start_cli_sorted_cmd_ptrs = .);
25 | KEEP(*(.cli_sorted_cmd_ptrs))
26 | PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
27 | } > RAM
28 | .fs_data :
29 | {
30 | PROVIDE(__start_fs_data = .);
31 | KEEP(*(.fs_data))
32 | PROVIDE(__stop_fs_data = .);
33 | } > RAM
34 | .log_dynamic_data :
35 | {
36 | PROVIDE(__start_log_dynamic_data = .);
37 | KEEP(*(SORT(.log_dynamic_data*)))
38 | PROVIDE(__stop_log_dynamic_data = .);
39 | } > RAM
40 | .log_filter_data :
41 | {
42 | PROVIDE(__start_log_filter_data = .);
43 | KEEP(*(SORT(.log_filter_data*)))
44 | PROVIDE(__stop_log_filter_data = .);
45 | } > RAM
46 |
47 | } INSERT AFTER .data;
48 |
49 | SECTIONS
50 | {
51 | .mem_section_dummy_rom :
52 | {
53 | }
54 | .sdh_soc_observers :
55 | {
56 | PROVIDE(__start_sdh_soc_observers = .);
57 | KEEP(*(SORT(.sdh_soc_observers*)))
58 | PROVIDE(__stop_sdh_soc_observers = .);
59 | } > FLASH
60 | .pwr_mgmt_data :
61 | {
62 | PROVIDE(__start_pwr_mgmt_data = .);
63 | KEEP(*(SORT(.pwr_mgmt_data*)))
64 | PROVIDE(__stop_pwr_mgmt_data = .);
65 | } > FLASH
66 | .sdh_ble_observers :
67 | {
68 | PROVIDE(__start_sdh_ble_observers = .);
69 | KEEP(*(SORT(.sdh_ble_observers*)))
70 | PROVIDE(__stop_sdh_ble_observers = .);
71 | } > FLASH
72 | .sdh_stack_observers :
73 | {
74 | PROVIDE(__start_sdh_stack_observers = .);
75 | KEEP(*(SORT(.sdh_stack_observers*)))
76 | PROVIDE(__stop_sdh_stack_observers = .);
77 | } > FLASH
78 | .sdh_req_observers :
79 | {
80 | PROVIDE(__start_sdh_req_observers = .);
81 | KEEP(*(SORT(.sdh_req_observers*)))
82 | PROVIDE(__stop_sdh_req_observers = .);
83 | } > FLASH
84 | .sdh_state_observers :
85 | {
86 | PROVIDE(__start_sdh_state_observers = .);
87 | KEEP(*(SORT(.sdh_state_observers*)))
88 | PROVIDE(__stop_sdh_state_observers = .);
89 | } > FLASH
90 | .nrf_queue :
91 | {
92 | PROVIDE(__start_nrf_queue = .);
93 | KEEP(*(.nrf_queue))
94 | PROVIDE(__stop_nrf_queue = .);
95 | } > FLASH
96 | .nrf_balloc :
97 | {
98 | PROVIDE(__start_nrf_balloc = .);
99 | KEEP(*(.nrf_balloc))
100 | PROVIDE(__stop_nrf_balloc = .);
101 | } > FLASH
102 | .cli_command :
103 | {
104 | PROVIDE(__start_cli_command = .);
105 | KEEP(*(.cli_command))
106 | PROVIDE(__stop_cli_command = .);
107 | } > FLASH
108 | .crypto_data :
109 | {
110 | PROVIDE(__start_crypto_data = .);
111 | KEEP(*(SORT(.crypto_data*)))
112 | PROVIDE(__stop_crypto_data = .);
113 | } > FLASH
114 | .log_const_data :
115 | {
116 | PROVIDE(__start_log_const_data = .);
117 | KEEP(*(SORT(.log_const_data*)))
118 | PROVIDE(__stop_log_const_data = .);
119 | } > FLASH
120 | .log_backends :
121 | {
122 | PROVIDE(__start_log_backends = .);
123 | KEEP(*(SORT(.log_backends*)))
124 | PROVIDE(__stop_log_backends = .);
125 | } > FLASH
126 |
127 | } INSERT AFTER .text
128 |
129 | INCLUDE "nrf_common.ld"
130 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/scripts/bluepy-exp.py:
--------------------------------------------------------------------------------
1 | # import the necessary parts of the bluepy library
2 | from bluepy.btle import Scanner, DefaultDelegate
3 |
4 | # create a delegate class to receive the BLE broadcast packets
5 | class ScanDelegate(DefaultDelegate):
6 | def __init__(self):
7 | DefaultDelegate.__init__(self)
8 |
9 | # when this python script discovers a BLE broadcast packet, print a message with the device's MAC address
10 | def handleDiscovery(self, dev, isNewDev, isNewData):
11 | if isNewDev:
12 | print "Discovered device", dev.addr
13 | elif isNewData:
14 | print "Received new data from", dev.addr
15 |
16 | # create a scanner object that sends BLE broadcast packets to the ScanDelegate
17 | scanner = Scanner().withDelegate(ScanDelegate())
18 |
19 | # create a list of unique devices that the scanner discovered during a 10-second scan
20 | devices = scanner.scan(10.0)
21 |
22 | # for each device in the list of devices
23 | for dev in devices:
24 | # print the device's MAC address, its address type,
25 | # and Received Signal Strength Indication that shows how strong the signal was when the script received the broadcast.
26 | print "Device %s (%s), RSSI=%d dB" % (dev.addr, dev.addrType, dev.rssi)
27 |
28 | # For each of the device's advertising data items, print a description of the data type and value of the data itself
29 | # getScanData returns a list of tupples: adtype, desc, value
30 | # where AD Type means "advertising data type," as defined by Bluetooth convention:
31 | # https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile
32 | # desc is a human-readable description of the data type and value is the data itself
33 | for (adtype, desc, value) in dev.getScanData():
34 | print " %s = %s" % (desc, value)
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/scripts/example.js:
--------------------------------------------------------------------------------
1 | const _cliProgress = require('cli-progress');
2 |
3 | // create a new progress bar instance and use shades_classic theme
4 | const bar1 = new _cliProgress.Bar({}, _cliProgress.Presets.shades_classic);
5 |
6 | // start the progress bar with a total value of 200 and start value of 0
7 | bar1.start(200, 0);
8 |
9 | // update the current value in your application..
10 | bar1.update(150);
11 |
12 | // stop the progress bar
13 | bar1.stop();
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/scripts/gen_img.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import argparse
3 | from PIL import Image
4 | import subprocess
5 | from subprocess import Popen, PIPE
6 |
7 | # compress given image from N*N to N*N/8 - B & W image
8 | def compress_bw(img_in, image_width, image_height):
9 | img_out = []
10 |
11 | length = image_width*image_height
12 |
13 | for i in range(0, length, 8):
14 | # 8 values go into one byte
15 | val = 0xff
16 | no_of_bytes = 8
17 | if length < 8:
18 | no_of_bytes = length
19 |
20 | for j in range(no_of_bytes):
21 | val &= ~((0x1 & img_in[i+j]) << 7-j)
22 | # save
23 | img_out.append(val)
24 | length = length-8
25 |
26 | return img_out
27 |
28 | def get_image_width(img_path):
29 | process = Popen('exiftool ' + img_path + ' -ImageWidth -b', shell=True, stdout=PIPE, stderr=PIPE)
30 | stdout, stderr = process.communicate()
31 |
32 | if not stderr:
33 | return stdout
34 | else:
35 | return -1
36 |
37 | def get_image_height(img_path):
38 | process = Popen('exiftool ' + img_path + ' -ImageHeight -b', shell=True, stdout=PIPE, stderr=PIPE)
39 | stdout, stderr = process.communicate()
40 |
41 | if not stderr:
42 | return stdout
43 | else:
44 | return -1
45 |
46 | # print compress image to c array in a file
47 | def print_img(imgc_bw, imgc_red, header_file_name, image_name, image_width, image_height):
48 | # open header file
49 | f = open(header_file_name, 'w')
50 |
51 | hdr_comment = r"""/*
52 | image.h
53 |
54 | Compressed image data for e-ink display.
55 |
56 | Generated by Python.
57 | */
58 | """
59 | # f.write(hdr_comment)
60 |
61 | f.write("module.exports = {\n")
62 | # workaround
63 | f.write(image_name + "_image_width: "+str(image_height)+",\n")
64 | f.write(image_name + "_image_height: "+str(image_width)+",\n")
65 |
66 | # write BW data
67 | f.write(image_name + "_bwData: [")
68 | for i in range(len(imgc_bw)):
69 | f.write("'0x%x'," % imgc_bw[i])
70 | f.write("\n]")
71 | f.write("\n}")
72 |
73 | f.write("\n")
74 |
75 | # write red data
76 | # f.write("const unsigned char " + image_name + "_redData[] = {")
77 | # for i in range(len(imgc_red)):
78 | # f.write("0x%x," % imgc_red[i])
79 | # f.write("\n};")
80 |
81 | # f.write("\n\n")
82 |
83 | f.close()
84 |
85 | def color_no_frequency(pix, image_width, image_height):
86 | dict = {}
87 |
88 | for i in range(image_width):
89 | for j in range(image_height):
90 | (l, a) = pix[i, j]
91 | keys = dict.keys()
92 | if l in keys:
93 | dict[l] += 1
94 | else:
95 | dict[l] = 1
96 |
97 | return dict
98 |
99 | # main() function
100 | def main():
101 |
102 | # create parser
103 | descStr = """
104 | This program creates image headers for the GDEW0154Z04 epaper display.
105 | """
106 | parser = argparse.ArgumentParser(description=descStr)
107 |
108 | # add arguments
109 | parser.add_argument('--input-img', dest='input_img', required=True)
110 |
111 | # parse args
112 | args = parser.parse_args()
113 |
114 | if args.input_img:
115 | image_width = int(get_image_width(args.input_img))
116 | image_height = int(get_image_height(args.input_img))
117 |
118 | print("opening %s..." % args.input_img)
119 |
120 | image_name = args.input_img.split("/")[-1].split(".")[0].split("-")[-1]
121 | print "prefix :", image_name
122 |
123 | # open image in LA mode
124 | im1 = Image.open(args.input_img).convert('LA')
125 | # im1.show()
126 |
127 | print "image size :", Image.open(args.input_img).size
128 |
129 | # get pixel access
130 | pix = im1.load()
131 |
132 | # d = color_no_frequency(pix, image_width, image_height)
133 |
134 | # for key, value in d.iteritems():
135 | # print key, value
136 |
137 | # exit(0)
138 |
139 | # uncompressed image data
140 | image_data_bw = image_width*image_height*[0]
141 |
142 | # threshold and create B & W image
143 | for i in range(image_width):
144 | for j in range(image_height):
145 | (l, a) = pix[i, j]
146 | # print pix[i,j]
147 |
148 | if l > 128:
149 | image_data_bw[i*image_height + j] = 0
150 | else:
151 | image_data_bw[i*image_height + j] = 1
152 |
153 | print("compressing b & w image...")
154 | # compress
155 | image_data_bw_c = compress_bw(image_data_bw, image_width, image_height)
156 |
157 | print("printing image header...")
158 | # print
159 | print_img(image_data_bw_c, [], "image.js", image_name, image_width, image_height)
160 |
161 | process = Popen('sudo node transfer_image.js', shell=True, stdout=PIPE, stderr=PIPE)
162 | stdout, stderr = process.communicate()
163 |
164 | print stderr
165 | print "-------------------------------"
166 | print stdout
167 |
168 | # if not stderr:
169 | # print stdout
170 | # else:
171 | # print("error while transferring image data")
172 |
173 | print("done")
174 |
175 |
176 | # call main
177 | if __name__ == '__main__':
178 | main()
179 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/scripts/qr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/code/hackaBLE-epaper-image-transfer/scripts/qr.png
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/scripts/transfer_image.js:
--------------------------------------------------------------------------------
1 | var noble = require('noble');
2 | const _cliProgress = require('cli-progress');
3 |
4 | var imageData = require("./image")
5 |
6 | // create a new progress bar instance and use shades_classic theme
7 | const transfer_progress_bar = new _cliProgress.Bar({}, _cliProgress.Presets.shades_classic);
8 |
9 | const no_of_frames = 313;
10 |
11 | // service and characteristic
12 | var serviceUUIDs = ['7289140057ee475bbf86cf0898f095d9'];
13 | var characteristicUUIDs = ['7289140157ee475bbf86cf0898f095d9'];
14 |
15 | // Start scanning ble devices
16 | noble.on('stateChange', function (state) {
17 | console.log(state);
18 | if (state === 'poweredOn') {
19 | console.log('scanning...');
20 | noble.startScanning([], false);
21 | } else {
22 | console.log('stopped.');
23 | noble.stopScanning();
24 | }
25 | });
26 |
27 | noble.on('scanStart', function () {
28 | console.log('scan started');
29 | });
30 |
31 | // this event is emitted when any ble device is found.
32 | noble.on('discover', function (peripheral) {
33 | if (peripheral.advertisement.localName) {
34 | console.log(peripheral.advertisement.localName);
35 |
36 | // check for hackBLE
37 | if (peripheral.advertisement.localName.replace(/\0/g, '') == 'Papyr') {
38 | console.log("device found");
39 |
40 | noble.stopScanning();
41 |
42 | //connect to the device
43 | peripheral.connect(function (error) {
44 | if (error) throw error;
45 | else {
46 | console.log("connected")
47 |
48 | // peripheral.discoverAllServicesAndCharacteristics(function (error, services, characteristics) {
49 | // console.log("services >>>> ")
50 | // console.log(services)
51 | // console.log("---------------------------------------------")
52 | // console.log("characteristics >>>> ")
53 | // console.log(characteristics)
54 | // console.log("---------------------------------------------")
55 | // });
56 |
57 | peripheral.discoverSomeServicesAndCharacteristics(serviceUUIDs, characteristicUUIDs, function (error, services, characteristics) {
58 | if (error) throw error;
59 | else {
60 | for (i = 0; i < characteristics.length; i++) {
61 | if (characteristics[i].uuid == characteristicUUIDs[0]) {
62 | characteristic = characteristics[i];
63 | console.log('characteristic uuid found : ', characteristic.uuid);
64 | characteristic.on("write", write_cb)
65 | }
66 | }
67 | console.log("");
68 |
69 | for(var frame_no=1; frame_no<314; frame_no++)
70 | {
71 | var vnd_value = [];
72 |
73 | if(frame_no==no_of_frames)
74 | {
75 | vnd_value.push(0) // Last frame prefix: "0b 0000 0000"
76 | vnd_value.push(0)
77 | }
78 | else
79 | {
80 | vnd_value.push((frame_no & 0xff00)>>8)
81 | vnd_value.push(frame_no & 0x00ff)
82 | }
83 |
84 |
85 | var image_data_frame = imageData.bwData.splice(0,16)
86 |
87 | for(x=0; x<16; x++)
88 | {
89 | vnd_value.push(image_data_frame[x]);
90 | }
91 |
92 | const vnd_value_buf = Buffer.from(vnd_value)
93 |
94 | //console.log(JSON.stringify(vnd_value))
95 | // console.log(vnd_value_buf.toString('hex'))
96 |
97 | characteristic.write(vnd_value_buf, false, function (error) {
98 | if (error) throw error;
99 | });
100 | }
101 | }
102 | });
103 | }
104 | })
105 | }
106 | }
107 | });
108 |
109 | var num_writes = 0;
110 | function write_cb()
111 | {
112 | if(num_writes == 0)
113 | {
114 | transfer_progress_bar.start(no_of_frames, num_writes);
115 | }
116 |
117 | // console.log("num_writes", num_writes)
118 | num_writes++;
119 | transfer_progress_bar.update(num_writes);
120 |
121 | if(num_writes == no_of_frames)
122 | {
123 | transfer_progress_bar.stop();
124 | // console.log("done.")
125 | process.exit(0);
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/code/hackaBLE-epaper-image-transfer/scripts/transfer_image2.js:
--------------------------------------------------------------------------------
1 | var noble = require('noble');
2 | const _cliProgress = require('cli-progress');
3 |
4 | var imageData = require("./image")
5 |
6 | // create a new progress bar instance and use shades_classic theme
7 | const transfer_progress_bar = new _cliProgress.Bar({}, _cliProgress.Presets.shades_classic);
8 |
9 | // service and characteristic
10 | var serviceUUIDs = ['7289140057ee475bbf86cf0898f095d9'];
11 | var characteristicUUIDs = ['7289140157ee475bbf86cf0898f095d9'];
12 |
13 | // Start scanning ble devices
14 | noble.on('stateChange', function (state) {
15 | console.log(state);
16 | if (state === 'poweredOn') {
17 | console.log('scanning...');
18 | noble.startScanning([], false);
19 | } else {
20 | console.log('stopped.');
21 | noble.stopScanning();
22 | }
23 | });
24 |
25 | noble.on('scanStart', function () {
26 | console.log('scan started');
27 | });
28 |
29 | // this event is emitted when any ble device is found.
30 | noble.on('discover', function (peripheral) {
31 | if (peripheral.advertisement.localName) {
32 | console.log(peripheral.advertisement.localName);
33 |
34 | // check for grid eye sensor device
35 | if (peripheral.advertisement.localName.replace(/\0/g, '') == 'hackBLE') {
36 | console.log("device found");
37 |
38 | noble.stopScanning();
39 |
40 | //connect to the device
41 | peripheral.connect(function (error) {
42 | if (error) throw error;
43 | else {
44 | console.log("connected")
45 |
46 | // peripheral.discoverAllServicesAndCharacteristics(function (error, services, characteristics) {
47 | // console.log("services >>>> ")
48 | // console.log(services)
49 | // console.log("---------------------------------------------")
50 | // console.log("characteristics >>>> ")
51 | // console.log(characteristics)
52 | // console.log("---------------------------------------------")
53 | // });
54 |
55 | peripheral.discoverSomeServicesAndCharacteristics(serviceUUIDs, characteristicUUIDs, function (error, services, characteristics) {
56 | if (error) throw error;
57 | else {
58 | for (i = 0; i < characteristics.length; i++) {
59 | if (characteristics[i].uuid == characteristicUUIDs[0]) {
60 | characteristic = characteristics[i];
61 | console.log('characteristic uuid found : ', characteristic.uuid);
62 | }
63 | }
64 |
65 | send_data(characteristic);
66 | }
67 | });
68 | }
69 | })
70 | }
71 | }
72 | });
73 |
74 | var num_writes = 0;
75 | function write_cb()
76 | {
77 | console.log("num_writes", num_writes)
78 | num_writes--;
79 | transfer_progress_bar.update(num_writes);
80 |
81 | if(num_writes == 0)
82 | {
83 | transfer_progress_bar.stop();
84 | console.log("done.")
85 | process.exit(0);
86 | }
87 | }
88 |
89 | function send_data(characteristic)
90 | {
91 | characteristic.on("write", write_cb)
92 |
93 | var frame_no = 1;
94 | var num_wr_calls = 0;
95 | var last_frame_flag = false;
96 | while(imageData.bwData.length != 0)
97 | {
98 | var image_data_frame = imageData.bwData.splice(0,16)
99 |
100 | var vnd_value = [];
101 | var written_length = 0;
102 |
103 | if(image_data_frame.length<16 || (image_data_frame.length==16 && imageData.bwData.length==0))
104 | {
105 | vnd_value.push(0) // Last frame prefix: "0b 0000 0000"
106 | vnd_value.push(0)
107 | last_frame_flag = true;
108 | console.log("last frame")
109 | }
110 | else
111 | {
112 | vnd_value.push((frame_no & 0xff00)>>8)
113 | vnd_value.push(frame_no & 0x00ff)
114 | }
115 |
116 | for(x=0; x Bluetooth Device disconnected');
19 | connect.innerText = "Connect"
20 | smoothie2.removeTimeSeries(line2);
21 | smoothie.removeTimeSeries(line1);
22 | smoothie2.stop();
23 | smoothie.stop();
24 |
25 | temp_text.innerText = "";
26 | hum_text.innerText = "";
27 |
28 | }
29 |
30 | if (!navigator.bluetooth) {
31 | document.getElementById('status_p').innerText = "This browser is not supported";
32 | document.getElementById('status_p').style.color = "red";
33 | }
34 |
35 | connect.addEventListener('click', function (event) {
36 | if (connect.innerText == "Connect") {
37 |
38 |
39 | navigator.bluetooth.requestDevice({ filters: [{ services: ["environmental_sensing"] }] })
40 | .then(device => {
41 | // Assign to bluetoothDevice , to make it global, so that disconnect can be handled
42 | bluetoothDevice = device;
43 | bluetoothDevice.addEventListener('gattserverdisconnected', onDisconnected);
44 |
45 | /* ... */
46 | console.log(device);
47 | return bluetoothDevice.gatt.connect();
48 | })
49 | .then(server => {
50 | console.log(server);
51 | return server.getPrimaryService("environmental_sensing");
52 | })
53 | .then(service => {
54 | console.log(service);
55 | myService = service;
56 | connect.innerText = "Disconnect"
57 | myService.getCharacteristic("humidity")
58 | .then(characteristic => {
59 | console.log(characteristic);
60 | return characteristic.startNotifications().then(_ => {
61 | log('> Notifications started');
62 | /*
63 | On successful connection and receiving notification data, draw graph on canvas
64 | and start stream for humidity data, with a delay of 2 sec. Scale of min and max
65 | value is set to keep the minimal visual change of humidity data.
66 | */
67 | characteristic.addEventListener('characteristicvaluechanged',
68 | handleHumidityNotifications);
69 | smoothie2 = new SmoothieChart({ maxValueScale: 1.001, minValueScale: 1.001 });
70 | smoothie2.streamTo(document.getElementById("humidity"), 2000);
71 | line2 = new TimeSeries();
72 | smoothie2.addTimeSeries(line2);
73 | });
74 | })
75 | .catch(error => { console.log(error); });
76 |
77 | return myService.getCharacteristic("temperature");
78 | })
79 | .then(characteristic => {
80 | console.log(characteristic);
81 | return characteristic.startNotifications().then(_ => {
82 | log('> Notifications started');
83 | /*
84 | On successful connection and receiving notification data, draw graph on canvas
85 | and start stream for temperature data, with a delay of 2 sec. Scale of min and max
86 | value is set to keep the minimal visual change of temperature data.
87 | */
88 | characteristic.addEventListener('characteristicvaluechanged',
89 | handleTemperatureNotifications);
90 | smoothie = new SmoothieChart({ maxValueScale: 1.001, minValueScale: 1.001 });
91 | smoothie.streamTo(document.getElementById("temperature"), 2000);
92 | line1 = new TimeSeries();
93 | smoothie.addTimeSeries(line1);
94 | });
95 | })
96 | .catch(error => { console.log(error); });
97 |
98 | } else {
99 |
100 | if (!bluetoothDevice) {
101 | return;
102 | }
103 | console.log('Disconnecting from Bluetooth Device...');
104 | if (bluetoothDevice.gatt.connected) {
105 | bluetoothDevice.gatt.disconnect();
106 | } else {
107 | console.log('> Bluetooth Device is already disconnected');
108 | }
109 | }
110 |
111 | /*
112 | on successful notification through temp and humidty, data is shown on the screen
113 | and also updated to the graph.
114 | */
115 | function handleTemperatureNotifications(event) {
116 | var temperature_bytes = new Int16Array(event.target.value.buffer);
117 | line1.append(new Date().getTime(), temperature_bytes[0] * 0.01);
118 | temp_text.innerText = (temperature_bytes[0] * 0.01).toFixed(2) + " °C";
119 | }
120 |
121 | function handleHumidityNotifications(event) {
122 | var humidity_bytes = new Uint16Array(event.target.value.buffer);
123 | line2.append(new Date().getTime(), humidity_bytes[0] * 0.01);
124 | hum_text.innerText = (humidity_bytes[0] * 0.01).toFixed(2) + " %";
125 |
126 | }
127 |
128 | });
--------------------------------------------------------------------------------
/code/zephyr_ble_th/.gitignore:
--------------------------------------------------------------------------------
1 | build/
--------------------------------------------------------------------------------
/code/zephyr_ble_th/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.13.1)
2 | include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
3 | project(hackable_zephyr_ble)
4 |
5 | target_sources(app PRIVATE
6 | src/main.c
7 | )
8 |
9 | zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
10 |
--------------------------------------------------------------------------------
/code/zephyr_ble_th/README.md:
--------------------------------------------------------------------------------
1 | ### Environmental Sensing Service Implementation with BME280 Sensor
2 | This firmware implements enviromental sensing service on hackaBLE with BLE280. Temperature, humidity and pressure data can be accessed by enabling respective ble characteristic notifications.
3 |
4 | #### Connections
5 | | hackaBLE | BME280 |
6 | |----------|--------|
7 | | P0.03 | SCL |
8 | | P0.04 | SDA|
9 | | GND | GND |
10 | | VDD | VDD |
11 |
12 | #### Build and Flash
13 | ```
14 | mkdir build && cd build
15 | cmake -GNinja -DBOARD=nrf52_hackable ..
16 | ninja # compile
17 | ninja flash # flash
18 | ```
19 |
20 | Check Logs:
21 |
22 | Enable `CONFIG_UART_CONSOLE=y` in `prj.conf`
23 |
24 | `minicom -b 115200 -D /dev/ttyACM1`
--------------------------------------------------------------------------------
/code/zephyr_ble_th/prj.conf:
--------------------------------------------------------------------------------
1 | CONFIG_GPIO=y
2 | CONFIG_UART_CONSOLE=y
3 |
4 | ##########
5 | # for BLE
6 | ##########
7 |
8 | # Incresed stack due to settings API usage
9 | CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
10 |
11 | CONFIG_BT=y
12 | CONFIG_BT_DEBUG_LOG=y
13 | CONFIG_BT_SMP=y
14 | CONFIG_BT_SIGNING=y
15 | CONFIG_BT_PERIPHERAL=y
16 | CONFIG_BT_GATT_DIS=y
17 | CONFIG_BT_ATT_PREPARE_COUNT=2
18 | CONFIG_BT_PRIVACY=y
19 | CONFIG_BT_DEVICE_NAME="hackaBLE"
20 | CONFIG_BT_DEVICE_APPEARANCE=833
21 | CONFIG_BT_DEVICE_NAME_DYNAMIC=y
22 | CONFIG_BT_DEVICE_NAME_MAX=65
23 |
24 | CONFIG_BT_SETTINGS=y
25 | CONFIG_FLASH=y
26 | CONFIG_FLASH_PAGE_LAYOUT=y
27 | CONFIG_FLASH_MAP=y
28 | CONFIG_FCB=y
29 | CONFIG_SETTINGS=y
30 | CONFIG_SETTINGS_FCB=y
31 |
32 | ##########
33 | # for I2C
34 | ##########
35 | CONFIG_I2C=y
36 | CONFIG_I2C_NRFX=y
37 | CONFIG_I2C_0_NRF_TWIM=y
38 | CONFIG_I2C_INIT_PRIORITY=60
39 | CONFIG_I2C_0=y
40 | CONFIG_BME280_I2C_MASTER_DEV_NAME="I2C_0"
41 |
42 | ##########
43 | # for BME280
44 | ##########
45 | CONFIG_SENSOR=y
46 | CONFIG_BME280=y
--------------------------------------------------------------------------------
/code/zephyr_ble_th/src/main.c:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * zephyr_ble_th
4 | *
5 | * main.c
6 | *
7 | * Demonstrates using Electronut Labs hackaBLE Nordic nRF52832 dev board
8 | * with Zephy RTOS.
9 | *
10 | * This example is adapted from Zephr RTOS sensor and bluetooth examples.
11 | *
12 | * electronut.in
13 | *
14 | */
15 |
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 |
33 | #define ENVIRONMENTAL_SENSING_SERVICE 0x181A
34 | #define TEMPERATURE_CHARACTERISTIC 0x2A6E
35 | #define HUMIDITY_CHARACTERISTIC 0x2A6F
36 | #define PRESSURE_CHARACTERISTIC 0x2A6D
37 |
38 | // sensor
39 | static struct device *dev_bme280;
40 |
41 | static struct bt_uuid_16 vnd_uuid = BT_UUID_INIT_16(ENVIRONMENTAL_SENSING_SERVICE);
42 |
43 | static const struct bt_uuid_16 T_uuid = BT_UUID_INIT_16(TEMPERATURE_CHARACTERISTIC);
44 | static const struct bt_uuid_16 H_uuid = BT_UUID_INIT_16(HUMIDITY_CHARACTERISTIC);
45 | static const struct bt_uuid_16 P_uuid = BT_UUID_INIT_16(PRESSURE_CHARACTERISTIC);
46 |
47 | static struct bt_gatt_ccc_cfg T_ccc_cfg[BT_GATT_CCC_MAX];
48 | static struct bt_gatt_ccc_cfg H_ccc_cfg[BT_GATT_CCC_MAX];
49 | static struct bt_gatt_ccc_cfg P_ccc_cfg[BT_GATT_CCC_MAX];
50 |
51 | static u8_t bTNotify;
52 | static u8_t bHNotify;
53 | static u8_t bPNotify;
54 |
55 | static void T_ccc_cfg_changed(const struct bt_gatt_attr *attr, u16_t value)
56 | {
57 | bTNotify = (value == BT_GATT_CCC_NOTIFY) ? 1 : 0;
58 | }
59 |
60 | static void H_ccc_cfg_changed(const struct bt_gatt_attr *attr, u16_t value)
61 | {
62 | bHNotify = (value == BT_GATT_CCC_NOTIFY) ? 1 : 0;
63 | }
64 |
65 | static void P_ccc_cfg_changed(const struct bt_gatt_attr *attr, u16_t value)
66 | {
67 | bPNotify = (value == BT_GATT_CCC_NOTIFY) ? 1 : 0;
68 | }
69 |
70 | /* Vendor Primary Service Declaration */
71 | static struct bt_gatt_attr vnd_attrs[] = {
72 | /* Vendor Primary Service Declaration */
73 | BT_GATT_PRIMARY_SERVICE(&vnd_uuid),
74 | BT_GATT_CHARACTERISTIC(&T_uuid.uuid,
75 | BT_GATT_CHRC_READ | BT_GATT_CHRC_NOTIFY,
76 | BT_GATT_PERM_READ,
77 | NULL, NULL, NULL),
78 | BT_GATT_CCC(T_ccc_cfg, T_ccc_cfg_changed),
79 | BT_GATT_CHARACTERISTIC(&H_uuid.uuid,
80 | BT_GATT_CHRC_READ | BT_GATT_CHRC_NOTIFY,
81 | BT_GATT_PERM_READ,
82 | NULL, NULL, NULL),
83 | BT_GATT_CCC(H_ccc_cfg, H_ccc_cfg_changed),
84 | BT_GATT_CHARACTERISTIC(&P_uuid.uuid,
85 | BT_GATT_CHRC_READ | BT_GATT_CHRC_NOTIFY,
86 | BT_GATT_PERM_READ,
87 | NULL, NULL, NULL),
88 | BT_GATT_CCC(P_ccc_cfg, P_ccc_cfg_changed)};
89 |
90 | static struct bt_gatt_service vnd_svc = BT_GATT_SERVICE(vnd_attrs);
91 |
92 | static const struct bt_data ad[] = {
93 | BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
94 | BT_DATA_BYTES(BT_DATA_UUID16_ALL, 0x1a, 0x18),
95 | };
96 |
97 | static void connected(struct bt_conn *conn, u8_t err)
98 | {
99 | if (err)
100 | {
101 | printk("Connection failed (err %u)\n", err);
102 | }
103 | else
104 | {
105 | printk("Connected\n");
106 | }
107 | }
108 |
109 | static void disconnected(struct bt_conn *conn, u8_t reason)
110 | {
111 | printk("Disconnected (reason %u)\n", reason);
112 | }
113 |
114 | static struct bt_conn_cb conn_callbacks = {
115 | .connected = connected,
116 | .disconnected = disconnected,
117 | };
118 |
119 | static void bt_ready(int err)
120 | {
121 | if (err)
122 | {
123 | printk("Bluetooth init failed (err %d)\n", err);
124 | return;
125 | }
126 |
127 | printk("Bluetooth initialized\n");
128 |
129 | bt_gatt_service_register(&vnd_svc);
130 |
131 | if (IS_ENABLED(CONFIG_SETTINGS))
132 | {
133 | settings_load();
134 | }
135 |
136 | err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0);
137 | if (err)
138 | {
139 | printk("Advertising failed to start (err %d)\n", err);
140 | return;
141 | }
142 |
143 | printk("Advertising successfully started\n");
144 | }
145 |
146 | float g_temp, g_humid, g_press;
147 | int16_t temp_field;
148 | uint16_t humid_field;
149 | uint32_t press_field;
150 |
151 | // print BME280 data
152 | void update_sensor_data()
153 | {
154 | // get sensor data
155 | struct sensor_value temp, press, humidity;
156 |
157 | sensor_sample_fetch(dev_bme280);
158 | sensor_channel_get(dev_bme280, SENSOR_CHAN_AMBIENT_TEMP, &temp);
159 | sensor_channel_get(dev_bme280, SENSOR_CHAN_PRESS, &press);
160 | sensor_channel_get(dev_bme280, SENSOR_CHAN_HUMIDITY, &humidity);
161 |
162 | printk("temp: %d.%06d degC; press: %d.%06d hPa?; humidity: %d.%06d %%RH\n",
163 | temp.val1, temp.val2, press.val1, press.val2,
164 | humidity.val1, humidity.val2);
165 |
166 | g_temp = temp.val1 + (temp.val2 / (float)1000000);
167 | g_humid = humidity.val1 + (humidity.val2 / (float)1000000);
168 | g_press = (press.val1 + (press.val2 / (float)1000000)) * 100; // 1 hPa = 100 Pa
169 |
170 | temp_field = (int16_t)(g_temp * 100);
171 | humid_field = (uint16_t)(g_humid * 100);
172 | press_field = (uint32_t)(g_press * 10); // https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.pressure.xml
173 | }
174 |
175 | void main(void)
176 | {
177 | struct device *port0 = device_get_binding("GPIO_0");
178 | /* Set LED pin as output */
179 | gpio_pin_configure(port0, 17, GPIO_DIR_OUT);
180 |
181 | // flash LED
182 | gpio_pin_write(port0, 17, 0);
183 | k_sleep(500);
184 | gpio_pin_write(port0, 17, 1);
185 | k_sleep(500);
186 |
187 | // sensor
188 | dev_bme280 = device_get_binding("BME280");
189 | printk("dev %p name %s\n", dev_bme280, dev_bme280->config->name);
190 |
191 | k_sleep(500);
192 | update_sensor_data();
193 |
194 | // set up BLE
195 | int err;
196 | err = bt_enable(bt_ready);
197 | if (err)
198 | {
199 | printk("Bluetooth init failed (err %d)\n", err);
200 | return;
201 | }
202 |
203 | bt_conn_cb_register(&conn_callbacks);
204 |
205 | while (1)
206 | {
207 | k_sleep(2 * MSEC_PER_SEC);
208 |
209 | // update
210 | update_sensor_data();
211 |
212 | printk("temp_field: %d; humid_field: %d; press_field: %d\n", temp_field, humid_field, press_field);
213 |
214 | // notify
215 | bt_gatt_notify(NULL, &vnd_attrs[2], &temp_field, sizeof(temp_field));
216 | bt_gatt_notify(NULL, &vnd_attrs[4], &humid_field, sizeof(humid_field));
217 | bt_gatt_notify(NULL, &vnd_attrs[6], &press_field, sizeof(press_field));
218 |
219 | // update adv data
220 | bt_le_adv_update_data(ad, ARRAY_SIZE(ad), NULL, 0);
221 | }
222 | }
223 |
--------------------------------------------------------------------------------
/docs/hackaBLEv0.2/hackaBLE-dims.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv0.2/hackaBLE-dims.png
--------------------------------------------------------------------------------
/docs/hackaBLEv0.2/hackaBLE-pinout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv0.2/hackaBLE-pinout.png
--------------------------------------------------------------------------------
/docs/hackaBLEv0.2/hackaBLE-prog1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv0.2/hackaBLE-prog1.jpg
--------------------------------------------------------------------------------
/docs/hackaBLEv0.2/hackaBLE-prog2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv0.2/hackaBLE-prog2.jpg
--------------------------------------------------------------------------------
/docs/hackaBLEv0.2/hackaBLE1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv0.2/hackaBLE1.jpg
--------------------------------------------------------------------------------
/docs/hackaBLEv0.3/hackaBLE-pinout_V0.3.1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv0.3/hackaBLE-pinout_V0.3.1.png
--------------------------------------------------------------------------------
/docs/hackaBLEv0.3/hackable_v0.3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv0.3/hackable_v0.3.jpg
--------------------------------------------------------------------------------
/docs/hackaBLEv0.3/thumbnail.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv0.3/thumbnail.jpg
--------------------------------------------------------------------------------
/docs/hackaBLEv2.2/hackaBLE_Dimensions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv2.2/hackaBLE_Dimensions.png
--------------------------------------------------------------------------------
/docs/hackaBLEv2.2/hackable_back.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv2.2/hackable_back.jpg
--------------------------------------------------------------------------------
/docs/hackaBLEv2.2/hackable_front.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv2.2/hackable_front.jpg
--------------------------------------------------------------------------------
/docs/hackaBLEv2.2/hackable_pinout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv2.2/hackable_pinout.png
--------------------------------------------------------------------------------
/docs/hackaBLEv2.2/thumbnail.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/hackaBLEv2.2/thumbnail.jpg
--------------------------------------------------------------------------------
/docs/schematic.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/docs/schematic.pdf
--------------------------------------------------------------------------------
/hackable_footprint.kicad_mod:
--------------------------------------------------------------------------------
1 | (module hackable_footprint (layer F.Cu) (tedit 5A0A7812)
2 | (fp_text reference REF** (at 9.271 1.8415) (layer F.SilkS)
3 | (effects (font (size 1 1) (thickness 0.15)))
4 | )
5 | (fp_text value "hackable footprint" (at 8.89 -29.083) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_text user "NO GROUND PLANE" (at 9.144 -26.0985) (layer F.Fab)
9 | (effects (font (size 1 1) (thickness 0.15)))
10 | )
11 | (fp_line (start 0 -24.1935) (end 17.78 -24.1935) (layer F.SilkS) (width 0.15))
12 | (fp_line (start 0 -1.27) (end 0 -26.7335) (layer F.SilkS) (width 0.15))
13 | (fp_line (start 16.51 0) (end 1.27 0) (layer F.SilkS) (width 0.15))
14 | (fp_line (start 17.78 -26.7335) (end 17.78 -1.27) (layer F.SilkS) (width 0.15))
15 | (fp_line (start 1.27 -28.0035) (end 16.51 -28.0035) (layer F.SilkS) (width 0.15))
16 | (fp_arc (start 1.27 -26.7335) (end 0 -26.7335) (angle 90) (layer F.SilkS) (width 0.15))
17 | (fp_arc (start 16.51 -26.7335) (end 16.51 -28.0035) (angle 90) (layer F.SilkS) (width 0.15))
18 | (fp_arc (start 16.51 -1.27) (end 17.78 -1.27) (angle 90) (layer F.SilkS) (width 0.15))
19 | (fp_arc (start 1.27 -1.27) (end 1.27 0) (angle 90) (layer F.SilkS) (width 0.15))
20 | (pad 27 smd rect (at 14.9225 -19.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
21 | (pad 25 smd rect (at 14.9225 -21.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
22 | (pad 26 smd rect (at 14.9225 -20.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
23 | (pad 23 smd rect (at 14.9225 -23.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
24 | (pad 24 smd rect (at 14.9225 -22.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
25 | (pad 29 smd rect (at 2.8575 -20.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
26 | (pad 30 smd rect (at 2.8575 -21.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
27 | (pad 31 smd rect (at 2.8575 -22.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
28 | (pad 28 smd rect (at 2.8575 -19.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
29 | (pad 32 smd rect (at 2.8575 -23.5265) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
30 | (pad 13 smd rect (at 12.7 0) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
31 | (pad 12 smd rect (at 10.16 0) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
32 | (pad 11 smd rect (at 7.62 0) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
33 | (pad 9 smd rect (at 0 -2.54) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
34 | (pad 8 smd rect (at 0 -5.08) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
35 | (pad 7 smd rect (at 0 -7.62) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
36 | (pad 6 smd rect (at 0 -10.16) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
37 | (pad 4 smd rect (at 0 -15.24) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
38 | (pad 5 smd rect (at 0 -12.7) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
39 | (pad 3 smd rect (at 0 -17.78) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
40 | (pad 2 smd rect (at 0 -20.32) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
41 | (pad 1 smd rect (at 0 -22.86) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
42 | (pad 14 smd rect (at 17.78 -2.54) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
43 | (pad 15 smd rect (at 17.78 -5.08) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
44 | (pad 17 smd rect (at 17.78 -10.16) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
45 | (pad 16 smd rect (at 17.78 -7.62) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
46 | (pad 18 smd rect (at 17.78 -12.7) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
47 | (pad 19 smd rect (at 17.78 -15.24) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
48 | (pad 20 smd rect (at 17.78 -17.78) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
49 | (pad 21 smd rect (at 17.78 -20.32) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
50 | (pad 22 smd rect (at 17.78 -22.86) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
51 | (pad 10 smd rect (at 5.08 0) (size 1.6 1.6) (layers F.Cu F.Paste F.Mask))
52 | )
53 |
--------------------------------------------------------------------------------
/pcb/README.md:
--------------------------------------------------------------------------------
1 | # BlueyCore
2 | A compact Nordic nRF52832 BLE module for embedding in projects.
3 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE .dcm:
--------------------------------------------------------------------------------
1 | EESchema-DOCLIB Version 2.0
2 | #
3 | #End Doc Library
4 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/5pin_header.kicad_mod:
--------------------------------------------------------------------------------
1 | (module 5pin_header (layer F.Cu) (tedit 5981578E)
2 | (fp_text reference J5 (at 0 2.54) (layer F.SilkS)
3 | (effects (font (size 0.5 0.5) (thickness 0.05)))
4 | )
5 | (fp_text value GPIO (at 0 -3.2) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (pad 3 smd rect (at 0 0) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
9 | (pad 2 smd rect (at 0 -1) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
10 | (pad 1 smd rect (at 0 -2) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
11 | (pad 4 smd rect (at 0 1) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
12 | (pad 5 smd rect (at 0 2) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
13 | )
14 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/6pin_header.kicad_mod:
--------------------------------------------------------------------------------
1 | (module 6pin_header (layer F.Cu) (tedit 598044D4)
2 | (fp_text reference J5 (at 0 4) (layer F.SilkS)
3 | (effects (font (size 1 1) (thickness 0.15)))
4 | )
5 | (fp_text value GPIO (at 0 -3.2) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (pad 3 smd rect (at 0 0) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
9 | (pad 2 smd rect (at 0 -1) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
10 | (pad 1 smd rect (at 0 -2) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
11 | (pad 4 smd rect (at 0 1) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
12 | (pad 5 smd rect (at 0 2) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
13 | (pad 6 smd rect (at 0 3) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
14 | )
15 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/ABS07_crystal.kicad_mod:
--------------------------------------------------------------------------------
1 | (module ABS07_crystal (layer F.Cu) (tedit 58AE90D5)
2 | (fp_text reference Y1 (at 1.466 -1.912 90) (layer F.SilkS)
3 | (effects (font (size 0.5 0.5) (thickness 0.05)))
4 | )
5 | (fp_text value 32.768KHz (at 8.89 3.7465) (layer F.Fab) hide
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_line (start 1.975 -1.125) (end -1.975 -1.125) (layer F.SilkS) (width 0.15))
9 | (fp_line (start 1.975 1.175) (end 1.975 -1.125) (layer F.SilkS) (width 0.15))
10 | (fp_line (start -1.975 1.175) (end -1.975 -1.125) (layer F.SilkS) (width 0.15))
11 | (fp_line (start -1.975 1.175) (end 1.975 1.175) (layer F.SilkS) (width 0.15))
12 | (pad 2 smd rect (at 1.25 0) (size 1.1 1.9) (layers F.Cu F.Paste F.Mask))
13 | (pad 1 smd rect (at -1.25 0) (size 1.1 1.9) (layers F.Cu F.Paste F.Mask))
14 | (model Crystals.3dshapes/Q_49U3HMS.wrl
15 | (at (xyz 0 0 0))
16 | (scale (xyz 0.28 0.5 0.2))
17 | (rotate (xyz 0 0 0))
18 | )
19 | )
20 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/CR2302_SparkfunHolder.kicad_mod:
--------------------------------------------------------------------------------
1 | (module CR2302_SparkfunHolder (layer F.Cu) (tedit 59816022)
2 | (fp_text reference BT1 (at 0.24 7.7) (layer F.SilkS)
3 | (effects (font (size 1 1) (thickness 0.15)))
4 | )
5 | (fp_text value Battery_Cell (at 0.81 -8.42) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_circle (center 0 0) (end 10.033 0) (layer F.SilkS) (width 0.15))
9 | (fp_arc (start 6.858 7.112) (end 7.366 7.62) (angle 90) (layer F.SilkS) (width 0.15))
10 | (fp_arc (start -6.858 7.112) (end -6.35 7.62) (angle 90) (layer F.SilkS) (width 0.15))
11 | (fp_arc (start 0 13.957) (end -6.35 7.62) (angle 90) (layer F.SilkS) (width 0.15))
12 | (fp_line (start 9.995 4.595) (end 7.295 7.645) (layer F.SilkS) (width 0.15))
13 | (fp_line (start -7.295 7.655) (end -9.995 4.605) (layer F.SilkS) (width 0.15))
14 | (fp_line (start -6.94 -7.3) (end 6.95 -7.3) (layer F.SilkS) (width 0.15))
15 | (fp_line (start 10 -4.6) (end 6.95 -7.3) (layer F.SilkS) (width 0.15))
16 | (fp_line (start -10 -4.6) (end -6.95 -7.3) (layer F.SilkS) (width 0.15))
17 | (fp_line (start -10 4.6) (end -10 -4.6) (layer F.SilkS) (width 0.15))
18 | (fp_line (start 10 4.6) (end 10 -4.6) (layer F.SilkS) (width 0.15))
19 | (pad 1 smd rect (at -11.43 0) (size 2.54 5.08) (layers F.Cu F.Paste F.Mask))
20 | (pad 1 smd rect (at 11.43 0) (size 2.54 5.08) (layers F.Cu F.Paste F.Mask))
21 | (pad 2 smd circle (at 0 0) (size 8.89 8.89) (layers F.Cu F.Paste F.Mask))
22 | )
23 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/CREE-CA.kicad_mod:
--------------------------------------------------------------------------------
1 | (module CREE-CA (layer F.Cu) (tedit 5979C297)
2 | (fp_text reference D1 (at 1.651 0.635) (layer F.SilkS)
3 | (effects (font (size 0.5 0.5) (thickness 0.05)))
4 | )
5 | (fp_text value LED_ARGB (at 0.1 -1.94) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_circle (center 1 1) (end 1.1 1) (layer F.SilkS) (width 0.15))
9 | (fp_line (start 1 0) (end 1 0.7) (layer F.SilkS) (width 0.15))
10 | (fp_line (start -1 1) (end 0.7 1) (layer F.SilkS) (width 0.15))
11 | (fp_line (start -0.8 0.2) (end 0.8 0.2) (layer F.SilkS) (width 0.15))
12 | (fp_line (start -0.8 -0.2) (end 0.8 -0.2) (layer F.SilkS) (width 0.15))
13 | (fp_line (start 1 0) (end 1 -1) (layer F.SilkS) (width 0.15))
14 | (fp_line (start 1 -1) (end -1 -1) (layer F.SilkS) (width 0.15))
15 | (fp_line (start -1 -1) (end -1 1) (layer F.SilkS) (width 0.15))
16 | (pad 1 smd rect (at 0.5 0.6) (size 0.6 0.55) (layers F.Cu F.Paste F.Mask))
17 | (pad 2 smd rect (at -0.5 0.6) (size 0.6 0.55) (layers F.Cu F.Paste F.Mask))
18 | (pad 3 smd rect (at -0.5 -0.6) (size 0.6 0.55) (layers F.Cu F.Paste F.Mask))
19 | (pad 4 smd rect (at 0.5 -0.6) (size 0.6 0.55) (layers F.Cu F.Paste F.Mask))
20 | )
21 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/MDBT42.kicad_mod:
--------------------------------------------------------------------------------
1 | (module MDBT42 (layer F.Cu) (tedit 5979C0D7)
2 | (fp_text reference U2 (at 0.254 1.016) (layer F.SilkS)
3 | (effects (font (size 0.5 0.5) (thickness 0.05)))
4 | )
5 | (fp_text value MDBT42 (at 0.1143 -12.1539) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_line (start 4.953 -13.2969) (end 4.953 -8.7757) (layer F.SilkS) (width 0.15))
9 | (fp_line (start -4.953 -11.049) (end 4.953 -11.049) (layer F.SilkS) (width 0.15))
10 | (fp_line (start 4.953 0.508) (end -1.143 0.508) (layer F.SilkS) (width 0.15))
11 | (fp_line (start 4.953 -8.763) (end 4.953 0.508) (layer F.SilkS) (width 0.15))
12 | (fp_line (start 4.953 -13.297) (end -4.953 -13.297) (layer F.SilkS) (width 0.15))
13 | (fp_line (start -4.953 -10.349) (end -4.953 -5.65) (layer F.SilkS) (width 0.15))
14 | (fp_line (start -4.953 -5.65) (end -4.953 0.446) (layer F.SilkS) (width 0.15))
15 | (fp_line (start -4.953 -0.254) (end -4.953 0.508) (layer F.SilkS) (width 0.15))
16 | (fp_line (start -4.953 0.508) (end -1.143 0.508) (layer F.SilkS) (width 0.15))
17 | (fp_line (start -4.953 -10.249) (end -4.953 -13.297) (layer F.SilkS) (width 0.15))
18 | (pad 38 smd rect (at -1.84 -7.75) (size 1 0.4) (layers F.Cu F.Paste F.Mask))
19 | (pad 39 smd rect (at -1.84 -6.35) (size 1 0.4) (layers F.Cu F.Paste F.Mask))
20 | (pad 40 smd rect (at -1.84 -4.95) (size 1 0.4) (layers F.Cu F.Paste F.Mask))
21 | (pad 14 smd rect (at -3.85 -0.55) (size 0.4 1.1) (layers F.Cu F.Paste F.Mask))
22 | (pad 15 smd rect (at -3.15 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
23 | (pad 16 smd rect (at -2.45 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
24 | (pad 17 smd rect (at -1.75 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
25 | (pad 18 smd rect (at -1.05 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
26 | (pad 19 smd rect (at -0.35 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
27 | (pad 20 smd rect (at 0.35 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
28 | (pad 21 smd rect (at 1.05 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
29 | (pad 22 smd rect (at 1.75 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
30 | (pad 23 smd rect (at 2.45 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
31 | (pad 24 smd rect (at 3.15 -0.4) (size 0.4 1.4) (layers F.Cu F.Paste F.Mask))
32 | (pad 1 smd rect (at -4 -10.3) (size 1.4 0.6) (layers F.Cu F.Paste F.Mask))
33 | (pad 37 smd rect (at 4 -10.3) (size 1.4 0.6) (layers F.Cu F.Paste F.Mask))
34 | (pad 2 smd rect (at -4 -9.5) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
35 | (pad 36 smd rect (at 4 -8.8) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
36 | (pad 12 smd rect (at -4 -2.5) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
37 | (pad 13 smd rect (at -4 -1.8) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
38 | (pad 11 smd rect (at -4 -3.2) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
39 | (pad 10 smd rect (at -4 -3.9) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
40 | (pad 9 smd rect (at -4 -4.6) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
41 | (pad 3 smd rect (at -4 -8.8) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
42 | (pad 4 smd rect (at -4 -8.1) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
43 | (pad 5 smd rect (at -4 -7.4) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
44 | (pad 6 smd rect (at -4 -6.7) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
45 | (pad 7 smd rect (at -4 -6) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
46 | (pad 8 smd rect (at -4 -5.3) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
47 | (pad 35 smd rect (at 4 -8.1) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
48 | (pad 34 smd rect (at 4 -7.4) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
49 | (pad 33 smd rect (at 4 -6.7) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
50 | (pad 32 smd rect (at 4 -6) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
51 | (pad 31 smd rect (at 4 -5.3) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
52 | (pad 30 smd rect (at 4 -4.6) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
53 | (pad 29 smd rect (at 4 -3.9) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
54 | (pad 28 smd rect (at 4 -3.2) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
55 | (pad 27 smd rect (at 4 -2.5) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
56 | (pad 26 smd rect (at 4 -1.8) (size 1.4 0.4) (layers F.Cu F.Paste F.Mask))
57 | (pad 25 smd rect (at 3.85 -0.55) (size 0.4 1.1) (layers F.Cu F.Paste F.Mask))
58 | (pad 41 smd rect (at -1.84 -3.55) (size 1 0.4) (layers F.Cu F.Paste F.Mask))
59 | )
60 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/Pin_Header_Straight_1x02_Pitch2.54.kicad_mod:
--------------------------------------------------------------------------------
1 | (module Pin_Header_Straight_1x02_Pitch2.54 (layer F.Cu) (tedit 5981573D)
2 | (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row")
3 | (tags "Through hole pin header THT 1x02 2.54mm single row")
4 | (fp_text reference J2 (at 0 -1.651) (layer F.SilkS)
5 | (effects (font (size 0.5 0.5) (thickness 0.05)))
6 | )
7 | (fp_text value NFC (at 0 4.87) (layer F.Fab)
8 | (effects (font (size 1 1) (thickness 0.15)))
9 | )
10 | (pad 1 thru_hole circle (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
11 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
12 | )
13 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/Pin_Header_Straight_1x04_Pitch2.54.kicad_mod:
--------------------------------------------------------------------------------
1 | (module Pin_Header_Straight_1x04_Pitch2.54 (layer F.Cu) (tedit 59815758)
2 | (descr "Through hole straight pin header, 1x04, 2.54mm pitch, single row")
3 | (tags "Through hole pin header THT 1x04 2.54mm single row")
4 | (fp_text reference J8 (at 0 -2.33) (layer F.SilkS)
5 | (effects (font (size 1 1) (thickness 0.15)))
6 | )
7 | (fp_text value SWD (at 0 9.95) (layer F.Fab)
8 | (effects (font (size 1 1) (thickness 0.15)))
9 | )
10 | (pad 1 thru_hole circle (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
11 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
12 | (pad 3 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
13 | (pad 4 thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
14 | )
15 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/Pin_Header_Straight_1x05_Pitch2.54.kicad_mod:
--------------------------------------------------------------------------------
1 | (module Pin_Header_Straight_1x05_Pitch2.54 (layer F.Cu) (tedit 5979C1D9)
2 | (descr "Through hole straight pin header, 1x05, 2.54mm pitch, single row")
3 | (tags "Through hole pin header THT 1x05 2.54mm single row")
4 | (fp_text reference J3 (at 0 -2.33) (layer F.SilkS)
5 | (effects (font (size 1 1) (thickness 0.15)))
6 | )
7 | (fp_text value SWD (at 0 12.49) (layer F.Fab)
8 | (effects (font (size 1 1) (thickness 0.15)))
9 | )
10 | (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
11 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
12 | (pad 3 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
13 | (pad 4 thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
14 | (pad 5 thru_hole oval (at 0 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
15 | )
16 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/Pin_Header_Straight_1x06_Pitch2.54.kicad_mod:
--------------------------------------------------------------------------------
1 | (module Pin_Header_Straight_1x06_Pitch2.54 (layer F.Cu) (tedit 59800DDE)
2 | (descr "Through hole straight pin header, 1x06, 2.54mm pitch, single row")
3 | (tags "Through hole pin header THT 1x06 2.54mm single row")
4 | (fp_text reference J4 (at 0 -2.33) (layer F.SilkS)
5 | (effects (font (size 1 1) (thickness 0.15)))
6 | )
7 | (fp_text value GPIO (at 0 15.03) (layer F.Fab)
8 | (effects (font (size 1 1) (thickness 0.15)))
9 | )
10 | (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
11 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
12 | (pad 3 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
13 | (pad 4 thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
14 | (pad 5 thru_hole oval (at 0 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
15 | (pad 6 thru_hole oval (at 0 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
16 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_1x06_Pitch2.54mm.wrl
17 | (at (xyz 0 0 0))
18 | (scale (xyz 1 1 1))
19 | (rotate (xyz 0 0 0))
20 | )
21 | )
22 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/Pin_Header_Straight_1x07_Pitch2.54.kicad_mod:
--------------------------------------------------------------------------------
1 | (module Pin_Header_Straight_1x07_Pitch2.54 (layer F.Cu) (tedit 5981571B)
2 | (descr "Through hole straight pin header, 1x06, 2.54mm pitch, single row")
3 | (tags "Through hole pin header THT 1x06 2.54mm single row")
4 | (fp_text reference J4 (at -0.508 14.351) (layer F.SilkS)
5 | (effects (font (size 0.5 0.5) (thickness 0.05)))
6 | )
7 | (fp_text value GPIO (at 0 17) (layer F.Fab)
8 | (effects (font (size 1 1) (thickness 0.15)))
9 | )
10 | (pad 7 thru_hole oval (at 0 15.24) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
11 | (pad 1 thru_hole circle (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
12 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
13 | (pad 3 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
14 | (pad 4 thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
15 | (pad 5 thru_hole oval (at 0 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
16 | (pad 6 thru_hole oval (at 0 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
17 | )
18 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/Pin_Header_Straight_1x12_Pitch1.27mm.kicad_mod:
--------------------------------------------------------------------------------
1 | (module Pin_Header_Straight_1x12_Pitch1.27mm (layer F.Cu) (tedit 5979C107)
2 | (descr "Through hole straight pin header, 1x12, 1.27mm pitch, single row")
3 | (tags "Through hole pin header THT 1x12 1.27mm single row")
4 | (fp_text reference J4 (at 3.175 -0.127) (layer F.SilkS)
5 | (effects (font (size 1 1) (thickness 0.15)))
6 | )
7 | (fp_text value GPIO (at 0 15.665) (layer F.Fab)
8 | (effects (font (size 1 1) (thickness 0.15)))
9 | )
10 | (pad 1 thru_hole rect (at 0 0) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
11 | (pad 2 thru_hole oval (at 0 1.27) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
12 | (pad 3 thru_hole oval (at 0 2.54) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
13 | (pad 4 thru_hole oval (at 0 3.81) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
14 | (pad 5 thru_hole oval (at 0 5.08) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
15 | (pad 6 thru_hole oval (at 0 6.35) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
16 | (pad 7 thru_hole oval (at 0 7.62) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
17 | (pad 8 thru_hole oval (at 0 8.89) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
18 | (pad 9 thru_hole oval (at 0 10.16) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
19 | (pad 10 thru_hole oval (at 0 11.43) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
20 | (pad 11 thru_hole oval (at 0 12.7) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
21 | (pad 12 thru_hole oval (at 0 13.97) (size 1 1) (drill 0.65) (layers *.Cu *.Mask))
22 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_1x12_Pitch1.27mm.wrl
23 | (at (xyz 0 0 0))
24 | (scale (xyz 1 1 1))
25 | (rotate (xyz 0 0 0))
26 | )
27 | )
28 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pretty/peter-switch.kicad_mod:
--------------------------------------------------------------------------------
1 | (module peter-switch (layer F.Cu) (tedit 5979C035)
2 | (fp_text reference SW1 (at 2.667 -1.905 180) (layer F.SilkS)
3 | (effects (font (size 0.5 0.5) (thickness 0.05)))
4 | )
5 | (fp_text value SW_Push (at 5.18 -1.79 90) (layer F.Fab) hide
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_line (start -1.75 1.5) (end 1.75 1.5) (layer F.SilkS) (width 0.15))
9 | (fp_line (start -1.75 -1.5) (end 1.75 -1.5) (layer F.SilkS) (width 0.15))
10 | (pad "" np_thru_hole circle (at 0 -0.9) (size 0.7 0.7) (drill 0.7) (layers *.Cu *.Mask F.SilkS))
11 | (pad 2 smd rect (at 2.25 0) (size 0.8 1.8) (layers F.Cu F.Paste F.Mask))
12 | (pad 1 smd rect (at -2.25 0) (size 0.8 1.8) (layers F.Cu F.Paste F.Mask))
13 | (pad "" np_thru_hole circle (at 0 0.9) (size 0.7 0.7) (drill 0.7) (layers *.Cu *.Mask F.SilkS))
14 | (model Buttons_Switches_ThroughHole.3dshapes/SW_PUSH-12mm.wrl
15 | (at (xyz 0 0 0))
16 | (scale (xyz 1.5 1.1 0.5))
17 | (rotate (xyz 0 0 0))
18 | )
19 | )
20 |
--------------------------------------------------------------------------------
/pcb/ver0.2/hackaBLE.pro:
--------------------------------------------------------------------------------
1 | update=10/31/2017 12:09:56 PM
2 | version=1
3 | last_client=kicad
4 | [pcbnew]
5 | version=1
6 | LastNetListRead=
7 | UseCmpFile=1
8 | PadDrill=0.600000000000
9 | PadDrillOvalY=0.600000000000
10 | PadSizeH=1.500000000000
11 | PadSizeV=1.500000000000
12 | PcbTextSizeV=1.500000000000
13 | PcbTextSizeH=1.500000000000
14 | PcbTextThickness=0.300000000000
15 | ModuleTextSizeV=1.000000000000
16 | ModuleTextSizeH=1.000000000000
17 | ModuleTextSizeThickness=0.150000000000
18 | SolderMaskClearance=0.000000000000
19 | SolderMaskMinWidth=0.000000000000
20 | DrawSegmentWidth=0.200000000000
21 | BoardOutlineThickness=0.100000000000
22 | ModuleOutlineThickness=0.150000000000
23 | [cvpcb]
24 | version=1
25 | NetIExt=net
26 | [general]
27 | version=1
28 | [eeschema]
29 | version=1
30 | LibDir=
31 | [eeschema/libraries]
32 | LibName1=power
33 | LibName2=device
34 | LibName3=transistors
35 | LibName4=conn
36 | LibName5=linear
37 | LibName6=regul
38 | LibName7=74xx
39 | LibName8=cmos4000
40 | LibName9=adc-dac
41 | LibName10=memory
42 | LibName11=xilinx
43 | LibName12=microcontrollers
44 | LibName13=dsp
45 | LibName14=microchip
46 | LibName15=analog_switches
47 | LibName16=motorola
48 | LibName17=texas
49 | LibName18=intel
50 | LibName19=audio
51 | LibName20=interface
52 | LibName21=digital-audio
53 | LibName22=philips
54 | LibName23=display
55 | LibName24=cypress
56 | LibName25=siliconi
57 | LibName26=opto
58 | LibName27=atmel
59 | LibName28=contrib
60 | LibName29=valves
61 | LibName30=hackaBLE
62 |
--------------------------------------------------------------------------------
/pcb/ver0.3/hackaBLE.pro:
--------------------------------------------------------------------------------
1 | update=1/2/2019 5:42:37 PM
2 | version=1
3 | last_client=kicad
4 | [pcbnew]
5 | version=1
6 | LastNetListRead=
7 | UseCmpFile=1
8 | PadDrill=0.600000000000
9 | PadDrillOvalY=0.600000000000
10 | PadSizeH=1.500000000000
11 | PadSizeV=1.500000000000
12 | PcbTextSizeV=1.500000000000
13 | PcbTextSizeH=1.500000000000
14 | PcbTextThickness=0.300000000000
15 | ModuleTextSizeV=1.000000000000
16 | ModuleTextSizeH=1.000000000000
17 | ModuleTextSizeThickness=0.150000000000
18 | SolderMaskClearance=0.000000000000
19 | SolderMaskMinWidth=0.000000000000
20 | DrawSegmentWidth=0.200000000000
21 | BoardOutlineThickness=0.100000000000
22 | ModuleOutlineThickness=0.150000000000
23 | [cvpcb]
24 | version=1
25 | NetIExt=net
26 | [general]
27 | version=1
28 | [eeschema]
29 | version=1
30 | LibDir=
31 |
--------------------------------------------------------------------------------
/pcb/ver0.3/hackaBLE_Schematic.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/pcb/ver0.3/hackaBLE_Schematic.pdf
--------------------------------------------------------------------------------
/pcb/ver2.2/BOM hackaBLE 2.2.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/pcb/ver2.2/BOM hackaBLE 2.2.xlsx
--------------------------------------------------------------------------------
/pcb/ver2.2/PCB Specifications.txt:
--------------------------------------------------------------------------------
1 | Size : 20.32 x 31.54 mm
2 | Layers : 2 layers
3 | Material : FR-4
4 | Min Hole Size : 0.3
5 | Min Track/Spacing : 6/6mil
6 | Finished Copper : 1 oz Cu
7 | Surface Finish : Immersion gold
8 | Thickness : 0.8 mm
9 | Solder Mask : Blue
10 | Silkscreen : White
11 | Via Process : Tenting vias
--------------------------------------------------------------------------------
/pcb/ver2.2/gerbers/hackaBLE-B.Mask.gbs:
--------------------------------------------------------------------------------
1 | G04 #@! TF.FileFunction,Soldermask,Bot*
2 | %FSLAX46Y46*%
3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
4 | G04 Created by KiCad (PCBNEW 4.0.7) date 09/26/18 10:41:12*
5 | %MOMM*%
6 | %LPD*%
7 | G01*
8 | G04 APERTURE LIST*
9 | %ADD10C,0.100000*%
10 | %ADD11C,2.100000*%
11 | %ADD12O,2.100000X2.100000*%
12 | %ADD13R,1.500000X1.000000*%
13 | %ADD14C,0.900000*%
14 | G04 APERTURE END LIST*
15 | D10*
16 | D11*
17 | X165974000Y-130188000D03*
18 | D12*
19 | X165974000Y-127648000D03*
20 | X165974000Y-125108000D03*
21 | X165974000Y-122568000D03*
22 | X165974000Y-120028000D03*
23 | X165974000Y-117488000D03*
24 | X165974000Y-114948000D03*
25 | X165974000Y-112408000D03*
26 | X165974000Y-109868000D03*
27 | D13*
28 | X184023000Y-116459000D03*
29 | X184023000Y-117459000D03*
30 | X184023000Y-118459000D03*
31 | X184023000Y-115459000D03*
32 | X184023000Y-114459000D03*
33 | X168245000Y-116459000D03*
34 | X168245000Y-117459000D03*
35 | X168245000Y-118459000D03*
36 | X168245000Y-115459000D03*
37 | X168245000Y-114459000D03*
38 | D11*
39 | X179944000Y-133098000D03*
40 | D12*
41 | X177404000Y-133098000D03*
42 | X174864000Y-133098000D03*
43 | X172324000Y-133098000D03*
44 | D11*
45 | X186294000Y-109868000D03*
46 | D12*
47 | X186294000Y-112408000D03*
48 | X186294000Y-114948000D03*
49 | X186294000Y-117488000D03*
50 | X186294000Y-120028000D03*
51 | X186294000Y-122568000D03*
52 | X186294000Y-125108000D03*
53 | X186294000Y-127648000D03*
54 | X186294000Y-130188000D03*
55 | D14*
56 | X176833000Y-115048000D03*
57 | X176833000Y-118248000D03*
58 | X180033000Y-118248000D03*
59 | X180033000Y-115048000D03*
60 | X177833000Y-118248000D03*
61 | X176833000Y-117248000D03*
62 | X176833000Y-116048000D03*
63 | X178833000Y-118248000D03*
64 | X178833000Y-117248000D03*
65 | X178833000Y-116048000D03*
66 | X178833000Y-115048000D03*
67 | X180033000Y-117248000D03*
68 | X180033000Y-116048000D03*
69 | X177833000Y-116048000D03*
70 | X177833000Y-115048000D03*
71 | X177833000Y-117248000D03*
72 | M02*
73 |
--------------------------------------------------------------------------------
/pcb/ver2.2/gerbers/hackaBLE-B.Paste.gbp:
--------------------------------------------------------------------------------
1 | G04 #@! TF.FileFunction,Paste,Bot*
2 | %FSLAX46Y46*%
3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
4 | G04 Created by KiCad (PCBNEW 4.0.7) date 09/26/18 10:41:12*
5 | %MOMM*%
6 | %LPD*%
7 | G01*
8 | G04 APERTURE LIST*
9 | %ADD10C,0.100000*%
10 | %ADD11R,1.100000X0.600000*%
11 | G04 APERTURE END LIST*
12 | D10*
13 | D11*
14 | X184023000Y-116459000D03*
15 | X184023000Y-117459000D03*
16 | X184023000Y-118459000D03*
17 | X184023000Y-115459000D03*
18 | X184023000Y-114459000D03*
19 | X168245000Y-116459000D03*
20 | X168245000Y-117459000D03*
21 | X168245000Y-118459000D03*
22 | X168245000Y-115459000D03*
23 | X168245000Y-114459000D03*
24 | M02*
25 |
--------------------------------------------------------------------------------
/pcb/ver2.2/gerbers/hackaBLE-Edge.Cuts.gm1:
--------------------------------------------------------------------------------
1 | G04 #@! TF.FileFunction,Profile,NP*
2 | %FSLAX46Y46*%
3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
4 | G04 Created by KiCad (PCBNEW 4.0.7) date 09/26/18 10:41:12*
5 | %MOMM*%
6 | %LPD*%
7 | G01*
8 | G04 APERTURE LIST*
9 | %ADD10C,0.100000*%
10 | %ADD11C,0.150000*%
11 | G04 APERTURE END LIST*
12 | D10*
13 | D11*
14 | X167259000Y-133128000D02*
15 | X185039000Y-133128000D01*
16 | X165989000Y-102870000D02*
17 | X165989000Y-131858000D01*
18 | X185039000Y-101600000D02*
19 | X167259000Y-101600000D01*
20 | X186309000Y-131858000D02*
21 | X186309000Y-102870000D01*
22 | X186309000Y-102870000D02*
23 | G75*
24 | G03X185039000Y-101600000I-1270000J0D01*
25 | G01*
26 | X167259000Y-101600000D02*
27 | G75*
28 | G03X165989000Y-102870000I0J-1270000D01*
29 | G01*
30 | X165989000Y-131858000D02*
31 | G75*
32 | G03X167259000Y-133128000I1270000J0D01*
33 | G01*
34 | X185039000Y-133128000D02*
35 | G75*
36 | G03X186309000Y-131858000I0J1270000D01*
37 | G01*
38 | M02*
39 |
--------------------------------------------------------------------------------
/pcb/ver2.2/gerbers/hackaBLE-F.Mask.gts:
--------------------------------------------------------------------------------
1 | G04 #@! TF.FileFunction,Soldermask,Top*
2 | %FSLAX46Y46*%
3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
4 | G04 Created by KiCad (PCBNEW 4.0.7) date 09/26/18 10:41:12*
5 | %MOMM*%
6 | %LPD*%
7 | G01*
8 | G04 APERTURE LIST*
9 | %ADD10C,0.100000*%
10 | %ADD11C,2.100000*%
11 | %ADD12O,2.100000X2.100000*%
12 | %ADD13R,0.900000X1.300000*%
13 | %ADD14R,2.300000X1.500000*%
14 | %ADD15R,1.200000X1.150000*%
15 | %ADD16R,1.000000X0.900000*%
16 | %ADD17R,0.900000X1.000000*%
17 | %ADD18R,1.150000X1.200000*%
18 | %ADD19R,1.600000X0.950000*%
19 | %ADD20R,0.999440X1.598880*%
20 | %ADD21R,1.800000X1.600000*%
21 | %ADD22R,0.900000X5.800000*%
22 | %ADD23R,1.300000X5.800000*%
23 | %ADD24R,5.400000X0.900000*%
24 | %ADD25R,0.900000X3.540000*%
25 | %ADD26R,3.400000X0.900000*%
26 | %ADD27R,3.100000X0.900000*%
27 | %ADD28R,0.900000X4.840000*%
28 | %ADD29R,1.100000X1.200000*%
29 | %ADD30R,1.100000X1.100000*%
30 | %ADD31R,0.600000X1.200000*%
31 | %ADD32R,1.200000X0.600000*%
32 | %ADD33R,4.900000X4.900000*%
33 | %ADD34C,0.900000*%
34 | %ADD35R,1.450000X1.050000*%
35 | G04 APERTURE END LIST*
36 | D10*
37 | D11*
38 | X165974000Y-130188000D03*
39 | D12*
40 | X165974000Y-127648000D03*
41 | X165974000Y-125108000D03*
42 | X165974000Y-122568000D03*
43 | X165974000Y-120028000D03*
44 | X165974000Y-117488000D03*
45 | X165974000Y-114948000D03*
46 | X165974000Y-112408000D03*
47 | X165974000Y-109868000D03*
48 | D13*
49 | X179650000Y-125600000D03*
50 | X181150000Y-125600000D03*
51 | D14*
52 | X172000000Y-126450000D03*
53 | X172000000Y-123950000D03*
54 | D15*
55 | X169750000Y-130200000D03*
56 | X168250000Y-130200000D03*
57 | X168250000Y-131800000D03*
58 | X169750000Y-131800000D03*
59 | D16*
60 | X171450000Y-122400000D03*
61 | X172550000Y-122400000D03*
62 | X172550000Y-128000000D03*
63 | X171450000Y-128000000D03*
64 | D17*
65 | X176022000Y-121751000D03*
66 | X176022000Y-122851000D03*
67 | D18*
68 | X174752000Y-121424000D03*
69 | X174752000Y-122924000D03*
70 | D17*
71 | X183019000Y-120692000D03*
72 | X183019000Y-119592000D03*
73 | D15*
74 | X172850000Y-116840000D03*
75 | X171350000Y-116840000D03*
76 | D17*
77 | X173875000Y-115104000D03*
78 | X173875000Y-114004000D03*
79 | X175050000Y-110250000D03*
80 | X175050000Y-111350000D03*
81 | X176250000Y-110250000D03*
82 | X176250000Y-111350000D03*
83 | D19*
84 | X177134000Y-125500000D03*
85 | X177134000Y-124600000D03*
86 | X175134000Y-124600000D03*
87 | X175134000Y-125500000D03*
88 | D11*
89 | X179944000Y-133098000D03*
90 | D12*
91 | X177404000Y-133098000D03*
92 | X174864000Y-133098000D03*
93 | X172324000Y-133098000D03*
94 | D16*
95 | X171535000Y-118237000D03*
96 | X172635000Y-118237000D03*
97 | D20*
98 | X171383960Y-119761000D03*
99 | X172786040Y-119761000D03*
100 | D13*
101 | X171250000Y-130200000D03*
102 | X172750000Y-130200000D03*
103 | X179650000Y-127200000D03*
104 | X181150000Y-127200000D03*
105 | X179650000Y-124000000D03*
106 | X181150000Y-124000000D03*
107 | D21*
108 | X169783000Y-110748000D03*
109 | X169783000Y-112448000D03*
110 | X171983000Y-112448000D03*
111 | X171983000Y-110748000D03*
112 | D22*
113 | X178701000Y-105049320D03*
114 | D23*
115 | X180801000Y-105049320D03*
116 | D24*
117 | X178751000Y-102599320D03*
118 | D25*
119 | X176501000Y-103919320D03*
120 | D26*
121 | X175251000Y-105239320D03*
122 | D25*
123 | X171801000Y-103919320D03*
124 | D26*
125 | X170551000Y-105239320D03*
126 | D25*
127 | X174002000Y-103919320D03*
128 | D27*
129 | X172901000Y-102599320D03*
130 | D25*
131 | X169302000Y-103919320D03*
132 | D27*
133 | X168201000Y-102599320D03*
134 | D28*
135 | X167101000Y-104569320D03*
136 | D29*
137 | X178701000Y-110332000D03*
138 | X178701000Y-109232000D03*
139 | D30*
140 | X177601000Y-111598000D03*
141 | X178701000Y-111598000D03*
142 | D11*
143 | X186294000Y-109868000D03*
144 | D12*
145 | X186294000Y-112408000D03*
146 | X186294000Y-114948000D03*
147 | X186294000Y-117488000D03*
148 | X186294000Y-120028000D03*
149 | X186294000Y-122568000D03*
150 | X186294000Y-125108000D03*
151 | X186294000Y-127648000D03*
152 | X186294000Y-130188000D03*
153 | D16*
154 | X169733000Y-113998000D03*
155 | X170833000Y-113998000D03*
156 | D17*
157 | X173850000Y-110250000D03*
158 | X173850000Y-111350000D03*
159 | D31*
160 | X176233000Y-119648000D03*
161 | X176633000Y-119648000D03*
162 | X177033000Y-119648000D03*
163 | X177433000Y-119648000D03*
164 | X177833000Y-119648000D03*
165 | X178233000Y-119648000D03*
166 | X178633000Y-119648000D03*
167 | X179033000Y-119648000D03*
168 | X179433000Y-119648000D03*
169 | X179833000Y-119648000D03*
170 | X180233000Y-119648000D03*
171 | X180633000Y-119648000D03*
172 | D32*
173 | X181433000Y-118848000D03*
174 | X181433000Y-118448000D03*
175 | X181433000Y-118048000D03*
176 | X181433000Y-117648000D03*
177 | X181433000Y-117248000D03*
178 | X181433000Y-116848000D03*
179 | X181433000Y-116448000D03*
180 | X181433000Y-116048000D03*
181 | X181433000Y-115648000D03*
182 | X181433000Y-115248000D03*
183 | X181433000Y-114848000D03*
184 | X181433000Y-114448000D03*
185 | D31*
186 | X180633000Y-113648000D03*
187 | X180233000Y-113648000D03*
188 | X179833000Y-113648000D03*
189 | X179433000Y-113648000D03*
190 | X179033000Y-113648000D03*
191 | X178633000Y-113648000D03*
192 | X178233000Y-113648000D03*
193 | X177833000Y-113648000D03*
194 | X177433000Y-113648000D03*
195 | X177033000Y-113648000D03*
196 | X176633000Y-113648000D03*
197 | X176233000Y-113648000D03*
198 | D32*
199 | X175433000Y-114448000D03*
200 | X175433000Y-114848000D03*
201 | X175433000Y-115248000D03*
202 | X175433000Y-115648000D03*
203 | X175433000Y-116048000D03*
204 | X175433000Y-116448000D03*
205 | X175433000Y-116848000D03*
206 | X175433000Y-117248000D03*
207 | X175433000Y-117648000D03*
208 | X175433000Y-118048000D03*
209 | X175433000Y-118448000D03*
210 | X175433000Y-118848000D03*
211 | D33*
212 | X178433000Y-116648000D03*
213 | D34*
214 | X176833000Y-115048000D03*
215 | X176833000Y-118248000D03*
216 | X180033000Y-118248000D03*
217 | X180033000Y-115048000D03*
218 | X177833000Y-118248000D03*
219 | X176833000Y-117248000D03*
220 | X176833000Y-116048000D03*
221 | X178833000Y-118248000D03*
222 | X178833000Y-117248000D03*
223 | X178833000Y-116048000D03*
224 | X178833000Y-115048000D03*
225 | X180033000Y-117248000D03*
226 | X180033000Y-116048000D03*
227 | X177833000Y-116048000D03*
228 | X177833000Y-115048000D03*
229 | X177833000Y-117248000D03*
230 | D35*
231 | X174191000Y-128325000D03*
232 | X178341000Y-128325000D03*
233 | X174191000Y-130475000D03*
234 | X178341000Y-130475000D03*
235 | M02*
236 |
--------------------------------------------------------------------------------
/pcb/ver2.2/gerbers/hackaBLE-F.Paste.gtp:
--------------------------------------------------------------------------------
1 | G04 #@! TF.FileFunction,Paste,Top*
2 | %FSLAX46Y46*%
3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
4 | G04 Created by KiCad (PCBNEW 4.0.7) date 09/26/18 10:41:12*
5 | %MOMM*%
6 | %LPD*%
7 | G01*
8 | G04 APERTURE LIST*
9 | %ADD10C,0.100000*%
10 | %ADD11R,0.500000X0.900000*%
11 | %ADD12R,1.900000X1.100000*%
12 | %ADD13R,0.800000X0.750000*%
13 | %ADD14R,0.600000X0.500000*%
14 | %ADD15R,0.500000X0.600000*%
15 | %ADD16R,0.750000X0.800000*%
16 | %ADD17R,1.200000X0.550000*%
17 | %ADD18R,0.599440X1.198880*%
18 | %ADD19R,1.400000X1.200000*%
19 | %ADD20R,0.700000X0.800000*%
20 | %ADD21R,0.700000X0.700000*%
21 | %ADD22R,0.200000X0.800000*%
22 | %ADD23R,0.800000X0.200000*%
23 | %ADD24R,4.500000X4.500000*%
24 | %ADD25R,1.050000X0.650000*%
25 | G04 APERTURE END LIST*
26 | D10*
27 | D11*
28 | X179650000Y-125600000D03*
29 | X181150000Y-125600000D03*
30 | D12*
31 | X172000000Y-126450000D03*
32 | X172000000Y-123950000D03*
33 | D13*
34 | X169750000Y-130200000D03*
35 | X168250000Y-130200000D03*
36 | X168250000Y-131800000D03*
37 | X169750000Y-131800000D03*
38 | D14*
39 | X171450000Y-122400000D03*
40 | X172550000Y-122400000D03*
41 | X172550000Y-128000000D03*
42 | X171450000Y-128000000D03*
43 | D15*
44 | X176022000Y-121751000D03*
45 | X176022000Y-122851000D03*
46 | D16*
47 | X174752000Y-121424000D03*
48 | X174752000Y-122924000D03*
49 | D15*
50 | X183019000Y-120692000D03*
51 | X183019000Y-119592000D03*
52 | D13*
53 | X172850000Y-116840000D03*
54 | X171350000Y-116840000D03*
55 | D15*
56 | X173875000Y-115104000D03*
57 | X173875000Y-114004000D03*
58 | X175050000Y-110250000D03*
59 | X175050000Y-111350000D03*
60 | X176250000Y-110250000D03*
61 | X176250000Y-111350000D03*
62 | D17*
63 | X177134000Y-125500000D03*
64 | X177134000Y-124600000D03*
65 | X175134000Y-124600000D03*
66 | X175134000Y-125500000D03*
67 | D14*
68 | X171535000Y-118237000D03*
69 | X172635000Y-118237000D03*
70 | D18*
71 | X171383960Y-119761000D03*
72 | X172786040Y-119761000D03*
73 | D11*
74 | X171250000Y-130200000D03*
75 | X172750000Y-130200000D03*
76 | X179650000Y-127200000D03*
77 | X181150000Y-127200000D03*
78 | X179650000Y-124000000D03*
79 | X181150000Y-124000000D03*
80 | D19*
81 | X169783000Y-110748000D03*
82 | X169783000Y-112448000D03*
83 | X171983000Y-112448000D03*
84 | X171983000Y-110748000D03*
85 | D20*
86 | X178701000Y-110332000D03*
87 | X178701000Y-109232000D03*
88 | D21*
89 | X177601000Y-111598000D03*
90 | X178701000Y-111598000D03*
91 | D14*
92 | X169733000Y-113998000D03*
93 | X170833000Y-113998000D03*
94 | D15*
95 | X173850000Y-110250000D03*
96 | X173850000Y-111350000D03*
97 | D22*
98 | X176233000Y-119648000D03*
99 | X176633000Y-119648000D03*
100 | X177033000Y-119648000D03*
101 | X177433000Y-119648000D03*
102 | X177833000Y-119648000D03*
103 | X178233000Y-119648000D03*
104 | X178633000Y-119648000D03*
105 | X179033000Y-119648000D03*
106 | X179433000Y-119648000D03*
107 | X179833000Y-119648000D03*
108 | X180233000Y-119648000D03*
109 | X180633000Y-119648000D03*
110 | D23*
111 | X181433000Y-118848000D03*
112 | X181433000Y-118448000D03*
113 | X181433000Y-118048000D03*
114 | X181433000Y-117648000D03*
115 | X181433000Y-117248000D03*
116 | X181433000Y-116848000D03*
117 | X181433000Y-116448000D03*
118 | X181433000Y-116048000D03*
119 | X181433000Y-115648000D03*
120 | X181433000Y-115248000D03*
121 | X181433000Y-114848000D03*
122 | X181433000Y-114448000D03*
123 | D22*
124 | X180633000Y-113648000D03*
125 | X180233000Y-113648000D03*
126 | X179833000Y-113648000D03*
127 | X179433000Y-113648000D03*
128 | X179033000Y-113648000D03*
129 | X178633000Y-113648000D03*
130 | X178233000Y-113648000D03*
131 | X177833000Y-113648000D03*
132 | X177433000Y-113648000D03*
133 | X177033000Y-113648000D03*
134 | X176633000Y-113648000D03*
135 | X176233000Y-113648000D03*
136 | D23*
137 | X175433000Y-114448000D03*
138 | X175433000Y-114848000D03*
139 | X175433000Y-115248000D03*
140 | X175433000Y-115648000D03*
141 | X175433000Y-116048000D03*
142 | X175433000Y-116448000D03*
143 | X175433000Y-116848000D03*
144 | X175433000Y-117248000D03*
145 | X175433000Y-117648000D03*
146 | X175433000Y-118048000D03*
147 | X175433000Y-118448000D03*
148 | X175433000Y-118848000D03*
149 | D24*
150 | X178433000Y-116648000D03*
151 | D25*
152 | X174191000Y-128325000D03*
153 | X178341000Y-128325000D03*
154 | X174191000Y-130475000D03*
155 | X178341000Y-130475000D03*
156 | M02*
157 |
--------------------------------------------------------------------------------
/pcb/ver2.2/gerbers/hackaBLE-all.pos:
--------------------------------------------------------------------------------
1 | ### Module positions - created on 10/10/18 12:49:22 ###
2 | ### Printed by Pcbnew version kicad 4.0.7
3 | ## Unit = mm, Angle = deg.
4 | ## Side : All
5 | # Ref Val Package PosX PosY Rot Side
6 | C1 12pF C_0402 170.2830 -113.9980 0.0000 top
7 | C2 12pF C_0402 173.8500 -110.8000 270.0000 top
8 | C3 TBD C_0603 169.0000 -130.2000 0.0000 top
9 | C4 TBD C_0603 169.0000 -131.8000 180.0000 top
10 | C5 12pF C_0402 172.0000 -122.4000 0.0000 top
11 | C6 12pF C_0402 172.0000 -128.0000 180.0000 top
12 | C7 0.1uF C_0402 176.0220 -122.3010 270.0000 top
13 | C8 4.7uF C_0603 174.7520 -122.1740 90.0000 top
14 | C9 0.1uF C_0402 183.0190 -120.1420 90.0000 top
15 | C10 1uF C_0603 172.1000 -116.8400 0.0000 top
16 | C11 0.1uF C_0402 173.8750 -114.5540 90.0000 top
17 | C12 100pF C_0402 175.0500 -110.8000 270.0000 top
18 | C13 NC C_0402 176.2500 -110.8000 270.0000 top
19 | C14 0.8pF SMD_C0402 178.1510 -111.5980 0.0000 top
20 | D1 LED_ARGB RGB_LED 176.1340 -125.0500 180.0000 top
21 | L1 15nH C_0402 172.0850 -118.2370 0.0000 top
22 | L2 10uH Neosid_Inductor_SM0603CG 172.0850 -119.7610 180.0000 top
23 | L3 3.9uH SMD_0402 178.7010 -109.7820 90.0000 top
24 | R1 10K R_0603 172.0000 -130.2000 0.0000 top
25 | R2 100R R_0603 180.4000 -125.6000 0.0000 top
26 | R3 100R R_0603 180.4000 -127.2000 0.0000 top
27 | R4 200R R_0603 180.4000 -124.0000 0.0000 top
28 | SW1 SW_Push PTS810_Switch 176.2660 -129.4000 0.0000 top
29 | U1 nrf52832 nRF52832 178.4330 -116.6480 90.0000 top
30 | Y1 32.768KHz ABS07_crystal 172.0000 -125.2000 270.0000 top
31 | Y2 32MHz 32MHz_crystal 170.8830 -111.5980 0.0000 top
32 | ## End
33 |
--------------------------------------------------------------------------------
/pcb/ver2.2/gerbers/hackaBLE.drl:
--------------------------------------------------------------------------------
1 | M48
2 | ;DRILL file {KiCad 4.0.7} date 09/26/18 10:41:14
3 | ;FORMAT={-:-/ absolute / metric / decimal}
4 | FMAT,2
5 | METRIC,TZ
6 | T1C0.300
7 | T2C0.400
8 | T3C1.000
9 | %
10 | G90
11 | G05
12 | M71
13 | T1
14 | X168.275Y-119.253
15 | X168.783Y-119.761
16 | X173.101Y-115.57
17 | X173.989Y-116.199
18 | X174.117Y-116.84
19 | X174.372Y-117.481
20 | X174.495Y-114.511
21 | X174.536Y-115.164
22 | X175.006Y-113.919
23 | X176.833Y-115.048
24 | X176.833Y-116.048
25 | X176.833Y-117.248
26 | X176.833Y-118.248
27 | X177.517Y-121.245
28 | X177.833Y-115.048
29 | X177.833Y-116.048
30 | X177.833Y-117.248
31 | X177.833Y-118.248
32 | X178.028Y-120.687
33 | X178.165Y-121.333
34 | X178.819Y-121.318
35 | X178.833Y-115.048
36 | X178.833Y-116.048
37 | X178.833Y-117.248
38 | X178.833Y-118.248
39 | X179.117Y-112.368
40 | X179.434Y-121.541
41 | X179.536Y-111.855
42 | X180.033Y-115.048
43 | X180.033Y-116.048
44 | X180.033Y-117.248
45 | X180.033Y-118.248
46 | X180.081Y-121.635
47 | X180.467Y-127.648
48 | X180.528Y-112.659
49 | X180.716Y-111.355
50 | X180.855Y-121.535
51 | X180.89Y-120.882
52 | X181.006Y-120.232
53 | X181.27Y-112.664
54 | X181.991Y-125.603
55 | X182.011Y-114.022
56 | X182.441Y-114.995
57 | X182.499Y-127.127
58 | X182.626Y-115.634
59 | X182.846Y-116.304
60 | X183.038Y-124.904
61 | T2
62 | X166.865Y-108.153
63 | X168.377Y-108.153
64 | X168.402Y-109.093
65 | X169.799Y-129.159
66 | X169.926Y-125.222
67 | X170.028Y-108.153
68 | X170.053Y-109.093
69 | X170.561Y-119.634
70 | X171.298Y-108.153
71 | X171.323Y-109.093
72 | X171.674Y-113.853
73 | X172.72Y-109.093
74 | X172.758Y-108.153
75 | X173.291Y-111.95
76 | X174.371Y-108.153
77 | X174.371Y-109.093
78 | X175.514Y-119.825
79 | X175.87Y-108.14
80 | X175.895Y-109.093
81 | X176.149Y-131.064
82 | X176.276Y-129.032
83 | X177.292Y-110.109
84 | X177.337Y-108.14
85 | X177.338Y-109.098
86 | X178.435Y-125.222
87 | X179.794Y-108.141
88 | X179.794Y-109.099
89 | X179.832Y-109.855
90 | X180.8Y-108.141
91 | X180.848Y-109.093
92 | X180.848Y-109.855
93 | X181.864Y-108.204
94 | X181.864Y-109.093
95 | X181.864Y-109.855
96 | X183.134Y-130.175
97 | X183.261Y-126.365
98 | X184.931Y-126.493
99 | T3
100 | X165.974Y-109.868
101 | X165.974Y-112.408
102 | X165.974Y-114.948
103 | X165.974Y-117.488
104 | X165.974Y-120.028
105 | X165.974Y-122.568
106 | X165.974Y-125.108
107 | X165.974Y-127.648
108 | X165.974Y-130.188
109 | X172.324Y-133.098
110 | X174.864Y-133.098
111 | X177.404Y-133.098
112 | X179.944Y-133.098
113 | X186.294Y-109.868
114 | X186.294Y-112.408
115 | X186.294Y-114.948
116 | X186.294Y-117.488
117 | X186.294Y-120.028
118 | X186.294Y-122.568
119 | X186.294Y-125.108
120 | X186.294Y-127.648
121 | X186.294Y-130.188
122 | T0
123 | M30
124 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE:
--------------------------------------------------------------------------------
1 | Reference, Value, Footprint, Datasheet
2 | "D1","LED_ARGB","BLE:RGB_LED",""
3 | "U2","nrf52832","BLE:nRF52832",""
4 | "U3","RF_Antenna","BLE:Antenna-2.45GHZ_mirror",""
5 | "SW1","SW_Push","BLE:TS_1185",""
6 | "C7","0.1uF","Capacitors_SMD:C_0402",""
7 | "L2","10uH","Inductors_NEOSID:Neosid_Inductor_SM0603CG",""
8 | "Y1","32.768KHz","BLE:ABS07_crystal",""
9 | "C5","12pF","Capacitors_SMD:C_0402",""
10 | "C6","12pF","Capacitors_SMD:C_0402",""
11 | "C10","1uF","Capacitors_SMD:C_0603",""
12 | "L1","15nH","Capacitors_SMD:C_0402",""
13 | "C8","4.7uF","Capacitors_SMD:C_0603",""
14 | "C11","0.1uF","Capacitors_SMD:C_0402",""
15 | "L3","3.9uH","BLE:SMD_0402",""
16 | "C14","0.8pF","BLE:SMD_C0402",""
17 | "C16","12pF","Capacitors_SMD:C_0402",""
18 | "C15","12pF","Capacitors_SMD:C_0402",""
19 | "C12","100pF","Capacitors_SMD:C_0402",""
20 | "C13","NC","Capacitors_SMD:C_0402",""
21 | "Y2","32MHz","BLE:32MHz_crystal",""
22 | "C9","0.1uF","Capacitors_SMD:C_0402",""
23 | "R2","100R","Resistors_SMD:R_0603",""
24 | "R3","100R","Resistors_SMD:R_0603",""
25 | "R4","200R","Resistors_SMD:R_0603",""
26 | "R1","10K","Resistors_SMD:R_0603",""
27 | "U1","AP2112K","TO_SOT_Packages_SMD:SOT-23-5",""
28 | "C1","1uF","Capacitors_SMD:C_0603",""
29 | "C2","2.2uF","Capacitors_SMD:C_0603",""
30 | "J1","VIN","BLE:Pin_Header_Straight_1x02_Pitch2.54",""
31 | "J7","SWD","BLE:Pin_Header_Straight_1x04_Pitch2.54",""
32 | "J5","GPIO","BLE:5pin_header",""
33 | "J3","GPIO","BLE:5pin_header",""
34 | "J2","GPIO","BLE:Pin_Header_Straight_1x07_Pitch2.54",""
35 | "J6","GPIO","BLE:Pin_Header_Straight_1x07_Pitch2.54",""
36 | "J4","NFC","BLE:Pin_Header_Straight_1x02_Pitch2.54",""
37 | "C4","TBD","Capacitors_SMD:C_0603",""
38 | "C3","TBD","Capacitors_SMD:C_0603",""
39 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE-rescue.lib:
--------------------------------------------------------------------------------
1 | EESchema-LIBRARY Version 2.3
2 | #encoding utf-8
3 | #
4 | # nrf52832-RESCUE-hackaBLE
5 | #
6 | DEF nrf52832-RESCUE-hackaBLE U 0 40 Y Y 1 F N
7 | F0 "U" 200 -960 60 H V C CNN
8 | F1 "nrf52832-RESCUE-hackaBLE" 225 1795 60 H V C CNN
9 | F2 "" -390 -65 60 H V C CNN
10 | F3 "" -390 -65 60 H V C CNN
11 | DRAW
12 | S -905 1465 1405 -605 0 1 0 N
13 | X DEC1 1 -1105 1000 200 R 50 50 1 1 I
14 | X P0.00/XL1 2 -1105 900 200 R 50 50 1 1 I
15 | X P0.01/XL2 3 -1105 800 200 R 50 50 1 1 I
16 | X P0.02/AIN0 4 -1105 700 200 R 50 50 1 1 I
17 | X P0.03/AIN1 5 -1105 600 200 R 50 50 1 1 I
18 | X P0.04/AIN2 6 -1105 500 200 R 50 50 1 1 I
19 | X P0.05/AIN3 7 -1105 400 200 R 50 50 1 1 I
20 | X P0.06 8 -1105 300 200 R 50 50 1 1 O
21 | X P0.07 9 -1105 200 200 R 50 50 1 1 I
22 | X P0.08 10 -1105 100 200 R 50 50 1 1 I
23 | X P0.17 20 405 -805 200 U 50 50 1 1 I
24 | X ANT 30 1605 395 200 L 50 50 1 1 I
25 | X P0.28/AIN4 40 505 1665 200 D 50 50 1 1 B
26 | X P0.09 11 -1105 0 200 R 50 50 1 1 I
27 | X P0.18 21 505 -805 200 U 50 50 1 1 I
28 | X VSS 31 1605 495 200 L 50 50 1 1 W
29 | X P0.29/AIN5 41 405 1665 200 D 50 50 1 1 B
30 | X P0.10 12 -1105 -100 200 R 50 50 1 1 I
31 | X P0.19 22 605 -805 200 U 50 50 1 1 I
32 | X DEC2 32 1605 595 200 L 50 50 1 1 I
33 | X P0.30/AIN6 42 305 1665 200 D 50 50 1 1 B
34 | X VDD 13 -290 -800 200 U 50 50 1 1 P
35 | X P0.20 23 705 -805 200 U 50 50 1 1 I
36 | X DEC3 33 1605 695 200 L 50 50 1 1 I
37 | X P0.31/AIN7 43 205 1665 200 D 50 50 1 1 B
38 | X P0.11 14 -195 -805 200 U 50 50 1 1 I
39 | X P0.21/RESET 24 805 -805 200 U 50 50 1 1 I
40 | X XC1 34 1605 795 200 L 50 50 1 1 I
41 | X NC 44 105 1665 200 D 50 50 1 1 N
42 | X P0.12 15 -95 -805 200 U 50 50 1 1 I
43 | X SWDCLK 25 1605 -105 200 L 50 50 1 1 B
44 | X XC2 35 1605 895 200 L 50 50 1 1 I
45 | X VSS 45 5 1665 200 D 50 50 1 1 W
46 | X P0.13 16 5 -805 200 U 50 50 1 1 I
47 | X SWDIO 26 1605 -5 200 L 50 50 1 1 B
48 | X VDD 36 1605 995 200 L 50 50 1 1 P
49 | X DEC4 46 -95 1665 200 D 50 50 1 1 I
50 | X P0.14 17 105 -805 200 U 50 50 1 1 I
51 | X P0.22 27 1605 95 200 L 50 50 1 1 B
52 | X P0.25 37 805 1665 200 D 50 50 1 1 B
53 | X DCC 47 -195 1665 200 D 50 50 1 1 I
54 | X P0.15 18 205 -805 200 U 50 50 1 1 I
55 | X P0.23 28 1605 195 200 L 50 50 1 1 B
56 | X P0.26 38 705 1665 200 D 50 50 1 1 B
57 | X VDD 48 -290 1665 200 D 50 50 1 1 P
58 | X P0.16 19 305 -805 200 U 50 50 1 1 I
59 | X P0.24 29 1605 295 200 L 50 50 1 1 B
60 | X P0.27 39 605 1665 200 D 50 50 1 1 B
61 | X GND 49 -635 1665 200 D 50 50 1 1 W
62 | ENDDRAW
63 | ENDDEF
64 | #
65 | #End Library
66 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.bck:
--------------------------------------------------------------------------------
1 | EESchema-DOCLIB Version 2.0
2 | #
3 | #End Doc Library
4 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.dcm:
--------------------------------------------------------------------------------
1 | EESchema-DOCLIB Version 2.0
2 | #
3 | #End Doc Library
4 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.lib:
--------------------------------------------------------------------------------
1 | EESchema-LIBRARY Version 2.3
2 | #encoding utf-8
3 | #
4 | # AP2112K
5 | #
6 | DEF AP2112K U 0 40 Y Y 1 F N
7 | F0 "U" 120 -250 50 H V L CNN
8 | F1 "AP2112K" 160 250 50 H V R CNN
9 | F2 "TO_SOT_Packages_SMD:SOT-23-5" 0 -400 50 H I C CNN
10 | F3 "" 0 0 50 H V C CNN
11 | $FPLIST
12 | SOT-23*
13 | $ENDFPLIST
14 | DRAW
15 | S -200 200 200 -200 0 1 10 f
16 | X IN 1 -300 100 100 R 50 50 1 1 W
17 | X GND 2 0 -300 100 U 50 50 1 1 W
18 | X EN 3 -300 0 100 R 50 50 1 1 I
19 | X NC 4 300 0 100 L 50 50 1 1 I
20 | X OUT 5 300 100 100 L 50 50 1 1 w
21 | ENDDRAW
22 | ENDDEF
23 | #
24 | # LED_ARGB
25 | #
26 | DEF LED_ARGB D 0 0 Y N 1 F N
27 | F0 "D" -80 370 50 H V C CNN
28 | F1 "LED_ARGB" -80 -350 50 H V C CNN
29 | F2 "" -80 -50 50 H I C CNN
30 | F3 "" -80 -50 50 H I C CNN
31 | DRAW
32 | T 0 -5 -250 50 0 0 0 B Normal 0 C C
33 | T 0 -5 -50 50 0 0 0 G Normal 0 C C
34 | T 0 -5 150 50 0 0 0 R Normal 0 C C
35 | C -160 0 10 0 1 0 F
36 | S -190 330 30 -300 0 1 10 f
37 | S -130 250 -130 250 0 1 0 N
38 | P 2 0 1 0 -180 0 20 0 N
39 | P 2 0 1 0 -130 200 20 200 N
40 | P 2 0 1 8 -30 -150 -30 -250 N
41 | P 2 0 1 8 -30 50 -30 -50 N
42 | P 2 0 1 8 -30 250 -30 150 N
43 | P 2 0 1 0 20 -200 -130 -200 N
44 | P 4 0 1 0 -130 -200 -160 -200 -160 200 -130 200 N
45 | P 4 0 1 8 -130 -150 -130 -250 -30 -200 -130 -150 N
46 | P 4 0 1 8 -130 50 -130 -50 -30 0 -130 50 N
47 | P 4 0 1 8 -130 250 -130 150 -30 200 -130 250 N
48 | P 5 0 1 0 -80 -150 -140 -90 -110 -90 -140 -90 -140 -120 N
49 | P 5 0 1 0 -80 50 -140 110 -110 110 -140 110 -140 80 N
50 | P 5 0 1 0 -80 250 -140 310 -110 310 -140 310 -140 280 N
51 | P 5 0 1 0 -40 -150 -100 -90 -70 -90 -100 -90 -100 -120 N
52 | P 5 0 1 0 -40 50 -100 110 -70 110 -100 110 -100 80 N
53 | P 5 0 1 0 -40 250 -100 310 -70 310 -100 310 -100 280 N
54 | X GK 1 120 0 100 L 50 50 1 1 P
55 | X RK 2 120 200 100 L 50 50 1 1 P
56 | X A 3 -280 0 100 R 50 50 1 1 P
57 | X BK 4 120 -200 100 L 50 50 1 1 P
58 | ENDDRAW
59 | ENDDEF
60 | #
61 | # RF_Antenna
62 | #
63 | DEF RF_Antenna U 0 1 Y Y 1 F N
64 | F0 "U" 35 -120 60 H V C CNN
65 | F1 "RF_Antenna" -25 140 20 H V C CNN
66 | F2 "" 0 0 60 H V C CNN
67 | F3 "" 0 0 60 H V C CNN
68 | DRAW
69 | X ~ 1 0 45 200 R 50 50 1 1 I
70 | X GND 2 0 -55 200 R 50 50 1 1 I
71 | ENDDRAW
72 | ENDDEF
73 | #
74 | # SW_Push
75 | #
76 | DEF SW_Push SW 0 40 N N 1 F N
77 | F0 "SW" 50 100 50 H V L CNN
78 | F1 "SW_Push" 0 -60 50 H V C CNN
79 | F2 "" 0 200 50 H I C CNN
80 | F3 "" 0 200 50 H I C CNN
81 | DRAW
82 | C -80 0 20 0 1 0 N
83 | C 80 0 20 0 1 0 N
84 | P 2 0 1 0 0 50 0 120 N
85 | P 2 0 1 0 100 50 -100 50 N
86 | X 1 1 -200 0 100 R 50 50 0 1 P
87 | X 2 2 200 0 100 L 50 50 0 1 P
88 | ENDDRAW
89 | ENDDEF
90 | #
91 | # nrf52832
92 | #
93 | DEF nrf52832 U 0 40 Y Y 1 F N
94 | F0 "U" 200 -960 60 H V C CNN
95 | F1 "nrf52832" 225 1795 60 H V C CNN
96 | F2 "" -390 -65 60 H V C CNN
97 | F3 "" -390 -65 60 H V C CNN
98 | DRAW
99 | S -905 1465 1405 -605 0 1 0 N
100 | X DEC1 1 -1105 1000 200 R 50 50 1 1 I
101 | X P0.00/XL1 2 -1105 900 200 R 50 50 1 1 I
102 | X P0.01/XL2 3 -1105 800 200 R 50 50 1 1 I
103 | X P0.02/AIN0 4 -1105 700 200 R 50 50 1 1 I
104 | X P0.03/AIN1 5 -1105 600 200 R 50 50 1 1 I
105 | X P0.04/AIN2 6 -1105 500 200 R 50 50 1 1 I
106 | X P0.05/AIN3 7 -1105 400 200 R 50 50 1 1 I
107 | X P0.06 8 -1105 300 200 R 50 50 1 1 O
108 | X P0.07 9 -1105 200 200 R 50 50 1 1 I
109 | X P0.08 10 -1105 100 200 R 50 50 1 1 I
110 | X P0.17 20 405 -805 200 U 50 50 1 1 I
111 | X ANT 30 1605 395 200 L 50 50 1 1 I
112 | X P0.28/AIN4 40 505 1665 200 D 50 50 1 1 I
113 | X P0.09 11 -1105 0 200 R 50 50 1 1 I
114 | X P0.18 21 505 -805 200 U 50 50 1 1 I
115 | X VSS 31 1605 495 200 L 50 50 1 1 W
116 | X P0.29/AIN5 41 405 1665 200 D 50 50 1 1 I
117 | X P0.10 12 -1105 -100 200 R 50 50 1 1 I
118 | X P0.19 22 605 -805 200 U 50 50 1 1 I
119 | X DEC2 32 1605 595 200 L 50 50 1 1 I
120 | X P0.30/AIN6 42 305 1665 200 D 50 50 1 1 I
121 | X VDD 13 -290 -800 200 U 50 50 1 1 W
122 | X P0.20 23 705 -805 200 U 50 50 1 1 I
123 | X DEC3 33 1605 695 200 L 50 50 1 1 I
124 | X P0.31/AIN7 43 205 1665 200 D 50 50 1 1 I
125 | X P0.11 14 -195 -805 200 U 50 50 1 1 I
126 | X P0.21/RESET 24 805 -805 200 U 50 50 1 1 I
127 | X XC1 34 1605 795 200 L 50 50 1 1 I
128 | X NC 44 105 1665 200 D 50 50 1 1 I
129 | X P0.12 15 -95 -805 200 U 50 50 1 1 I
130 | X SWDCLK 25 1605 -105 200 L 50 50 1 1 I
131 | X XC2 35 1605 895 200 L 50 50 1 1 I
132 | X VSS 45 5 1665 200 D 50 50 1 1 W
133 | X P0.13 16 5 -805 200 U 50 50 1 1 I
134 | X SWDIO 26 1605 -5 200 L 50 50 1 1 I
135 | X VDD 36 1605 995 200 L 50 50 1 1 W
136 | X DEC4 46 -95 1665 200 D 50 50 1 1 I
137 | X P0.14 17 105 -805 200 U 50 50 1 1 I
138 | X P0.22 27 1605 95 200 L 50 50 1 1 I
139 | X P0.25 37 805 1665 200 D 50 50 1 1 I
140 | X DCC 47 -195 1665 200 D 50 50 1 1 I
141 | X P0.15 18 205 -805 200 U 50 50 1 1 I
142 | X P0.23 28 1605 195 200 L 50 50 1 1 I
143 | X P0.26 38 705 1665 200 D 50 50 1 1 I
144 | X VDD 48 -290 1665 200 D 50 50 1 1 W
145 | X P0.16 19 305 -805 200 U 50 50 1 1 I
146 | X P0.24 29 1605 295 200 L 50 50 1 1 I
147 | X P0.27 39 605 1665 200 D 50 50 1 1 I
148 | X GND 49 -635 1665 200 D 50 50 1 1 W
149 | ENDDRAW
150 | ENDDEF
151 | #
152 | #End Library
153 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/electronut/ElectronutLabs-hackaBLE/4df94a1da9765c69d900df5b1e0c79000a9e1a67/pcb/ver2.2/hackaBLE.pdf
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/32MHz_crystal.kicad_mod:
--------------------------------------------------------------------------------
1 | (module 32MHz_crystal (layer F.Cu) (tedit 58A2A218)
2 | (fp_text reference Y2 (at 0.127 2.921) (layer F.SilkS)
3 | (effects (font (size 1 1) (thickness 0.15)))
4 | )
5 | (fp_text value 32MHz (at 0.381 -3.302) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_line (start -2.159 -1.778) (end 2.159 -1.778) (layer F.SilkS) (width 0.15))
9 | (fp_line (start 2.159 -1.778) (end 2.159 1.778) (layer F.SilkS) (width 0.15))
10 | (fp_line (start 2.159 1.778) (end -2.159 1.778) (layer F.SilkS) (width 0.15))
11 | (fp_line (start -2.159 1.778) (end -2.159 -1.778) (layer F.SilkS) (width 0.15))
12 | (pad 4 smd rect (at -1.1 -0.85) (size 1.4 1.2) (layers F.Cu F.Paste F.Mask))
13 | (pad 1 smd rect (at -1.1 0.85) (size 1.4 1.2) (layers F.Cu F.Paste F.Mask))
14 | (pad 2 smd rect (at 1.1 0.85) (size 1.4 1.2) (layers F.Cu F.Paste F.Mask))
15 | (pad 3 smd rect (at 1.1 -0.85) (size 1.4 1.2) (layers F.Cu F.Paste F.Mask))
16 | )
17 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/5pin_header.kicad_mod:
--------------------------------------------------------------------------------
1 | (module 5pin_header (layer F.Cu) (tedit 5981578E)
2 | (fp_text reference J5 (at 0 2.54) (layer F.SilkS)
3 | (effects (font (size 0.5 0.5) (thickness 0.05)))
4 | )
5 | (fp_text value GPIO (at 0 -3.2) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (pad 3 smd rect (at 0 0) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
9 | (pad 2 smd rect (at 0 -1) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
10 | (pad 1 smd rect (at 0 -2) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
11 | (pad 4 smd rect (at 0 1) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
12 | (pad 5 smd rect (at 0 2) (size 1.1 0.6) (layers F.Cu F.Paste F.Mask))
13 | )
14 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/ABS07_crystal.kicad_mod:
--------------------------------------------------------------------------------
1 | (module ABS07_crystal (layer F.Cu) (tedit 58AE90D5)
2 | (fp_text reference Y1 (at 1.466 -1.912 90) (layer F.SilkS)
3 | (effects (font (size 0.5 0.5) (thickness 0.05)))
4 | )
5 | (fp_text value 32.768KHz (at 8.89 3.7465) (layer F.Fab) hide
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_line (start 1.975 -1.125) (end -1.975 -1.125) (layer F.SilkS) (width 0.15))
9 | (fp_line (start 1.975 1.175) (end 1.975 -1.125) (layer F.SilkS) (width 0.15))
10 | (fp_line (start -1.975 1.175) (end -1.975 -1.125) (layer F.SilkS) (width 0.15))
11 | (fp_line (start -1.975 1.175) (end 1.975 1.175) (layer F.SilkS) (width 0.15))
12 | (pad 2 smd rect (at 1.25 0) (size 1.1 1.9) (layers F.Cu F.Paste F.Mask))
13 | (pad 1 smd rect (at -1.25 0) (size 1.1 1.9) (layers F.Cu F.Paste F.Mask))
14 | (model Crystals.3dshapes/Q_49U3HMS.wrl
15 | (at (xyz 0 0 0))
16 | (scale (xyz 0.28 0.5 0.2))
17 | (rotate (xyz 0 0 0))
18 | )
19 | )
20 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/Antenna-2.45GHZ_mirror.kicad_mod:
--------------------------------------------------------------------------------
1 | (module Antenna-2.45GHZ_mirror (layer F.Cu) (tedit 5A66F425)
2 | (fp_text reference U3 (at 3.175 1.397 180) (layer F.SilkS) hide
3 | (effects (font (size 0.6 0.6) (thickness 0.06)))
4 | )
5 | (fp_text value RF_Antenna (at 0 -5.04) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (pad 1 smd rect (at 10.287 0 180) (size 0.5 5.4) (layers F.Cu F.Mask))
9 | (pad 2 smd rect (at 12.387 0 180) (size 0.9 5.4) (layers F.Cu F.Mask))
10 | (pad 1 smd rect (at 10.337 -2.45 90) (size 0.5 5) (layers F.Cu F.Mask))
11 | (pad 1 smd rect (at 8.087 -1.13) (size 0.5 3.14) (layers F.Cu F.Mask))
12 | (pad 1 smd rect (at 6.837 0.19 270) (size 0.5 3) (layers F.Cu F.Mask))
13 | (pad 1 smd rect (at 3.387 -1.13) (size 0.5 3.14) (layers F.Cu F.Mask))
14 | (pad 1 smd rect (at 2.137 0.19 270) (size 0.5 3) (layers F.Cu F.Mask))
15 | (pad 1 smd rect (at 5.588 -1.13) (size 0.5 3.14) (layers F.Cu F.Mask))
16 | (pad 1 smd rect (at 4.487 -2.45 270) (size 0.5 2.7) (layers F.Cu F.Mask))
17 | (pad 1 smd rect (at 0.888 -1.13) (size 0.5 3.14) (layers F.Cu F.Mask))
18 | (pad 1 smd rect (at -0.213 -2.45 270) (size 0.5 2.7) (layers F.Cu F.Mask))
19 | (pad 1 smd rect (at -1.313 -0.48) (size 0.5 4.44) (layers F.Cu F.Mask))
20 | )
21 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/PTS810_Switch.kicad_mod:
--------------------------------------------------------------------------------
1 | (module PTS810_Switch (layer F.Cu) (tedit 5BAA0BCF)
2 | (fp_text reference SW1 (at 3.2 0) (layer F.SilkS)
3 | (effects (font (size 0.6 0.6) (thickness 0.06)))
4 | )
5 | (fp_text value SW_Push (at 0.6 -3.9) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_line (start 2.1 0.6) (end 2.1 -0.6) (layer F.SilkS) (width 0.15))
9 | (fp_line (start 1.45 -1.5) (end -1.45 -1.5) (layer F.SilkS) (width 0.15))
10 | (fp_line (start -2.1 -0.6) (end -2.1 0.6) (layer F.SilkS) (width 0.15))
11 | (fp_line (start -1.45 1.5) (end 1.45 1.5) (layer F.SilkS) (width 0.15))
12 | (pad 1 smd rect (at -2.075 -1.075) (size 1.05 0.65) (layers F.Cu F.Paste F.Mask))
13 | (pad 3 smd rect (at 2.075 -1.075) (size 1.05 0.65) (layers F.Cu F.Paste F.Mask))
14 | (pad 2 smd rect (at -2.075 1.075) (size 1.05 0.65) (layers F.Cu F.Paste F.Mask))
15 | (pad 4 smd rect (at 2.075 1.075) (size 1.05 0.65) (layers F.Cu F.Paste F.Mask))
16 | )
17 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/PinHeaderStraight1x09_Pitch2.54mm.kicad_mod:
--------------------------------------------------------------------------------
1 | (module PinHeaderStraight1x09_Pitch2.54mm (layer F.Cu) (tedit 5B869AAA)
2 | (descr "Through hole straight pin header, 1x09, 2.54mm pitch, single row")
3 | (tags "Through hole pin header THT 1x09 2.54mm single row")
4 | (fp_text reference J1 (at 0 -2.33) (layer F.SilkS)
5 | (effects (font (size 1 1) (thickness 0.15)))
6 | )
7 | (fp_text value GPIO (at 0 22.65) (layer F.Fab)
8 | (effects (font (size 1 1) (thickness 0.15)))
9 | )
10 | (fp_line (start -1.8 -1.8) (end -1.8 22.1) (layer F.CrtYd) (width 0.05))
11 | (fp_line (start -1.8 22.1) (end 1.8 22.1) (layer F.CrtYd) (width 0.05))
12 | (fp_line (start 1.8 22.1) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05))
13 | (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05))
14 | (fp_text user %R (at 0 10.16 90) (layer F.Fab)
15 | (effects (font (size 1 1) (thickness 0.15)))
16 | )
17 | (pad 1 thru_hole circle (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
18 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
19 | (pad 3 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
20 | (pad 4 thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
21 | (pad 5 thru_hole oval (at 0 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
22 | (pad 6 thru_hole oval (at 0 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
23 | (pad 7 thru_hole oval (at 0 15.24) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
24 | (pad 8 thru_hole oval (at 0 17.78) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
25 | (pad 9 thru_hole oval (at 0 20.32) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
26 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_1x09_Pitch2.54mm.wrl
27 | (at (xyz 0 0 0))
28 | (scale (xyz 1 1 1))
29 | (rotate (xyz 0 0 0))
30 | )
31 | )
32 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/Pin_Header_Straight_1x02_Pitch2.54.kicad_mod:
--------------------------------------------------------------------------------
1 | (module Pin_Header_Straight_1x02_Pitch2.54 (layer F.Cu) (tedit 5981573D)
2 | (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row")
3 | (tags "Through hole pin header THT 1x02 2.54mm single row")
4 | (fp_text reference J1 (at 0 -1.651) (layer F.SilkS)
5 | (effects (font (size 0.5 0.5) (thickness 0.05)))
6 | )
7 | (fp_text value VIN (at 0 4.87) (layer F.Fab)
8 | (effects (font (size 1 1) (thickness 0.15)))
9 | )
10 | (pad 1 thru_hole circle (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
11 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
12 | )
13 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/Pin_Header_Straight_1x04_Pitch2.54.kicad_mod:
--------------------------------------------------------------------------------
1 | (module Pin_Header_Straight_1x04_Pitch2.54 (layer F.Cu) (tedit 59815758)
2 | (descr "Through hole straight pin header, 1x04, 2.54mm pitch, single row")
3 | (tags "Through hole pin header THT 1x04 2.54mm single row")
4 | (fp_text reference J8 (at 0 -2.33) (layer F.SilkS)
5 | (effects (font (size 1 1) (thickness 0.15)))
6 | )
7 | (fp_text value SWD (at 0 9.95) (layer F.Fab)
8 | (effects (font (size 1 1) (thickness 0.15)))
9 | )
10 | (pad 1 thru_hole circle (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
11 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
12 | (pad 3 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
13 | (pad 4 thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
14 | )
15 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/RGB_LED.kicad_mod:
--------------------------------------------------------------------------------
1 | (module RGB_LED (layer F.Cu) (tedit 5A1BA4A5)
2 | (fp_text reference D1 (at 0.4 -1.5) (layer F.SilkS)
3 | (effects (font (size 1 1) (thickness 0.15)))
4 | )
5 | (fp_text value LED_ARGB (at 0.2 -0.2) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_line (start -1.7 0.8) (end 1.7 0.8) (layer F.SilkS) (width 0.08))
9 | (fp_line (start -1.7 -0.8) (end -1.7 0.8) (layer F.SilkS) (width 0.08))
10 | (fp_line (start 1.7 0.8) (end 1.7 -0.8) (layer F.SilkS) (width 0.08))
11 | (fp_line (start 1.7 -0.8) (end -1.7 -0.8) (layer F.SilkS) (width 0.08))
12 | (pad 1 smd rect (at -1 -0.45) (size 1.2 0.55) (layers F.Cu F.Paste F.Mask))
13 | (pad 2 smd rect (at -1 0.45) (size 1.2 0.55) (layers F.Cu F.Paste F.Mask))
14 | (pad 3 smd rect (at 1 0.45) (size 1.2 0.55) (layers F.Cu F.Paste F.Mask))
15 | (pad 4 smd rect (at 1 -0.45) (size 1.2 0.55) (layers F.Cu F.Paste F.Mask))
16 | )
17 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/SMD_0402.kicad_mod:
--------------------------------------------------------------------------------
1 | (module SMD_0402 (layer F.Cu) (tedit 5A684D53)
2 | (fp_text reference REF** (at 0 1.8) (layer F.SilkS)
3 | (effects (font (size 1 1) (thickness 0.15)))
4 | )
5 | (fp_text value SMD_0402 (at 0 -1.8) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_line (start -0.55 0.45) (end 0.55 0.45) (layer F.SilkS) (width 0.08))
9 | (fp_line (start -0.55 -0.45) (end 0.55 -0.45) (layer F.SilkS) (width 0.08))
10 | (pad 1 smd rect (at -0.55 0) (size 0.8 0.7) (layers F.Cu F.Paste F.Mask))
11 | (pad 2 smd rect (at 0.55 0) (size 0.8 0.7) (layers F.Cu F.Paste F.Mask))
12 | )
13 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pretty/SMD_C0402.kicad_mod:
--------------------------------------------------------------------------------
1 | (module SMD_C0402 (layer F.Cu) (tedit 5A68534C)
2 | (fp_text reference C14 (at 0 1.8) (layer F.SilkS)
3 | (effects (font (size 1 1) (thickness 0.15)))
4 | )
5 | (fp_text value 0.8pF (at 0 -1.8) (layer F.Fab)
6 | (effects (font (size 1 1) (thickness 0.15)))
7 | )
8 | (fp_line (start -0.55 0.45) (end 0.55 0.45) (layer F.SilkS) (width 0.08))
9 | (fp_line (start -0.55 -0.45) (end 0.55 -0.45) (layer F.SilkS) (width 0.08))
10 | (pad 1 smd rect (at -0.55 0) (size 0.7 0.7) (layers F.Cu F.Paste F.Mask))
11 | (pad 2 smd rect (at 0.55 0) (size 0.7 0.7) (layers F.Cu F.Paste F.Mask))
12 | )
13 |
--------------------------------------------------------------------------------
/pcb/ver2.2/hackaBLE.pro:
--------------------------------------------------------------------------------
1 | update=9/26/2018 11:42:36 AM
2 | version=1
3 | last_client=kicad
4 | [pcbnew]
5 | version=1
6 | LastNetListRead=
7 | UseCmpFile=1
8 | PadDrill=0.600000000000
9 | PadDrillOvalY=0.600000000000
10 | PadSizeH=1.500000000000
11 | PadSizeV=1.500000000000
12 | PcbTextSizeV=1.500000000000
13 | PcbTextSizeH=1.500000000000
14 | PcbTextThickness=0.300000000000
15 | ModuleTextSizeV=1.000000000000
16 | ModuleTextSizeH=1.000000000000
17 | ModuleTextSizeThickness=0.150000000000
18 | SolderMaskClearance=0.000000000000
19 | SolderMaskMinWidth=0.000000000000
20 | DrawSegmentWidth=0.200000000000
21 | BoardOutlineThickness=0.100000000000
22 | ModuleOutlineThickness=0.150000000000
23 | [cvpcb]
24 | version=1
25 | NetIExt=net
26 | [general]
27 | version=1
28 | [eeschema]
29 | version=1
30 | LibDir=
31 | [eeschema/libraries]
32 | LibName1=hackaBLE-rescue
33 | LibName2=power
34 | LibName3=device
35 | LibName4=transistors
36 | LibName5=conn
37 | LibName6=linear
38 | LibName7=regul
39 | LibName8=74xx
40 | LibName9=cmos4000
41 | LibName10=adc-dac
42 | LibName11=memory
43 | LibName12=xilinx
44 | LibName13=microcontrollers
45 | LibName14=dsp
46 | LibName15=microchip
47 | LibName16=analog_switches
48 | LibName17=motorola
49 | LibName18=texas
50 | LibName19=intel
51 | LibName20=audio
52 | LibName21=interface
53 | LibName22=digital-audio
54 | LibName23=philips
55 | LibName24=display
56 | LibName25=cypress
57 | LibName26=siliconi
58 | LibName27=opto
59 | LibName28=atmel
60 | LibName29=contrib
61 | LibName30=valves
62 | LibName31=hackaBLE
63 |
--------------------------------------------------------------------------------
/programming_guide.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | hackaBLE does not ship with a bootloader, but it is supported in Arduino. Please visit [here](https://github.com/electronut/ElectronutLabs-bluey#Arduino) for details (but select hackaBLE in the board's menu).
4 |
5 | [Here's](https://electronut.in/using-hackable-with-arduino/) a blog article which will help you create a BLE custom characteristic and program it to hackaBLE using Arduino IDE.
6 |
7 | The detailed hackaBLE programming guide comming soon.
8 |
9 | ## Using Web Bluetooth
10 |
11 | You can connect directly to hackaBLE using [Web Bluetooth](https://webbluetoothcg.github.io/web-bluetooth/). For this to work, your browser must support Web Bluetooth. To check list of available browsers, visit this [link](https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API#Browser_compatibility). On Google Chrome, you should have enabled experimental web features by visiting the url :
12 | ```chrome://flags/#enable-experimental-web-platform-features```
13 |
14 | ### Try it here !
15 |
16 | This demo shows temperature and humidity data received over BLE from sensor attached to hackaBLE. You can access the Firmware at this [link](https://gitlab.com/electronutlabs-public/electronutlabs-hackable/tree/master/code/zephyr_ble_th).
17 |
18 |
19 |
20 |
21 |
22 | Temperature :
23 |
24 |
25 |
26 |
27 | Humidity :
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------