AM263Px MCU+ SDK: flsopskd.h Source File

| AM263Px MCU+ SDK 26.00.00 |

flsopskd.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2025 Texas Instruments Incorporated
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
49 #ifndef __FLSOPSKD__H__
50 #define __FLSOPSKD__H__
51
52 #ifdef __cplusplus
53 extern "C"
54 {
55 #endif
56
57 #include <stdio.h>
58 #include <stdbool.h>
59 #include <kernel/dpl/HwiP.h>
60 #include <drivers/hw_include/cslr_flsopskd.h>
61
69 #define FLSOPSKD_EXPECTED_FW_VERSION (0x10000U)
70
71 typedef struct FLSOPSKD_Params_s
72 {
73 uint8_t eraseOpCode;
74 uint8_t eraseExOpCode;
75 uint16_t pageSizeInBytes;
76 uint32_t eraseSizeInBytes;
77 uint32_t pollTimeout;
78 } FLSOPSKD_Params;
79
80 typedef struct FLSOPSKD_Handle_s
81 {
82 uint32_t lastOperationXipDowntime;
83 uint32_t lastOperationPollCount;
84 FLSOPSKD_Params params;
85 }FLSOPSKD_Handle;
86
94 uint32_t FLSOPSKD_usrGetTicks();
95
110 int32_t FLSOPSKD_Params_init(FLSOPSKD_Params *pParams);
111
134 int32_t FLSOPSKD_init(FLSOPSKD_Handle *pHandle, FLSOPSKD_Params *pParams);
135
157 int32_t FLSOPSKD_write(FLSOPSKD_Handle *pHandle, uint32_t destAddr, uint8_t * pSrcBuffer, uint32_t bytesToWrite);
158
177 int32_t FLSOPSKD_erase(FLSOPSKD_Handle *pHandle, uint32_t eraseOffsetInBytes);
178
179
188 int32_t FLSOPSKD_getFwVersion(FLSOPSKD_Handle *pHandle, volatile uint32_t *pVersion);
189
197 int32_t FLSOPSKD_busyPoll(FLSOPSKD_Handle *pHandle);
198
212 int32_t FLSOPSKD_perfGetDowntime(FLSOPSKD_Handle *pHandle, uint32_t *memLoc);
213
226 int32_t FLSOPSKD_perfGetPollCounts(FLSOPSKD_Handle *pHandle, uint32_t *memLoc);
227
235 int32_t FLSOPSKD_deinit(FLSOPSKD_Handle *pHandle);
236
237 #endif
238
239 #ifdef __cplusplus
240 }
241 #endif
242
FLSOPSKD_Handle::lastOperationXipDowntime
uint32_t lastOperationXipDowntime
Definition: flsopskd.h:82
FLSOPSKD_Handle
Definition: flsopskd.h:81
FLSOPSKD_Params::eraseSizeInBytes
uint32_t eraseSizeInBytes
Definition: flsopskd.h:76
FLSOPSKD_Params::eraseExOpCode
uint8_t eraseExOpCode
Definition: flsopskd.h:74
FLSOPSKD_usrGetTicks
uint32_t FLSOPSKD_usrGetTicks()
User defined getTicks function.
FLSOPSKD_deinit
int32_t FLSOPSKD_deinit(FLSOPSKD_Handle *pHandle)
Deinit Handle.
FLSOPSKD_init
int32_t FLSOPSKD_init(FLSOPSKD_Handle *pHandle, FLSOPSKD_Params *pParams)
Init the FLSOPSKD IP and driver.
FLSOPSKD_Params::eraseOpCode
uint8_t eraseOpCode
Definition: flsopskd.h:73
FLSOPSKD_Handle::params
FLSOPSKD_Params params
Definition: flsopskd.h:84
FLSOPSKD_Params
Definition: flsopskd.h:72
FLSOPSKD_perfGetDowntime
int32_t FLSOPSKD_perfGetDowntime(FLSOPSKD_Handle *pHandle, uint32_t *memLoc)
Get XIP downtime of last operation.
FLSOPSKD_perfGetPollCounts
int32_t FLSOPSKD_perfGetPollCounts(FLSOPSKD_Handle *pHandle, uint32_t *memLoc)
Get Busy poll status count.
FLSOPSKD_Params::pollTimeout
uint32_t pollTimeout
Definition: flsopskd.h:77
HwiP.h
FLSOPSKD_erase
int32_t FLSOPSKD_erase(FLSOPSKD_Handle *pHandle, uint32_t eraseOffsetInBytes)
Send erase scheduling request.
FLSOPSKD_Handle::lastOperationPollCount
uint32_t lastOperationPollCount
Definition: flsopskd.h:83
FLSOPSKD_Params::pageSizeInBytes
uint16_t pageSizeInBytes
Definition: flsopskd.h:75
FLSOPSKD_write
int32_t FLSOPSKD_write(FLSOPSKD_Handle *pHandle, uint32_t destAddr, uint8_t *pSrcBuffer, uint32_t bytesToWrite)
Sends write scheduling request to hardware IP.
FLSOPSKD_getFwVersion
int32_t FLSOPSKD_getFwVersion(FLSOPSKD_Handle *pHandle, volatile uint32_t *pVersion)
Get Firmware version.
FLSOPSKD_Params_init
int32_t FLSOPSKD_Params_init(FLSOPSKD_Params *pParams)
Init all params.
FLSOPSKD_busyPoll
int32_t FLSOPSKD_busyPoll(FLSOPSKD_Handle *pHandle)
Wait till controller is busy.