Skip to content

Commit

Permalink
imx93-var-som: Add support for additional M33 examples
Browse files Browse the repository at this point in the history
This change adds support for the following new examples:
driver_examples/canfd/loopback
driver_examples/canfd/loopback_transfer
driver_examples/edma/memory_to_memory
driver_examples/edma/scatter_gather
driver_examples/edma4/channel_link
driver_examples/edma4/interleave_transfer
driver_examples/edma4/memory_to_memory
driver_examples/edma4/memory_to_memory_transfer
driver_examples/edma4/memset
driver_examples/edma4/ping_pong_transfer
driver_examples/edma4/scatter_gather
driver_examples/edma4/wrap_transfer
driver_examples/flexcan/loopback
driver_examples/flexcan/loopback_edma_transfer
driver_examples/flexcan/loopback_transfer
driver_examples/lpit/chained_channel
driver_examples/lpit/single_channel
driver_examples/lptmr
driver_examples/lpuart/interrupt
driver_examples/lpuart/interrupt_rb_transfer
driver_examples/lpuart/interrupt_transfer
driver_examples/lpuart/polling
driver_examples/tpm/input_capture
driver_examples/tpm/output_compare
driver_examples/tpm/simple_pwm
driver_examples/tpm/timer
driver_examples/tstmr
multicore_examples/rpmsg_lite_pingpong_rtos
multicore_examples/rpmsg_lite_str_echo_rtos
rtos_examples/freertos_event
rtos_examples/freertos_generic
rtos_examples/freertos_hello
rtos_examples/freertos_mutex
rtos_examples/freertos_queue
rtos_examples/freertos_sem
rtos_examples/freertos_swtimer

Signed-off-by: Ken Sloat <[email protected]>
  • Loading branch information
Ken Sloat committed Jul 26, 2023
1 parent 55533a1 commit f42b3c3
Show file tree
Hide file tree
Showing 752 changed files with 50,429 additions and 430 deletions.
150 changes: 0 additions & 150 deletions boards/som_mx93/demo_apps/ethosu_apps_rpmsg/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

#include "board.h"
#include "fsl_cache.h"
#if defined(SDK_I2C_BASED_COMPONENT_USED) && SDK_I2C_BASED_COMPONENT_USED
#include "fsl_lpi2c.h"
#endif

/*******************************************************************************
* Definitions
Expand Down Expand Up @@ -39,153 +36,6 @@ void BOARD_InitDebugConsole(void)
BOARD_DEBUG_UART_CLK_FREQ);
}

#if defined(SDK_I2C_BASED_COMPONENT_USED) && SDK_I2C_BASED_COMPONENT_USED
void BOARD_LPI2C_Init(LPI2C_Type *base, uint32_t clkSrc_Hz)
{
lpi2c_master_config_t lpi2cConfig = {0};

/*
* lpi2cConfig.debugEnable = false;
* lpi2cConfig.ignoreAck = false;
* lpi2cConfig.pinConfig = kLPI2C_2PinOpenDrain;
* lpi2cConfig.baudRate_Hz = 100000U;
* lpi2cConfig.busIdleTimeout_ns = 0;
* lpi2cConfig.pinLowTimeout_ns = 0;
* lpi2cConfig.sdaGlitchFilterWidth_ns = 0;
* lpi2cConfig.sclGlitchFilterWidth_ns = 0;
*/
LPI2C_MasterGetDefaultConfig(&lpi2cConfig);
LPI2C_MasterInit(base, &lpi2cConfig, clkSrc_Hz);
}

status_t BOARD_LPI2C_Send(LPI2C_Type *base,
uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
uint8_t *txBuff,
uint8_t txBuffSize,
uint32_t flags)
{
lpi2c_master_transfer_t xfer;

xfer.flags = flags;
xfer.slaveAddress = deviceAddress;
xfer.direction = kLPI2C_Write;
xfer.subaddress = subAddress;
xfer.subaddressSize = subAddressSize;
xfer.data = txBuff;
xfer.dataSize = txBuffSize;

return LPI2C_MasterTransferBlocking(base, &xfer);
}

status_t BOARD_LPI2C_Receive(LPI2C_Type *base,
uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
uint8_t *rxBuff,
uint8_t rxBuffSize,
uint32_t flags)
{
lpi2c_master_transfer_t xfer;

xfer.flags = flags;
xfer.slaveAddress = deviceAddress;
xfer.direction = kLPI2C_Read;
xfer.subaddress = subAddress;
xfer.subaddressSize = subAddressSize;
xfer.data = rxBuff;
xfer.dataSize = rxBuffSize;

return LPI2C_MasterTransferBlocking(base, &xfer);
}

#if defined(BOARD_USE_ADP5585) && BOARD_USE_ADP5585
void BOARD_ADP5585_I2C_Init(void)
{
BOARD_LPI2C_Init(BOARD_ADP5585_I2C, BOARD_ADP5585_I2C_CLOCK_FREQ);
}

status_t BOARD_ADP5585_I2C_Send(uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
const uint8_t *txBuff,
uint8_t txBuffSize,
uint32_t flags)
{
return BOARD_LPI2C_Send(BOARD_ADP5585_I2C, deviceAddress, subAddress, subAddressSize, (uint8_t *)txBuff, txBuffSize,
flags);
}

status_t BOARD_ADP5585_I2C_Receive(uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
uint8_t *rxBuff,
uint8_t rxBuffSize,
uint32_t flags)
{
return BOARD_LPI2C_Receive(BOARD_ADP5585_I2C, deviceAddress, subAddress, subAddressSize, rxBuff, rxBuffSize, flags);
}

void BOARD_InitADP5585(adp5585_handle_t *handle)
{
BOARD_ADP5585_I2C_Init();

static const adp5585_config_t config = {
.i2cAddr = BOARD_ADP5585_I2C_ADDR,
.I2C_SendFunc = BOARD_ADP5585_I2C_Send,
.I2C_ReceiveFunc = BOARD_ADP5585_I2C_Receive,
};

ADP5585_Init(handle, &config);
}

#endif /* BOARD_USE_ADP5585. */

#if defined(BOARD_USE_PCAL6524) && BOARD_USE_PCAL6524
void BOARD_PCAL6524_I2C_Init(void)
{
BOARD_LPI2C_Init(BOARD_PCAL6524_I2C, BOARD_PCAL6524_I2C_CLOCK_FREQ);
}

status_t BOARD_PCAL6524_I2C_Send(uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
const uint8_t *txBuff,
uint8_t txBuffSize,
uint32_t flags)
{
return BOARD_LPI2C_Send(BOARD_PCAL6524_I2C, deviceAddress, subAddress, subAddressSize, (uint8_t *)txBuff,
txBuffSize, flags);
}

status_t BOARD_PCAL6524_I2C_Receive(uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
uint8_t *rxBuff,
uint8_t rxBuffSize,
uint32_t flags)
{
return BOARD_LPI2C_Receive(BOARD_PCAL6524_I2C, deviceAddress, subAddress, subAddressSize, rxBuff, rxBuffSize,
flags);
}

void BOARD_InitPCAL6524(pcal6524_handle_t *handle)
{
BOARD_PCAL6524_I2C_Init();

static const pcal6524_config_t config = {
.i2cAddr = BOARD_PCAL6524_I2C_ADDR,
.I2C_SendFunc = BOARD_PCAL6524_I2C_Send,
.I2C_ReceiveFunc = BOARD_PCAL6524_I2C_Receive,
};

PCAL6524_Init(handle, &config);
}

#endif /* BOARD_USE_PCAL6524. */

#endif

