Exportable version of WizziLab's modem driver.

Dependents:   modem_ref_helper

Revision:
23:5553f9541759
Child:
29:9c8c46206eab
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/cup.h	Wed Jan 31 11:34:16 2018 +0000
@@ -0,0 +1,62 @@
+/// @copyright
+/// ========================================================================={{{
+/// Copyright (c) 2012-2013 WizziLab                                           /
+/// All rights reserved                                                        /
+/// =========================================================================}}}
+/// @endcopyright
+
+//  =======================================================================
+/// @file           cup.h
+/// @brief          Code Upgrade public header 
+//  =======================================================================
+
+#ifndef __CUP_H__
+#define __CUP_H__
+
+
+// Delay between a (Valid) START and actual reboot.
+// Should let enough time for responding to the guy that started the CUP.
+#define CUP_REBOOT_DELAY            600
+// CUP Command Codes
+#define CUP_CMD_UPGRADE_UPLOAD      0x10AD
+#define CUP_CMD_UPGRADE_START       0xC0D5
+#define CUP_CMD_UPGRADE_CONFIRMED   0xC0DC
+#define CUP_CMD_UPGRADE_DONE        0xC0DD
+#define CUP_CMD_UPGRADE_FILE_START  0xF105
+#define CUP_CMD_UPGRADE_FILE_END    0xF10E
+#define CUP_CMD_UPGRADE_FAIL        0xFA17
+#define CUP_CMD_UPGRADE_FLASH_ERROR 0xFE44
+
+// STRUCTURES
+//======================================================================
+
+//======================================================================
+// cup_cfg_t
+//----------------------------------------------------------------------
+/// @brief  This is the structure of the CUP Config FILE.
+///         This file _MUST_ always be located a the same place (EEPROM
+///         Origin) as BOOT/CUP access it in a hardcoded way.
+/// !! Do NOT touch this except if you're a CUP Master !!
+//======================================================================
+TYPEDEF_STRUCT_PACKED
+{
+    // The CUP Command
+    u16 cmd;
+    // Number of Archives to be CUP'ed
+    u16 arch_nb;
+    // This field has 2 meanings:
+    // - when read-out it gives start address of CUP-Code file
+    // - when written (for a CUP start) it gives the offset (in bytes) at
+    //   which the first archive is stored in CUP-Code file
+    u32 src_offset;
+    // CRC32 of the arch_nb concatenated archives starting at offset
+    u32 signature;
+    // TODO: Deciphering key
+    u32 key;
+    // Debug / Uart config
+    u32 dbg_cfg;
+} cup_cfg_t;
+
+#endif // __CUP_H__
+/// @}
+// vim:fdm=marker:fdc=2