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
hw.h@10:b3553e75eee0, 2017-05-30 (annotated)
- Committer:
- sgetz7908
- Date:
- Tue May 30 21:12:04 2017 +0000
- Revision:
- 10:b3553e75eee0
- Parent:
- 9:0b017e956142
in process of debugging;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sgetz7908 | 2:def2c045c43a | 1 | // |
sgetz7908 | 2:def2c045c43a | 2 | // Hardware definitions for the Nordic eTwist 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 | 2:def2c045c43a | 10 | // Digital I/O lines |
sgetz7908 | 7:090f9eea7b3c | 11 | #define LIGHT_SENSE p3 // Light Sense input |
sgetz7908 | 7:090f9eea7b3c | 12 | #define LIGHT_SENSE_ENABLE p5 // Enable Light Sense Circuit |
sgetz7908 | 7:090f9eea7b3c | 13 | |
sgetz7908 | 7:090f9eea7b3c | 14 | #define CAP_SENSE_LED p2 // Enable Cap Sense LED |
sgetz7908 | 7:090f9eea7b3c | 15 | #define VDD_ENABLE p0 // Analog voltage on when hi |
sgetz7908 | 7:090f9eea7b3c | 16 | #define LED p18 // LED on when hi |
sgetz7908 | 2:def2c045c43a | 17 | |
sgetz7908 | 2:def2c045c43a | 18 | // ADC defines |
sgetz7908 | 2:def2c045c43a | 19 | #define ADC_CHAN_BATTERY 0 /* no I/O pin, done internally */ |
sgetz7908 | 7:090f9eea7b3c | 20 | #define ADC_CHAN_CAP_SENSE 2 /* p1 or Analog2 */ |
sgetz7908 | 2:def2c045c43a | 21 | |
sgetz7908 | 2:def2c045c43a | 22 | void delay_ms(uint32_t volatile number_of_ms); |
sgetz7908 | 2:def2c045c43a | 23 | |
sgetz7908 | 10:b3553e75eee0 | 24 | int adc_read(int chan, int num_readings); |
sgetz7908 | 10:b3553e75eee0 | 25 | int read_battery_voltage(void); |
sgetz7908 | 2:def2c045c43a | 26 | |
sgetz7908 | 9:0b017e956142 | 27 | void set_rtc(uint32_t s); |
sgetz7908 | 9:0b017e956142 | 28 | void update_rtc(uint32_t s); |
sgetz7908 | 9:0b017e956142 | 29 | |
sgetz7908 | 2:def2c045c43a | 30 | uint32_t read_clock(void); |
sgetz7908 | 2:def2c045c43a | 31 | void init_clock(uint32_t s); |
sgetz7908 | 2:def2c045c43a | 32 | void set_time_offset(uint32_t s); |
sgetz7908 | 2:def2c045c43a | 33 | uint32_t read_time_correction(void); |
sgetz7908 | 2:def2c045c43a | 34 | |
sgetz7908 | 2:def2c045c43a | 35 | char * uli2a(uint32_t num); |
sgetz7908 | 2:def2c045c43a | 36 | char * char2hex(char c); |
sgetz7908 | 2:def2c045c43a | 37 | char * char2hex(uint32_t n, int digits); |
sgetz7908 | 2:def2c045c43a | 38 | |
sgetz7908 | 2:def2c045c43a | 39 | #endif // #ifndef __HW |