void BOARD_McoreSUSPEND(void)
{
Expand Down
58 changes: 0 additions & 58 deletions boards/som_mx93/demo_apps/ethosu_apps_rpmsg/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
#include "fsl_common.h"
#include "fsl_debug_console.h"
#include "clock_config.h"
#if defined(BOARD_USE_ADP5585) && BOARD_USE_ADP5585
#include "fsl_adp5585.h"
#endif
#if defined(BOARD_USE_PCAL6524) && BOARD_USE_PCAL6524
#include "fsl_pcal6524.h"
#endif

/*******************************************************************************
* Definitions
Expand Down Expand Up @@ -69,58 +63,6 @@ extern "C" {
******************************************************************************/

void BOARD_InitDebugConsole(void);
#if defined(SDK_I2C_BASED_COMPONENT_USED) && SDK_I2C_BASED_COMPONENT_USED
status_t BOARD_LPI2C_Send(LPI2C_Type *base,
uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subaddressSize,
uint8_t *txBuff,
uint8_t txBuffSize,
uint32_t flags);
status_t BOARD_LPI2C_Receive(LPI2C_Type *base,
uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subaddressSize,
uint8_t *rxBuff,
uint8_t rxBuffSize,
uint32_t flags);
#if defined(BOARD_USE_ADP5585) && BOARD_USE_ADP5585
void BOARD_ADP5585_I2C_Init(void);
status_t BOARD_ADP5585_I2C_Send(uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
const uint8_t *txBuff,
uint8_t txBuffSize,
uint32_t flags);
status_t BOARD_ADP5585_I2C_Receive(uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
uint8_t *rxBuff,
uint8_t rxBuffSize,
uint32_t flags);

void BOARD_InitADP5585(adp5585_handle_t *handle);
#endif /* BOARD_USE_ADP5585 */

#if defined(BOARD_USE_PCAL6524) && BOARD_USE_PCAL6524
void BOARD_PCAL6524_I2C_Init(void);
status_t BOARD_PCAL6524_I2C_Send(uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
const uint8_t *txBuff,
uint8_t txBuffSize,
uint32_t flags);
status_t BOARD_PCAL6524_I2C_Receive(uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
uint8_t *rxBuff,
uint8_t rxBuffSize,
uint32_t flags);

void BOARD_InitPCAL6524(pcal6524_handle_t *handle);
#endif /* BOARD_USE_PCAL6524 */

#endif

/* Mcore suspend setting */
#define OSCPLL_LPM_START 3U
Expand Down
8 changes: 4 additions & 4 deletions boards/som_mx93/demo_apps/ethosu_apps_rpmsg/pin_mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ void BOARD_InitBootPins(void)
BOARD_InitPins:
- options: {callFromInitBoot: 'true', coreID: cm33}
- pin_list:
- {pin_num: F20, peripheral: LPUART2, signal: lpuart_rx, pin_signal: UART2_RXD, FSEL1: SlOW_SLEW_RATE, DSE: NO_DRIVE}
- {pin_num: F21, peripheral: LPUART2, signal: lpuart_tx, pin_signal: UART2_TXD, PD: DISABLED, FSEL1: SlOW_SLEW_RATE}
- {pin_num: M21, peripheral: LPUART7, signal: lpuart_rx, pin_signal: GPIO_IO09, FSEL1: SlOW_SLEW_RATE, DSE: NO_DRIVE}
- {pin_num: M20, peripheral: LPUART7, signal: lpuart_tx, pin_signal: GPIO_IO08, PD: DISABLED, FSEL1: SlOW_SLEW_RATE}
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
*/

Expand All @@ -54,9 +54,9 @@ void BOARD_InitPins(void) { /*!< Function assigne
IOMUXC_SetPinMux(IOMUXC_PAD_GPIO_IO09__LPUART7_RX, 0U);
IOMUXC_SetPinMux(IOMUXC_PAD_GPIO_IO08__LPUART7_TX, 0U);

IOMUXC_SetPinConfig(IOMUXC_PAD_GPIO_IO09__LPUART7_RX,
IOMUXC_SetPinConfig(IOMUXC_PAD_GPIO_IO09__LPUART7_RX,
IOMUXC_PAD_PD_MASK);
IOMUXC_SetPinConfig(IOMUXC_PAD_GPIO_IO08__LPUART7_TX,
IOMUXC_SetPinConfig(IOMUXC_PAD_GPIO_IO08__LPUART7_TX,
IOMUXC_PAD_DSE(15U));
}

Expand Down
Loading

0 comments on commit f42b3c3

Please sign in to comment.