Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: nRF51822
Source/hw.h@23:7ca590427f0e, 2019-03-19 (annotated)
- Committer:
- sgetz7908
- Date:
- Tue Mar 19 19:25:39 2019 +0000
- Revision:
- 23:7ca590427f0e
- Parent:
- hw.h@10:b3553e75eee0
- Child:
- 24:761c30334cf4
Saving in progress work of updating code to new Merck Flow Diagram.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sgetz7908 | 2:def2c045c43a | 1 | // |
sgetz7908 | 23:7ca590427f0e | 2 | // Hardware definitions for the Nordic SmartCap Board |
sgetz7908 | 2:def2c045c43a | 3 | // |
sgetz7908 | 2:def2c045c43a | 4 | // SPG 12/13/2016 |
sgetz7908 | 2:def2c045c43a | 5 | // |
sgetz7908 | 2:def2c045c43a | 6 | |
sgetz7908 | 2:def2c045c43a | 7 | #ifndef __HW |
sgetz7908 | 2:def2c045c43a | 8 | #define __HW |
sgetz7908 | 2:def2c045c43a | 9 | |
sgetz7908 | 23:7ca590427f0e | 10 | #if 0 |
sgetz7908 | 23:7ca590427f0e | 11 | // This is used when running on the real SartCap board |
sgetz7908 | 2:def2c045c43a | 12 | // Digital I/O lines |
sgetz7908 | 7:090f9eea7b3c | 13 | #define LIGHT_SENSE p3 // Light Sense input |
sgetz7908 | 7:090f9eea7b3c | 14 | #define LIGHT_SENSE_ENABLE p5 // Enable Light Sense Circuit |
sgetz7908 | 7:090f9eea7b3c | 15 | |
sgetz7908 | 7:090f9eea7b3c | 16 | #define CAP_SENSE_LED p2 // Enable Cap Sense LED |
sgetz7908 | 7:090f9eea7b3c | 17 | #define VDD_ENABLE p0 // Analog voltage on when hi |
sgetz7908 | 7:090f9eea7b3c | 18 | #define LED p18 // LED on when hi |
sgetz7908 | 2:def2c045c43a | 19 | |
sgetz7908 | 2:def2c045c43a | 20 | // ADC defines |
sgetz7908 | 2:def2c045c43a | 21 | #define ADC_CHAN_BATTERY 0 /* no I/O pin, done internally */ |
sgetz7908 | 7:090f9eea7b3c | 22 | #define ADC_CHAN_CAP_SENSE 2 /* p1 or Analog2 */ |
sgetz7908 | 2:def2c045c43a | 23 | |
sgetz7908 | 23:7ca590427f0e | 24 | #else |
sgetz7908 | 23:7ca590427f0e | 25 | // this is used when simulating on a nRF51_DK |
sgetz7908 | 23:7ca590427f0e | 26 | // Digital I/O lines |
sgetz7908 | 23:7ca590427f0e | 27 | #define LIGHT_SENSE p3 // Light Sense input |
sgetz7908 | 23:7ca590427f0e | 28 | #define LIGHT_SENSE_ENABLE p5 // Enable Light Sense Circuit |
sgetz7908 | 23:7ca590427f0e | 29 | |
sgetz7908 | 23:7ca590427f0e | 30 | #define CAP_SENSE_LED p2 // Enable Cap Sense LED |
sgetz7908 | 23:7ca590427f0e | 31 | #define VDD_ENABLE p0 // Analog voltage on when hi |
sgetz7908 | 23:7ca590427f0e | 32 | #define LED p18 // LED on when hi |
sgetz7908 | 23:7ca590427f0e | 33 | |
sgetz7908 | 23:7ca590427f0e | 34 | // ADC defines |
sgetz7908 | 23:7ca590427f0e | 35 | #define ADC_CHAN_BATTERY 0 /* no I/O pin, done internally */ |
sgetz7908 | 23:7ca590427f0e | 36 | #define ADC_CHAN_CAP_SENSE 2 /* p1 or Analog2 */ |
sgetz7908 | 23:7ca590427f0e | 37 | #endif |
sgetz7908 | 23:7ca590427f0e | 38 | |
sgetz7908 | 23:7ca590427f0e | 39 | |
sgetz7908 | 2:def2c045c43a | 40 | void delay_ms(uint32_t volatile number_of_ms); |
sgetz7908 | 2:def2c045c43a | 41 | |
sgetz7908 | 10:b3553e75eee0 | 42 | int adc_read(int chan, int num_readings); |
sgetz7908 | 10:b3553e75eee0 | 43 | int read_battery_voltage(void); |
sgetz7908 | 2:def2c045c43a | 44 | |
sgetz7908 | 9:0b017e956142 | 45 | void set_rtc(uint32_t s); |
sgetz7908 | 9:0b017e956142 | 46 | void update_rtc(uint32_t s); |
sgetz7908 | 9:0b017e956142 | 47 | |
sgetz7908 | 2:def2c045c43a | 48 | uint32_t read_clock(void); |
sgetz7908 | 2:def2c045c43a | 49 | void init_clock(uint32_t s); |
sgetz7908 | 2:def2c045c43a | 50 | void set_time_offset(uint32_t s); |
sgetz7908 | 2:def2c045c43a | 51 | uint32_t read_time_correction(void); |
sgetz7908 | 2:def2c045c43a | 52 | |
sgetz7908 | 2:def2c045c43a | 53 | char * uli2a(uint32_t num); |
sgetz7908 | 2:def2c045c43a | 54 | char * char2hex(char c); |
sgetz7908 | 2:def2c045c43a | 55 | char * char2hex(uint32_t n, int digits); |
sgetz7908 | 2:def2c045c43a | 56 | |
sgetz7908 | 2:def2c045c43a | 57 | #endif // #ifndef __HW |