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@2:def2c045c43a, 2016-12-20 (annotated)
- Committer:
- sgetz7908
- Date:
- Tue Dec 20 14:48:43 2016 +0000
- Revision:
- 2:def2c045c43a
- Child:
- 4:1bfa16834dd4
Initial release to PolyG.; Basic recognition used for testing.;
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 | 2:def2c045c43a | 11 | #define PRESS p3 // Will be shorted to ground when pressed. Need internal pull-up |
sgetz7908 | 2:def2c045c43a | 12 | #define SOUND_ANALOG p1 // Analog signal from opto sensor |
sgetz7908 | 2:def2c045c43a | 13 | #define VDD_ENABLE p0 // Analog voltage on when hi |
sgetz7908 | 2:def2c045c43a | 14 | #define LED p18 // LED on when hi |
sgetz7908 | 2:def2c045c43a | 15 | |
sgetz7908 | 2:def2c045c43a | 16 | // ADC defines |
sgetz7908 | 2:def2c045c43a | 17 | #define ADC_CHAN_BATTERY 0 /* no I/O pin, done internally */ |
sgetz7908 | 2:def2c045c43a | 18 | #define ADC_CHAN_OPTO 2 /* p1 or Analog2 */ |
sgetz7908 | 2:def2c045c43a | 19 | |
sgetz7908 | 2:def2c045c43a | 20 | void delay_ms(uint32_t volatile number_of_ms); |
sgetz7908 | 2:def2c045c43a | 21 | |
sgetz7908 | 2:def2c045c43a | 22 | uint16_t read_battery_voltage(void); |
sgetz7908 | 2:def2c045c43a | 23 | |
sgetz7908 | 2:def2c045c43a | 24 | uint32_t read_clock(void); |
sgetz7908 | 2:def2c045c43a | 25 | void init_clock(uint32_t s); |
sgetz7908 | 2:def2c045c43a | 26 | void set_time_offset(uint32_t s); |
sgetz7908 | 2:def2c045c43a | 27 | uint32_t read_time_correction(void); |
sgetz7908 | 2:def2c045c43a | 28 | |
sgetz7908 | 2:def2c045c43a | 29 | char * uli2a(uint32_t num); |
sgetz7908 | 2:def2c045c43a | 30 | char * char2hex(char c); |
sgetz7908 | 2:def2c045c43a | 31 | char * char2hex(uint32_t n, int digits); |
sgetz7908 | 2:def2c045c43a | 32 | |
sgetz7908 | 2:def2c045c43a | 33 | #endif // #ifndef __HW |