|
| 1 | +/******************************************************************************* |
| 2 | + ce475 RTSP API header file |
| 3 | +
|
| 4 | + Company: |
| 5 | + Microchip Technology Inc. |
| 6 | +
|
| 7 | + File Name: |
| 8 | + rtsp_api.h |
| 9 | +
|
| 10 | + Summary: |
| 11 | + Flash API function definitions. |
| 12 | +
|
| 13 | + Description: |
| 14 | + This file consists of the definitions for the Flash erase, |
| 15 | + Flash read, Flash page modify and the Flash program fucntions |
| 16 | + that are called in the main.c. |
| 17 | + *******************************************************************************/ |
| 18 | +/******************************************************************************* |
| 19 | +Copyright (c) 2012 released Microchip Technology Inc. All rights reserved. |
| 20 | +
|
| 21 | +Microchip licenses to you the right to use, modify, copy and distribute |
| 22 | +Software only when embedded on a Microchip microcontroller or digital signal |
| 23 | +controller that is integrated into your product or third party product |
| 24 | +(pursuant to the sublicense terms in the accompanying license agreement). |
| 25 | +
|
| 26 | +You should refer to the license agreement accompanying this Software for |
| 27 | +additional information regarding your rights and obligations. |
| 28 | +
|
| 29 | +SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, |
| 30 | +EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF |
| 31 | +MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. |
| 32 | +IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER |
| 33 | +CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR |
| 34 | +OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES |
| 35 | +INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR |
| 36 | +CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF |
| 37 | +SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES |
| 38 | +(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. |
| 39 | + *******************************************************************************/ |
| 40 | +#ifndef _RTSPAPI_H |
| 41 | + #define _RTSPAPI_H |
| 42 | + |
| 43 | +// ***************************************************************************** |
| 44 | +// ***************************************************************************** |
| 45 | +// Section: Included Files |
| 46 | +// ***************************************************************************** |
| 47 | +// ***************************************************************************** |
| 48 | + #include <stdint.h> |
| 49 | + |
| 50 | + #ifdef __cplusplus // Provide C++ Compatability |
| 51 | +extern "C" |
| 52 | +{ |
| 53 | + #endif |
| 54 | + |
| 55 | + // ***************************************************************************** |
| 56 | + // ***************************************************************************** |
| 57 | + // Section: Interface Routines |
| 58 | + // ***************************************************************************** |
| 59 | + // ***************************************************************************** |
| 60 | + /* Flash Memory is organised into ROWs of 64 instructions or 192 bytes. |
| 61 | + RTSP allows the user to erase a PAGE of memory which consists of EIGHT ROWs |
| 62 | + (512 instructions or 1536byts) at a time. |
| 63 | + RTSP allows the user to program a ROW (64 instructions or 192 bytes) at a |
| 64 | + time |
| 65 | + */ |
| 66 | + /****************************************************************************** |
| 67 | + * Function: int16_t FlashPageErase(uint16_t nvmAdru, uint16_t nvmAdr); |
| 68 | + * |
| 69 | + * PreCondition: None |
| 70 | + * |
| 71 | + * Input: nvmAdru - Selects the upper 8bits of the location to program or erase |
| 72 | + in program flash memory |
| 73 | +
|
| 74 | + nvmAdr - Selects the location to program or erase in program flash |
| 75 | + memory. It must be aligned to 512 instruction boundary, |
| 76 | + LSB 10bits of address must be zero |
| 77 | +
|
| 78 | + * |
| 79 | + * Output: None |
| 80 | + * |
| 81 | + * Side Effects: None |
| 82 | + * |
| 83 | + * Overview: This function provides the interface to erase the flash. |
| 84 | + *****************************************************************************/ |
| 85 | + int16_t FlashPageErase( uint16_t nvmAdru, uint16_t nvmAdr ); |
| 86 | + |
| 87 | + /****************************************************************************** |
| 88 | + * Function: int16_t FlashPageRead(uint16_t nvmAdru, uint16_t nvmAdr, int16_t *pageBufPtr); |
| 89 | + * |
| 90 | + * PreCondition: None |
| 91 | + * |
| 92 | + * Input: nvmAdru - Selects the upper 8bits of the location to program or erase |
| 93 | + in program flash memory |
| 94 | +
|
| 95 | + nvmAdr - Selects the location to program or erase in program flash |
| 96 | + memory. It must be aligned to 512 instruction boundary, |
| 97 | + LSB 10bits of address must be zero |
| 98 | + pageBufPtr- Pointer to the data array in which read data will be stored |
| 99 | +
|
| 100 | + * |
| 101 | + * Output: Function returns ERROREE (or -1), if it is not successful, |
| 102 | + Function return ZERO, if successful |
| 103 | + * |
| 104 | + * Side Effects: None |
| 105 | + * |
| 106 | + * Overview: This function provides the interface to read the flash. |
| 107 | + *****************************************************************************/ |
| 108 | + int16_t FlashPageRead( uint16_t nvmAdru, uint16_t nvmAdr, int16_t *pageBufPtr ); |
| 109 | + |
| 110 | + /****************************************************************************** |
| 111 | + * Function: int16_t FlashPageModify(uint16_t row, uint16_t size, int16_t *rowBuf, int16_t *pageBufPtr); |
| 112 | + * |
| 113 | + * PreCondition: None |
| 114 | + * |
| 115 | + * Input: nvmAdru- Selects the upper 8bits of the location to program or erase |
| 116 | + in program flash memory |
| 117 | +
|
| 118 | + nvmAdr- Selects the location to program or erase in program flash |
| 119 | + memory. It must be aligned to 512 instruction boundary, |
| 120 | + LSB 10bits of address must be zero |
| 121 | +
|
| 122 | + rowBuf- Selects the location to read in program flash memory |
| 123 | +
|
| 124 | + pageBufPtr- Pointer to the data array in which read data will be stored |
| 125 | +
|
| 126 | + * |
| 127 | + * Output: Function returns ERROREE (or -1), if it is not successful, |
| 128 | + Function return ZERO, if successful |
| 129 | + * |
| 130 | + * Side Effects: None |
| 131 | + * |
| 132 | + * Overview: This function provides the interface to modify the flash. |
| 133 | + *****************************************************************************/ |
| 134 | + int16_t FlashPageModify( uint16_t row, uint16_t size, int16_t *rowBuf, int16_t *pageBufPtr ); |
| 135 | + |
| 136 | + /****************************************************************************** |
| 137 | + * Function: int16_t FlashPageWrite(uint16_t nvmAdru, uint16_t nvmAdr, int16_t *pageBufPtr); |
| 138 | + * |
| 139 | + * PreCondition: None |
| 140 | + * |
| 141 | + * Input: nvmAdru- Selects the upper 8bits of the location to program or erase |
| 142 | + in program flash memory |
| 143 | +
|
| 144 | + nvmAdr- Selects the location to program or erase in program flash |
| 145 | + memory. It must be aligned to 512 instruction boundary, |
| 146 | + LSB 10bits of address must be zero |
| 147 | +
|
| 148 | + pageBufPtr- Pointer to the data array in which read data will be stored |
| 149 | +
|
| 150 | + * Output: Function returns ERROREE (or -1), if it is not successful, |
| 151 | + Function return ZERO, if successful |
| 152 | + * |
| 153 | + * Side Effects: None |
| 154 | + * |
| 155 | + * Overview: This function provides the interface to write the flash. |
| 156 | + *****************************************************************************/ |
| 157 | + int16_t FlashPageWrite( uint16_t nvmAdru, uint16_t nvmAdr, int16_t *pageBufPtr ); |
| 158 | + |
| 159 | + #ifdef __cplusplus // Provide C++ Compatibility |
| 160 | +} |
| 161 | + |
| 162 | + #endif |
| 163 | +#endif /* _RTSPAPI_H */ |
| 164 | + |
| 165 | +/******************************************************************************* |
| 166 | + End of File |
| 167 | + */ |
0 commit comments