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@26:a577c4b69fe0, 2019-04-15 (annotated)
- Committer:
- sgetz7908
- Date:
- Mon Apr 15 18:46:57 2019 +0000
- Revision:
- 26:a577c4b69fe0
- Parent:
- 24:761c30334cf4
- Child:
- 30:76b51e525c40
Added all functions required by Merck Flow Diagram.; Still needs testing.;
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 | 24:761c30334cf4 | 11 | // This is used when running on the real SartCap board |
| sgetz7908 | 24:761c30334cf4 | 12 | // Digital I/O lines |
| sgetz7908 | 24:761c30334cf4 | 13 | #define LIGHT_SENSE p3 // Light Sense input |
| sgetz7908 | 24:761c30334cf4 | 14 | #define LIGHT_SENSE_ENABLE p5 // Enable Light Sense Circuit |
| sgetz7908 | 24:761c30334cf4 | 15 | |
| sgetz7908 | 24:761c30334cf4 | 16 | #define CAP_SENSE_LED p2 // Enable Cap Sense LED |
| sgetz7908 | 24:761c30334cf4 | 17 | #define VDD_ENABLE p0 // Analog voltage on when hi |
| sgetz7908 | 24:761c30334cf4 | 18 | #define LED p18 // LED on when hi |
| sgetz7908 | 24:761c30334cf4 | 19 | |
| sgetz7908 | 24:761c30334cf4 | 20 | // ADC defines |
| sgetz7908 | 24:761c30334cf4 | 21 | #define ADC_CHAN_BATTERY 0 /* no I/O pin, done internally */ |
| sgetz7908 | 24:761c30334cf4 | 22 | #define ADC_CHAN_CAP_SENSE 2 /* p1 or Analog2 */ |
| sgetz7908 | 24:761c30334cf4 | 23 | #define ADC_CHAN_LIGHT_SENSE 4 |
| sgetz7908 | 23:7ca590427f0e | 24 | #else |
| sgetz7908 | 24:761c30334cf4 | 25 | // this is used when simulating on a nRF51_DK |
| sgetz7908 | 24:761c30334cf4 | 26 | // Digital I/O lines |
| sgetz7908 | 24:761c30334cf4 | 27 | #define LIGHT_SENSE p3 // Light Sense input |
| sgetz7908 | 24:761c30334cf4 | 28 | #define LIGHT_SENSE_ENABLE p5 // Enable Light Sense Circuit |
| sgetz7908 | 24:761c30334cf4 | 29 | |
| sgetz7908 | 24:761c30334cf4 | 30 | #define CAP_SENSE_LED p2 // Enable Cap Sense LED |
| sgetz7908 | 24:761c30334cf4 | 31 | #define VDD_ENABLE p0 // Analog voltage on when hi |
| sgetz7908 | 24:761c30334cf4 | 32 | #define LED p18 // LED on when hi |
| sgetz7908 | 24:761c30334cf4 | 33 | |
| sgetz7908 | 24:761c30334cf4 | 34 | // ADC defines |
| sgetz7908 | 24:761c30334cf4 | 35 | #define ADC_CHAN_BATTERY 0 /* no I/O pin, done internally */ |
| sgetz7908 | 24:761c30334cf4 | 36 | #define ADC_CHAN_CAP_SENSE 2 /* p1 or Analog2 */ |
| sgetz7908 | 24:761c30334cf4 | 37 | #define ADC_CHAN_LIGHT_SENSE 4 |
| sgetz7908 | 23:7ca590427f0e | 38 | #endif |
| sgetz7908 | 23:7ca590427f0e | 39 | |
| sgetz7908 | 23:7ca590427f0e | 40 | |
| sgetz7908 | 2:def2c045c43a | 41 | void delay_ms(uint32_t volatile number_of_ms); |
| sgetz7908 | 2:def2c045c43a | 42 | |
| sgetz7908 | 10:b3553e75eee0 | 43 | int adc_read(int chan, int num_readings); |
| sgetz7908 | 10:b3553e75eee0 | 44 | int read_battery_voltage(void); |
| sgetz7908 | 2:def2c045c43a | 45 | |
| sgetz7908 | 26:a577c4b69fe0 | 46 | //void set_rtc(uint32_t s); |
| sgetz7908 | 9:0b017e956142 | 47 | void update_rtc(uint32_t s); |
| sgetz7908 | 9:0b017e956142 | 48 | |
| sgetz7908 | 2:def2c045c43a | 49 | uint32_t read_clock(void); |
| sgetz7908 | 26:a577c4b69fe0 | 50 | //void init_clock(uint32_t s); |
| sgetz7908 | 2:def2c045c43a | 51 | void set_time_offset(uint32_t s); |
| sgetz7908 | 2:def2c045c43a | 52 | uint32_t read_time_correction(void); |
| sgetz7908 | 2:def2c045c43a | 53 | |
| sgetz7908 | 2:def2c045c43a | 54 | char * uli2a(uint32_t num); |
| sgetz7908 | 2:def2c045c43a | 55 | char * char2hex(char c); |
| sgetz7908 | 2:def2c045c43a | 56 | char * char2hex(uint32_t n, int digits); |
| sgetz7908 | 2:def2c045c43a | 57 | |
| sgetz7908 | 2:def2c045c43a | 58 | #endif // #ifndef __HW |