Classes | Macros | Typedefs | Enumerations | Functions | Variables
yprog.h File Reference
#include "ydef.h"
#include "yproto.h"
Include dependency graph for yprog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BootloaderSt
 
struct  byn_head_multi
 
struct  byn_head_sign
 
struct  byn_head_v4
 
struct  byn_head_v5
 
struct  byn_head_v6
 
struct  byn_zone
 
struct  FIRMWARE_CONTEXT
 
struct  flashzone
 
struct  newmemzones
 
struct  romzone
 

Macros

#define BLOCK_FLASH_TIMEOUT   4000u
 
#define BYN_HEAD_SIZE_V4   (sizeof(byn_head_sign)+sizeof(byn_head_v4))
 
#define BYN_HEAD_SIZE_V5   (sizeof(byn_head_sign)+sizeof(byn_head_v5))
 
#define BYN_HEAD_SIZE_V6   (sizeof(byn_head_sign)+sizeof(byn_head_v6))
 
#define BYN_MD5_OFS_V6   (sizeof(byn_head_sign)+16)
 
#define BYN_REV_V4   4
 
#define BYN_REV_V5   5
 
#define BYN_REV_V6   6
 
#define BYN_SIGN   ((u32) ('B'| ((u16)'Y'<<8) | ((u32)'N'<<16) ))
 
#define decode_byn_head_multi(dummy)   {}
 
#define decode_byn_zone(dummy)   {}
 
#define DECODE_U16(NUM)   (NUM)
 
#define DECODE_U32(NUM)   (NUM)
 
#define FLASH_ERRMSG_LEN   YOCTO_ERRMSG_LEN
 
#define FLASH_NB_REBOOT_RETRY   1
 
#define FLASH_SUBDEV_TIMEOUT   59000u
 
#define INVALID_FIRMWARE   0xfffffffful
 
#define MAX_FIRMWARE_LEN   0x100000ul
 
#define MAX_FLASH_ZONES_PER_FILES   4
 
#define MAX_ROM_ZONES_PER_FILES   16
 
#define PROG_GET_INFO_TIMEOUT   10000u
 
#define PROG_IN_ERROR   0x8000
 
#define PROG_SUBDEV
 
#define uGetFirmware(ofs, dst, size)   yGetFirmware(ofs, dst, size)
 
#define uGetFirmwareBynHead(head_ptr)   {uGetFirmware(0, (u8*)(head_ptr), sizeof(byn_head_multi));decode_byn_head_multi(head_ptr);}
 
#define uGetFirmwareBynZone(offset, zone_ptr)   {uGetFirmware(offset,(u8*)(zone_ptr),sizeof(byn_zone)); decode_byn_zone(zone_ptr);}
 
#define USE_V6_BYN_FILE
 
#define YPROG_BOOTLOADER_TIMEOUT   20000u
 
#define YPROG_FORCE_FW_UPDATE   1u
 
#define ZONE_VERIF_TIMEOUT   4000u
 

Typedefs

typedef yInterfaceSt ProgIface
 

Enumerations

enum  FLASH_DEVICE_STATE {
  FLASH_FIND_DEV = 0, FLASH_CONNECT, FLASH_GET_INFO, FLASH_VALIDATE_BYN,
  FLASH_ERASE, FLASH_WAIT_ERASE, FLASH_DOFLASH, FLASH_GET_INFO_BFOR_REBOOT,
  FLASH_REBOOT, FLASH_REBOOT_VALIDATE, FLASH_AUTOFLASH, FLASH_SUCCEEDED,
  FLASH_DISCONNECT, FLASH_DONE
}
 
enum  FLASH_ZONE_STATE { FLASH_ZONE_START, FLASH_ZONE_PROG, FLASH_ZONE_READ, FLASH_ZONE_RECV_OK }
 
enum  YPROG_RESULT { YPROG_DONE = 0u, YPROG_WAITING }
 

Functions

int BlockingRead (BootloaderSt *dev, USB_Packet *pkt, int maxwait, char *errmsg)
 
int IsValidBynFile (const byn_head_multi *head, u32 size, const char *serial, u16 flags, char *errmsg)
 
int IsValidBynHead (const byn_head_multi *head, u32 size, u16 flags, char *errmsg)
 
const char * prog_GetCPUName (BootloaderSt *dev)
 
int SendDataPacket (BootloaderSt *dev, int program, u32 address, u8 *data, int nbinstr, char *errmsg)
 
