Skip to content

Commit

Permalink
Merge branch 'dev/me13b_me55-examples' into dev/me55-release
Browse files Browse the repository at this point in the history
  • Loading branch information
sihyung-maxim committed Jan 23, 2024
2 parents b7a733f + fd6ab4f commit 7b351b1
Show file tree
Hide file tree
Showing 39 changed files with 3,280 additions and 220 deletions.
63 changes: 29 additions & 34 deletions Libraries/Boards/MAX32572/EvKit_V1/Include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ extern "C" {
#define CONSOLE_BAUD 115200 /// Console baud rate
#endif

#ifndef MX25_BAUD
#define MX25_BAUD 3000000
#endif
#define EXT_FLASH_SPIXFC_BAUD 3000000
#define EXT_FLASH_SPIXFM_BAUD 24000000

// #define MX25_SPI MXC_SPIXC
// #define MX25_SSEL 0
// // #define SPI_CHAR_BITS 8
#define SPIXFC_CMD_VAL 0x0B
#define SPIXFM_BUS_IDLE_VAL 0x1000

// const spixc_cfg_t mx25_spixc_cfg;
#define TS_I2C MXC_I2C0
#define TS_I2C_FREQ MXC_I2C_STD_MODE
#define TS_I2C_TARGET_ADDR 0x48

/**
* \brief Initialize the BSP and board interfaces.
Expand Down Expand Up @@ -90,40 +90,35 @@ int Console_Shutdown(void);
int Console_PrepForSleep(void);

/**
* \brief Initialize the SPI peripheral to use for MX25
* \returns #E_NO_ERROR if everything is successful
* @brief Writes data to external flash.
* @note This function must be executed from RAM.
* @param address Address in external flash to start writing from.
* @param length Number of bytes to be written.
* @param buffer Pointer to data to be written to external flash.
* @return #EF_E_SUCCESS If function is successful.
* @note make sure to disable SFCC and interrupts; before running this function
*/
int MX25_Board_Init(void);
int MXC_Ext_Write(uint32_t address, uint32_t length, uint8_t *buffer);

/**
* \brief Translation function to implement SPI Read transaction
* @param read Pointer to where master will store data.
* @param len Number of characters to send.
* @param deassert Deassert slave select at the end of the transaction.
* @param width spi_width_t for how many data lines to use
* \returns #E_NO_ERROR if successful, !=0 otherwise
* @brief Reads data from external flash
* @note This function must be executed from RAM.
* @param[in] address The address to read from
* @param buffer The buffer to read the data into
* @param[in] len The length of the buffer
* @return #EF_E_SUCCESS If function is successful.
* @note make sure to disable SFCC and interrupts; before running this function
*/

int MX25_Board_Read(uint8_t *read, unsigned len, unsigned deassert, mxc_spixf_width_t width);
/**
* \brief Translation function to implement SPI Write transaction
* @param write Pointer to data master will write.
* @param len Number of characters to send.
* @param deassert Deassert slave select at the end of the transaction.
* @param width spi_width_t for how many data lines to use
* \returns #E_NO_ERROR if successful, !=0 otherwise
*/

int MX25_Board_Write(const uint8_t *write, unsigned len, unsigned deassert,
mxc_spixf_width_t width);
int MXC_Ext_Read(int address, uint8_t* buffer, int len);

/**
* \brief Send clocks on SCLK.
* @param len Number of characters to send.
* @param deassert Deassert slave select at the end of the transaction.
* \returns #E_NO_ERROR if successful, !=0 otherwise
* @brief Erases the sector of external flash at the specified address.
* @note This function must be executed from RAM.
* @param address Any address within the sector to erase.
* @return #EF_E_SUCCESS If function is successful.
* @note make sure to disable SFCC and interrupts; before running this function
*/
int MX25_Clock(unsigned len, unsigned deassert);
int MXC_Ext_SectorErase(int address);

#ifdef __cplusplus
}
Expand Down
Loading

0 comments on commit 7b351b1

Please sign in to comment.