usbd_dfu_mal.h
Go to the documentation of this file.
1 
28 /* Define to prevent recursive inclusion -------------------------------------*/
29 #ifndef __DFU_MAL_H
30 #define __DFU_MAL_H
31 
32 /* Includes ------------------------------------------------------------------*/
33 #include "usb_conf.h"
34 
35 #include "usbd_conf.h"
36 #include "usbd_dfu_core.h"
37 
38 /* Exported types ------------------------------------------------------------*/
39 typedef struct _DFU_MAL_PROP
40 {
41  const uint8_t* pStrDesc;
42  uint16_t (*pMAL_Init) (void);
43  uint16_t (*pMAL_DeInit) (void);
44  uint16_t (*pMAL_Erase) (uint32_t Add);
45  uint16_t (*pMAL_Write) (uint32_t Add, uint32_t Len);
46  uint8_t *(*pMAL_Read) (uint32_t Add, uint32_t Len);
47  uint16_t (*pMAL_CheckAdd) (uint32_t Add);
48  const uint32_t EraseTiming;
49  const uint32_t WriteTiming;
50 }
52 
53 
54 /* Exported constants --------------------------------------------------------*/
55 #define MAL_OK 0
56 #define MAL_FAIL 1
57 
58 /* utils macro ---------------------------------------------------------------*/
59 #define _1st_BYTE(x) (uint8_t)((x)&0xFF) /* 1st addressing cycle */
60 #define _2nd_BYTE(x) (uint8_t)(((x)&0xFF00)>>8) /* 2nd addressing cycle */
61 #define _3rd_BYTE(x) (uint8_t)(((x)&0xFF0000)>>16) /* 3rd addressing cycle */
62 #define _4th_BYTE(x) (uint8_t)(((x)&0xFF000000)>>24) /* 4th addressing cycle */
63 
64 /* Exported macro ------------------------------------------------------------*/
65 #define SET_POLLING_TIMING(x) buffer[1] = _1st_BYTE(x);\
66  buffer[2] = _2nd_BYTE(x);\
67  buffer[3] = _3rd_BYTE(x);
68 
69 /* Exported functions ------------------------------------------------------- */
70 
71 uint16_t MAL_Init (void);
72 uint16_t MAL_DeInit (void);
73 uint16_t MAL_Erase (uint32_t SectorAddress);
74 uint16_t MAL_Write (uint32_t SectorAddress, uint32_t DataLength);
75 uint8_t *MAL_Read (uint32_t SectorAddress, uint32_t DataLength);
76 uint16_t MAL_GetStatus(uint32_t SectorAddress ,uint8_t Cmd, uint8_t *buffer);
77 
78 extern uint8_t MAL_Buffer[XFERSIZE]; /* RAM Buffer for Downloaded Data */
79 #endif /* __DFU_MAL_H */
80 
81 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
struct _DFU_MAL_PROP DFU_MAL_Prop_TypeDef
uint16_t(* pMAL_CheckAdd)(uint32_t Add)
Definition: usbd_dfu_mal.h:47
uint16_t MAL_DeInit(void)
MAL_DeInit DeInitializes the Media on the STM32.
Definition: usbd_dfu_mal.c:118
uint16_t(* pMAL_DeInit)(void)
Definition: usbd_dfu_mal.h:43
static uint8_t buffer[BMP280_DATA_FRAME_SIZE]
Definition: drv_bmp280.c:61
header file for the usbd_dfu_core.c file.
uint8_t MAL_Buffer[XFERSIZE]
Definition: usbd_dfu_mal.c:83
uint16_t(* pMAL_Erase)(uint32_t Add)
Definition: usbd_dfu_mal.h:44
uint16_t MAL_Write(uint32_t SectorAddress, uint32_t DataLength)
MAL_Write Write sectors of memory.
Definition: usbd_dfu_mal.c:176
const uint32_t WriteTiming
Definition: usbd_dfu_mal.h:49
uint16_t MAL_Init(void)
MAL_Init Initializes the Media on the STM32.
Definition: usbd_dfu_mal.c:95
uint16_t(* pMAL_Write)(uint32_t Add, uint32_t Len)
Definition: usbd_dfu_mal.h:45
const uint8_t * pStrDesc
Definition: usbd_dfu_mal.h:41
uint16_t MAL_GetStatus(uint32_t SectorAddress, uint8_t Cmd, uint8_t *buffer)
MAL_GetStatus Get the status of a given memory.
Definition: usbd_dfu_mal.c:241
General low level driver configuration.
USB Device configuration file.
uint16_t MAL_Erase(uint32_t SectorAddress)
MAL_Erase Erase a sector of memory.
Definition: usbd_dfu_mal.c:141
const uint32_t EraseTiming
Definition: usbd_dfu_mal.h:48
uint16_t(* pMAL_Init)(void)
Definition: usbd_dfu_mal.h:42
uint8_t * MAL_Read(uint32_t SectorAddress, uint32_t DataLength)
MAL_Read Read sectors of memory.
Definition: usbd_dfu_mal.c:211


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:20