YPROG_RESULT uFlashDevice (void)
 
int ValidateBynCompat (const byn_head_multi *head, u32 size, const char *serial, u16 flags, BootloaderSt *dev, char *errmsg)
 
YRETCODE yapiCheckFirmware_internal (const char *serial, const char *rev, u32 flags, const char *path, char *buffer, int buffersize, int *fullsize, char *errmsg)
 
YRETCODE yapiGetBootloadersDevs (char *serials, unsigned int maxNbSerial, unsigned int *totalBootladers, char *errmsg)
 
YRETCODE yapiUpdateFirmware_internal (const char *serial, const char *firmwarePath, const char *settings, int force, int startUpdate, char *msg)
 
int yNetHubGetBootloaders (const char *hubserial, char *buffer, char *errmsg)
 
int ypBootloaderShutdown (BootloaderSt *dev)
 
int ypGetBootloaderReply (BootloaderSt *dev, USB_Packet *pkt, char *errmsg)
 
int ypIsSendBootloaderBusy (BootloaderSt *dev)
 
void yProgFree (void)
 
void yProgInit (void)
 
int ypSendBootloaderCmd (BootloaderSt *dev, const USB_Packet *pkt, char *errmsg)
 

Variables

FIRMWARE_CONTEXT fctx
 
BootloaderSt firm_dev
 
USB_Packet firm_pkt
 

Macro Definition Documentation

#define BLOCK_FLASH_TIMEOUT   4000u

Definition at line 255 of file yprog.h.

#define BYN_HEAD_SIZE_V4   (sizeof(byn_head_sign)+sizeof(byn_head_v4))

Definition at line 120 of file yprog.h.

#define BYN_HEAD_SIZE_V5   (sizeof(byn_head_sign)+sizeof(byn_head_v5))

Definition at line 121 of file yprog.h.

#define BYN_HEAD_SIZE_V6   (sizeof(byn_head_sign)+sizeof(byn_head_v6))

Definition at line 122 of file yprog.h.

#define BYN_MD5_OFS_V6   (sizeof(byn_head_sign)+16)

Definition at line 123 of file yprog.h.

#define BYN_REV_V4   4

Definition at line 59 of file yprog.h.

#define BYN_REV_V5   5

Definition at line 60 of file yprog.h.

#define BYN_REV_V6   6

Definition at line 61 of file yprog.h.

#define BYN_SIGN   ((u32) ('B'| ((u16)'Y'<<8) | ((u32)'N'<<16) ))

Definition at line 58 of file yprog.h.

#define decode_byn_head_multi (   dummy)    {}

Definition at line 136 of file yprog.h.

#define decode_byn_zone (   dummy)    {}

Definition at line 137 of file yprog.h.

#define DECODE_U16 (   NUM)    (NUM)

Definition at line 138 of file yprog.h.

#define DECODE_U32 (   NUM)    (NUM)

Definition at line 139 of file yprog.h.

#define FLASH_ERRMSG_LEN   YOCTO_ERRMSG_LEN

Definition at line 265 of file yprog.h.

#define FLASH_NB_REBOOT_RETRY   1

Definition at line 224 of file yprog.h.

#define FLASH_SUBDEV_TIMEOUT   59000u

Definition at line 258 of file yprog.h.

#define INVALID_FIRMWARE   0xfffffffful

Definition at line 223 of file yprog.h.

#define MAX_FIRMWARE_LEN   0x100000ul

Definition at line 222 of file yprog.h.

#define MAX_FLASH_ZONES_PER_FILES   4

Definition at line 56 of file yprog.h.

#define MAX_ROM_ZONES_PER_FILES   16

Definition at line 55 of file yprog.h.

#define PROG_GET_INFO_TIMEOUT   10000u

Definition at line 256 of file yprog.h.

#define PROG_IN_ERROR   0x8000

Definition at line 269 of file yprog.h.

#define PROG_SUBDEV

Definition at line 52 of file yprog.h.

#define uGetFirmware (   ofs,
  dst,
  size 
)    yGetFirmware(ofs, dst, size)

Definition at line 309 of file yprog.h.

#define uGetFirmwareBynHead (   head_ptr)    {uGetFirmware(0, (u8*)(head_ptr), sizeof(byn_head_multi));decode_byn_head_multi(head_ptr);}

Definition at line 318 of file yprog.h.

