PX4 Firmware
PX4 Autopilot Software http://px4.io
otp.c File Reference

otp estimation More...

#include <px4_platform_common/px4_config.h>
#include <board_config.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <string.h>
#include "conversions.h"
#include "otp.h"
#include "err.h"
#include <assert.h>
Include dependency graph for otp.c:

Go to the source code of this file.

Functions

int val_read (void *dest, volatile const void *src, int bytes)
 
int write_otp (uint8_t id_type, uint32_t vid, uint32_t pid, char *signature)
 
int lock_otp (void)
 
static int F_GetStatus (void)
 
void F_unlock (void)
 
void F_lock (void)
 
int F_write_word (unsigned long Address, uint32_t Data)
 
int F_write_byte (unsigned long Address, uint8_t Data)
 

Detailed Description

otp estimation

Author
Lorenz Meier lm@in.nosp@m.f.et.nosp@m.hz.ch
David "Buzz" Bussenschutt david.nosp@m.buzz.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

Definition in file otp.c.

Function Documentation

◆ F_GetStatus()

static int F_GetStatus ( void  )
static

Definition at line 151 of file otp.c.

References F_BSY, F_BUSY, F_COMPLETE, F_ERROR_OPERATION, F_ERROR_PROGRAM, F_ERROR_WRP, F_OPERR, F_WRPERR, and FLASH.

Referenced by F_write_byte().

Here is the caller graph for this function:

◆ F_lock()

void F_lock ( void  )

Definition at line 182 of file otp.c.

References F_CR_LOCK, and FLASH.

◆ F_unlock()

void F_unlock ( void  )

Definition at line 173 of file otp.c.

References F_CR_LOCK, F_KEY1, F_KEY2, and FLASH.

◆ F_write_byte()

int F_write_byte ( unsigned long  Address,
uint8_t  Data 
)

Definition at line 203 of file otp.c.

References CR_PSIZE_MASK, F_BUSY, F_COMPLETE, F_CR_PG, F_GetStatus(), F_PSIZE_BYTE, FLASH, IS_F_ADDRESS, and status.

Referenced by F_write_word(), lock_otp(), and write_otp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ F_write_word()

int F_write_word ( unsigned long  Address,
uint32_t  Data 
)

Definition at line 188 of file otp.c.

References F_write_byte().

Referenced by write_otp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lock_otp()

int lock_otp ( void  )

Definition at line 121 of file otp.c.

References ADDR_OTP_LOCK_START, F_write_byte(), and OTP_LOCK_LOCKED.

Here is the call graph for this function:

◆ val_read()

int val_read ( void *  dest,
volatile const void *  src,
int  bytes 
)

Definition at line 58 of file otp.c.

◆ write_otp()

int write_otp ( uint8_t  id_type,
uint32_t  vid,
uint32_t  pid,
char *  signature 
)

Definition at line 71 of file otp.c.

References ADDR_OTP_START, F_write_byte(), F_write_word(), and warnx.

Here is the call graph for this function: