|
| 1 | +/******************************************************************************* |
| 2 | + ce409 RTSP API header file |
| 3 | +
|
| 4 | + Company: |
| 5 | + Microchip Technology Inc. |
| 6 | +
|
| 7 | + File Name: |
| 8 | + rtspapi.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 | + #include <xc.h> |
| 50 | + |
| 51 | + #ifdef __cplusplus // Provide C++ Compatability |
| 52 | +extern "C" |
| 53 | +{ |
| 54 | + #endif |
| 55 | + |
| 56 | + // ***************************************************************************** |
| 57 | + // ***************************************************************************** |
| 58 | + // Section: Interface Routines |
| 59 | + // ***************************************************************************** |
| 60 | + // ***************************************************************************** |
| 61 | + /* Flash Memory is organised into ROWs of 128 instructions or 256 bytes. |
| 62 | + RTSP allows the user to erage a PAGE of memory which consists of EIGHT ROWs |
| 63 | + (512 instructions or 1024byts) at a time. |
| 64 | + RTSP allows the user to program a ROW (128 instructions or 192 bytes) at a |
| 65 | + time |
| 66 | +*/ |
| 67 | + // ***************************************************************************** |
| 68 | + /****************************************************************************** |
| 69 | +* Function: int16_t FlashPageErase(uint16_t nvmAdru, uint16_t nvmAdr) |
| 70 | +* |
| 71 | +* PreCondition: None |
| 72 | +* |
| 73 | +* Input: nvmAdru - Selects the upper 8bits of the location to program or erase |
| 74 | +* in program flash memory |
| 75 | +* nvmAdr - Selects the location to program or erase in program flash |
| 76 | +* memory. It must be aligned to 512 instruction boundary, |
| 77 | +* LSB 10bits of address must be zero |
| 78 | +* |
| 79 | +* Output: returns ERROREE (or -1), if it is not successful, |
| 80 | +* returns ZERO, if successful |
| 81 | +* |
| 82 | +* Overview: This function provides the interface to erase the flash. |
| 83 | +* |
| 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 | +* nvmAdr - Selects the location to program or erase in program flash |
| 95 | +* memory. It must be aligned to 512 instruction boundary, |
| 96 | +* LSB 10bits of address must be zero |
| 97 | +* pageBufPtr - Pointer to the data array in which read data will be stored |
| 98 | +* |
| 99 | +* Output: returns ERROREE (or -1), if it is not successful, |
| 100 | +* returns ZERO, if successful |
| 101 | +* |
| 102 | +* Overview: This function provides the interface to read the flash. |
| 103 | +* |
| 104 | +*******************************************************************************/ |
| 105 | + int16_t FlashPageRead( uint16_t nvmAdru, uint16_t nvmAdr, int16_t *pageBufPtr ); |
| 106 | + |
| 107 | + /****************************************************************************** |
| 108 | +* Function: int16_t FlashPageModify(uint16_t row, uint16_t size, |
| 109 | +* int16_t *rowBuf, int16_t *pageBufPtr) |
| 110 | +* |
| 111 | +* PreCondition: None |
| 112 | +* |
| 113 | +* Input: nvmAdru - Selects the upper 8bits of the location to program or erase |
| 114 | +* in program flash memory |
| 115 | +* nvmAdr - Selects the location to program or erase in program flash |
| 116 | +* memory. It must be aligned to 512 instruction boundary, |
| 117 | +* LSB 10bits of address must be zero |
| 118 | +* rowBuf - Selects the location to read in program flash memory |
| 119 | +* pageBufPtr - Pointer to the data array in which read data will be stored |
| 120 | +* |
| 121 | +* Output: returns ERROREE (or -1), if it is not successful, |
| 122 | +* returns ZERO, if successful |
| 123 | +* |
| 124 | +* Overview: This function provides the interface to read the flash. |
| 125 | +* |
| 126 | +*******************************************************************************/ |
| 127 | + int16_t FlashPageModify( uint16_t row, uint16_t size, int16_t *rowBuf, int16_t *pageBufPtr ); |
| 128 | + |
| 129 | + /****************************************************************************** |
| 130 | +* Function:int16_t FlashPageWrite(uint16_t nvmAdru, uint16_t nvmAdr, int16_t *pageBufPtr) |
| 131 | +* |
| 132 | +* PreCondition: None |
| 133 | +* |
| 134 | +* Input: nvmAdru - Selects the upper 8bits of the location to program or erase |
| 135 | +* in program flash memory |
| 136 | +* nvmAdr - Selects the location to program or erase in program flash |
| 137 | +* memory. It must be aligned to 512 instruction boundary, |
| 138 | +* LSB 10bits of address must be zero |
| 139 | +* pageBufPtr - Pointer to the data array from which data will be written |
| 140 | +* |
| 141 | +* Output: returns ERROREE (or -1), if it is not successful, |
| 142 | +* returns ZERO, if successful |
| 143 | +* |
| 144 | +* Overview: This function provides the interface to write the flash. |
| 145 | +* |
| 146 | +*******************************************************************************/ |
| 147 | + int16_t FlashPageWrite( uint16_t nvmAdru, uint16_t nvmAdr, int16_t *pageBufPtr ); |
| 148 | + |
| 149 | + #ifdef __cplusplus // Provide C++ Compatibility |
| 150 | +} |
| 151 | + |
| 152 | + #endif |
| 153 | +#endif /* _RTSPAPI_H */ |
| 154 | + |
| 155 | +/******************************************************************************* |
| 156 | + End of File |
| 157 | +*/ |
0 commit comments