#define uGetFirmwareBynZone (   offset,
  zone_ptr 
)    {uGetFirmware(offset,(u8*)(zone_ptr),sizeof(byn_zone)); decode_byn_zone(zone_ptr);}

Definition at line 319 of file yprog.h.

#define USE_V6_BYN_FILE

Definition at line 68 of file yprog.h.

#define YPROG_BOOTLOADER_TIMEOUT   20000u

Definition at line 259 of file yprog.h.

#define YPROG_FORCE_FW_UPDATE   1u

Definition at line 260 of file yprog.h.

#define ZONE_VERIF_TIMEOUT   4000u

Definition at line 257 of file yprog.h.

Typedef Documentation

Definition at line 48 of file yprog.h.

Enumeration Type Documentation

Enumerator
FLASH_FIND_DEV 
FLASH_CONNECT 
FLASH_GET_INFO 
FLASH_VALIDATE_BYN 
FLASH_ERASE 
FLASH_WAIT_ERASE 
FLASH_DOFLASH 
FLASH_GET_INFO_BFOR_REBOOT 
FLASH_REBOOT 
FLASH_REBOOT_VALIDATE 
FLASH_AUTOFLASH 
FLASH_SUCCEEDED 
FLASH_DISCONNECT 
FLASH_DONE 

Definition at line 226 of file yprog.h.

Enumerator
FLASH_ZONE_START 
FLASH_ZONE_PROG 
FLASH_ZONE_READ 
FLASH_ZONE_RECV_OK 

Definition at line 247 of file yprog.h.

Enumerator
YPROG_DONE 
YPROG_WAITING 

Definition at line 215 of file yprog.h.

Function Documentation

int BlockingRead ( BootloaderSt dev,
USB_Packet pkt,
int  maxwait,
char *  errmsg 
)

Definition at line 423 of file yprog.c.

int IsValidBynFile ( const byn_head_multi head,
u32  size,
const char *  serial,
u16  flags,
char *  errmsg 
)

Definition at line 328 of file yprog.c.

int IsValidBynHead ( const byn_head_multi head,
u32  size,
u16  flags,
char *  errmsg 
)

Definition at line 243 of file yprog.c.

const char* prog_GetCPUName ( BootloaderSt dev)

Definition at line 120 of file yprog.c.

int SendDataPacket ( BootloaderSt dev,
int  program,
u32  address,
u8 *  data,
int  nbinstr,
char *  errmsg 
)

Definition at line 436 of file yprog.c.

YPROG_RESULT uFlashDevice ( void  )

Definition at line 1047 of file yprog.c.

int ValidateBynCompat ( const byn_head_multi head,
u32  size,
const char *  serial,
u16  flags,
BootloaderSt dev,
char *  errmsg 
)

Definition at line 314 of file yprog.c.

YRETCODE yapiCheckFirmware_internal ( const char *  serial,
const char *  rev,
u32  flags,
const char *  path,
char *  buffer,
int  buffersize,
int *  fullsize,
char *  errmsg 
)

Definition at line 2333 of file yprog.c.

YRETCODE yapiGetBootloadersDevs ( char *  serials,
unsigned int  maxNbSerial,
unsigned int *  totalBootladers,
char *  errmsg 
)

Definition at line 3541 of file yapi.c.

YRETCODE yapiUpdateFirmware_internal ( const char *  serial,
const char *  firmwarePath,
const char *  settings,
int  force,
int  startUpdate,
char *  msg 
)

Definition at line 2362 of file yprog.c.

int yNetHubGetBootloaders ( const char *  hubserial,
char *  buffer,
char *  errmsg 
)

Definition at line 1420 of file yprog.c.

int ypBootloaderShutdown ( BootloaderSt dev)
int ypGetBootloaderReply ( BootloaderSt dev,
USB_Packet pkt,
char *  errmsg 
)

Definition at line 403 of file yprog.c.

int ypIsSendBootloaderBusy ( BootloaderSt dev)

Definition at line 388 of file yprog.c.

void yProgFree ( void  )

Definition at line 88 of file yprog.c.

void yProgInit ( void  )

Definition at line 76 of file yprog.c.

int ypSendBootloaderCmd ( BootloaderSt dev,
const USB_Packet pkt,
char *  errmsg 
)

Definition at line 396 of file yprog.c.

Variable Documentation

Definition at line 64 of file yprog.c.

BootloaderSt firm_dev

Definition at line 67 of file yprog.c.

USB_Packet firm_pkt

Definition at line 68 of file yprog.c.



yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:13