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
- Committer:
- piyamate
- Date:
- 2014-05-13
- Revision:
- 4:1f708415c442
- Parent:
- 2:af09cade52df
File content as of revision 4:1f708415c442:
#include "mbed.h"
class OTP
{
public:
OTP(PinName PDIO_pin, PinName CLK_pin, PinName CSn_pin, Serial &pc);
void setup();
void exit();
void read();
void write();
void prog();
void set_id(uint8_t id);
void clear_registers();
uint32_t factory_section;
uint32_t I2C_A; //I2C address <5:1>
uint32_t CCW; //change increasing/decreasing code with encoder movement
uint32_t Z; //zero position
uint32_t output_md1, output_md0;
uint32_t pwmDIS;
uint32_t MagCompEN;
uint32_t PWMhalfEN_IndexWidth;
private:
static const int T_PROG_BURN = 15;
static const int T_PROG_REFRESH = 200;
DigitalInOut PDIO, CLK;
DigitalOut CSn;
Serial pc;
void read_bits(uint32_t *dest, int bit_length);
uint8_t ID_to_I2C_A(uint8_t id);
};