-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Examples): Add CLI Library to MSDK (#679)
Co-authored-by: Suraj-Ajjampur <[email protected]> Co-authored-by: Suraj-Ajjampur <[email protected]> Co-authored-by: Scheiffler <[email protected]> Co-authored-by: Jacob Scheiffler <[email protected]> Co-authored-by: Jake Carter <[email protected]>
- Loading branch information
1 parent
fb6d137
commit 7cc3386
Showing
17 changed files
with
1,627 additions
and
607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/****************************************************************************** | ||
* Copyright (C) 2023 Maxim Integrated Products, Inc., All Rights Reserved. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES | ||
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
* OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* Except as contained in this notice, the name of Maxim Integrated | ||
* Products, Inc. shall not be used except as stated in the Maxim Integrated | ||
* Products, Inc. Branding Policy. | ||
* | ||
* The mere transfer of this software does not imply any licenses | ||
* of trade secrets, proprietary technology, copyrights, patents, | ||
* trademarks, maskwork rights, or any other form of intellectual | ||
* property whatsoever. Maxim Integrated Products, Inc. retains all | ||
* ownership rights. | ||
* | ||
******************************************************************************/ | ||
#ifndef EXAMPLES_MAX78000_SDHC_FTHR_INCLUDE_SDHC_H_ | ||
#define EXAMPLES_MAX78000_SDHC_FTHR_INCLUDE_SDHC_H_ | ||
|
||
/***** Includes *****/ | ||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
#include "board.h" | ||
#include "mxc_delay.h" | ||
#include "mxc_device.h" | ||
#include "gpio.h" | ||
#include "uart.h" | ||
#include "ff.h" | ||
|
||
/***** Definitions *****/ | ||
|
||
#define STRINGIFY(x) #x | ||
#define TOSTRING(x) STRINGIFY(x) | ||
#define MAXLEN 256 | ||
|
||
/***** FUNCTION PROTOTYPES *****/ | ||
|
||
void generateMessage(unsigned length); | ||
|
||
int mount(); | ||
|
||
int umount(); | ||
|
||
int formatSDHC(); | ||
|
||
int getSize(); | ||
|
||
int ls(); | ||
|
||
int createFile(char *file_name, unsigned int length); | ||
|
||
int appendFile(char *file_name, unsigned int length); | ||
|
||
int mkdir(char *dir_name); | ||
|
||
int cd(char *dir_name); | ||
|
||
int deleteFile(char *file_name); | ||
|
||
int example(); | ||
|
||
void waitCardInserted(); | ||
|
||
#endif // EXAMPLES_MAX78000_SDHC_FTHR_INCLUDE_SDHC_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/****************************************************************************** | ||
* Copyright (C) 2023 Maxim Integrated Products, Inc., All Rights Reserved. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES | ||
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
* OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* Except as contained in this notice, the name of Maxim Integrated | ||
* Products, Inc. shall not be used except as stated in the Maxim Integrated | ||
* Products, Inc. Branding Policy. | ||
* | ||
* The mere transfer of this software does not imply any licenses | ||
* of trade secrets, proprietary technology, copyrights, patents, | ||
* trademarks, maskwork rights, or any other form of intellectual | ||
* property whatsoever. Maxim Integrated Products, Inc. retains all | ||
* ownership rights. | ||
* | ||
******************************************************************************/ | ||
#ifndef EXAMPLES_MAX78000_SDHC_FTHR_INCLUDE_USER_CLI_H_ | ||
#define EXAMPLES_MAX78000_SDHC_FTHR_INCLUDE_USER_CLI_H_ | ||
|
||
/* -------------------------------------------------- */ | ||
// GLOBAL VARIABLE | ||
/* -------------------------------------------------- */ | ||
extern const command_t user_commands[]; | ||
extern const unsigned int num_user_commands; | ||
|
||
/* -------------------------------------------------- */ | ||
// FUNCTION PROTOTYPES | ||
/* -------------------------------------------------- */ | ||
int handle_size(int argc, char *argv[]); | ||
|
||
int handle_format(int argc, char *argv[]); | ||
|
||
int handle_mount(int argc, char *argv[]); | ||
|
||
int handle_ls(int argc, char *argv[]); | ||
|
||
int handle_mkdir(int argc, char *argv[]); | ||
|
||
int handle_createfile(int argc, char *argv[]); | ||
|
||
int handle_cd(int argc, char *argv[]); | ||
|
||
int handle_add_data(int argc, char *argv[]); | ||
|
||
int handle_del(int argc, char *argv[]); | ||
|
||
int handle_fatfs(int argc, char *argv[]); | ||
|
||
int handle_unmount(int argc, char *argv[]); | ||
|
||
#endif // EXAMPLES_MAX78000_SDHC_FTHR_INCLUDE_USER_CLI_H_ |
Oops, something went wrong.