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.
OTP.h@4:1f708415c442, 2014-05-13 (annotated)
- Committer:
- piyamate
- Date:
- Tue May 13 13:54:32 2014 +0000
- Revision:
- 4:1f708415c442
- Parent:
- 2:af09cade52df
working !
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| piyamate | 2:af09cade52df | 1 | #include "mbed.h" |
| piyamate | 2:af09cade52df | 2 | |
| piyamate | 2:af09cade52df | 3 | class OTP |
| piyamate | 2:af09cade52df | 4 | { |
| piyamate | 2:af09cade52df | 5 | public: |
| piyamate | 2:af09cade52df | 6 | OTP(PinName PDIO_pin, PinName CLK_pin, PinName CSn_pin, Serial &pc); |
| piyamate | 2:af09cade52df | 7 | void setup(); |
| piyamate | 2:af09cade52df | 8 | void exit(); |
| piyamate | 2:af09cade52df | 9 | void read(); |
| piyamate | 2:af09cade52df | 10 | void write(); |
| piyamate | 2:af09cade52df | 11 | void prog(); |
| piyamate | 2:af09cade52df | 12 | void set_id(uint8_t id); |
| piyamate | 4:1f708415c442 | 13 | void clear_registers(); |
| piyamate | 2:af09cade52df | 14 | |
| piyamate | 2:af09cade52df | 15 | uint32_t factory_section; |
| piyamate | 2:af09cade52df | 16 | uint32_t I2C_A; //I2C address <5:1> |
| piyamate | 2:af09cade52df | 17 | uint32_t CCW; //change increasing/decreasing code with encoder movement |
| piyamate | 2:af09cade52df | 18 | uint32_t Z; //zero position |
| piyamate | 2:af09cade52df | 19 | uint32_t output_md1, output_md0; |
| piyamate | 2:af09cade52df | 20 | uint32_t pwmDIS; |
| piyamate | 2:af09cade52df | 21 | uint32_t MagCompEN; |
| piyamate | 2:af09cade52df | 22 | uint32_t PWMhalfEN_IndexWidth; |
| piyamate | 2:af09cade52df | 23 | |
| piyamate | 2:af09cade52df | 24 | private: |
| piyamate | 4:1f708415c442 | 25 | static const int T_PROG_BURN = 15; |
| piyamate | 4:1f708415c442 | 26 | static const int T_PROG_REFRESH = 200; |
| piyamate | 4:1f708415c442 | 27 | |
| piyamate | 2:af09cade52df | 28 | DigitalInOut PDIO, CLK; |
| piyamate | 2:af09cade52df | 29 | DigitalOut CSn; |
| piyamate | 2:af09cade52df | 30 | Serial pc; |
| piyamate | 2:af09cade52df | 31 | void read_bits(uint32_t *dest, int bit_length); |
| piyamate | 2:af09cade52df | 32 | uint8_t ID_to_I2C_A(uint8_t id); |
| piyamate | 2:af09cade52df | 33 | }; |