Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MiscDrivers: Update all boards to use PB, LED, and stdio source files in MiscDrivers. #587

Merged
merged 30 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4e09174
Updating LED and PB drivers in the MiscDrivers library to support all…
Jacob-Scheiffler May 11, 2023
53e866d
Adding GPIOWAKE_IRQn in MXC_GPIO_GET_IRQ to boards with AOD GPIO ports.
Jacob-Scheiffler May 11, 2023
9749289
Updating MAX32690 boards to use LED, PB, and stdio drivers in MiscDri…
Jacob-Scheiffler May 12, 2023
ecd93a0
Updating MAX32660 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 12, 2023
88ac259
Updating stdio.c in MiscDrivers to use UART API.
Jacob-Scheiffler May 12, 2023
e2b03bc
Updating MAX32660 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 12, 2023
17f0bc1
Updating MAX32665 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 12, 2023
8f0ebcf
Updating MAX32670 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 12, 2023
c3009e4
Updating MAX32670 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 15, 2023
f84afb9
Updating MAX32675 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 15, 2023
5819de9
Updating MAX32680 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 15, 2023
aadee30
Updating MAX78000 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 15, 2023
e25d401
Updating MAX78002 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 15, 2023
f1548f4
Updating MAX78000 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 15, 2023
093cb99
Updating MAX32570 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 15, 2023
aac85ea
Removing rom_stub.c in MAX32570 board files where it's unused.
Jacob-Scheiffler May 15, 2023
e305194
Updating MAX32650 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 15, 2023
df640c4
Updating MAX32572 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 16, 2023
c9c8963
Updating MAX32572 to use LED, PB, and stdio drivers in MiscDrivers.
Jacob-Scheiffler May 16, 2023
2f5a1bc
Resolving clang-format errors.
Jacob-Scheiffler May 16, 2023
da55dba
Updating libCordio to search for BSP files in MiscDrivers.
Jacob-Scheiffler May 16, 2023
dace567
Adding PB_RegisterCallbackRiseFall and PB_IsPressedAny in the MiscDri…
Jacob-Scheiffler May 16, 2023
753ea03
Fxixing linter error.
Jacob-Scheiffler May 16, 2023
6c061ab
Resolving build errors in the Build_Examples workflow.
Jacob-Scheiffler May 16, 2023
83f849f
Adding comment to GPIOWAKE_IRQn definition in max32680.h.
Jacob-Scheiffler May 16, 2023
1f32a2d
Resolving clang-format errors. (Part 2)
Jacob-Scheiffler May 16, 2023
e5fe54f
Adding a statement to return an error for invalid PB index in PB_Regi…
Jacob-Scheiffler May 30, 2023
1e92188
Merge branch 'main' into dev/migrate_led_pb_stdio
Jacob-Scheiffler May 30, 2023
5ebc3fa
Resolving clang-format and linter errors.
Jacob-Scheiffler May 30, 2023
04aa5ca
Merge branch 'dev/migrate_led_pb_stdio' of github.com:Analog-Devices-…
Jacob-Scheiffler May 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Examples/MAX32520/Flash/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@
#include "icc.h"
#include "uart.h"
#include "led.h"
#include "pb.h"
#include "sfe.h"

#ifndef BOARD_MAX32520FTHR
#include "pb.h"
#endif //BOARD_MAX32520FTHR

/***** Definitions *****/
#define TEST_ADDRESS (MXC_FLASH_MEM_BASE + MXC_FLASH_MEM_SIZE) - (1 * MXC_FLASH_PAGE_SIZE)
/*
Expand Down
5 changes: 4 additions & 1 deletion Examples/MAX32520/LP/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,17 @@
#include <stdint.h>
#include "mxc_device.h"
#include "mxc_errors.h"
#include "pb.h"
#include "led.h"
#include "lp.h"
#include "icc.h"
#include "uart.h"
#include "nvic_table.h"
#include "mxc_delay.h"

#ifndef BOARD_MAX32520FTHR
#include "pb.h"
#endif //BOARD_MAX32520FTHR

#define USE_CONSOLE 1

#define DO_SLEEP 1
Expand Down
1 change: 0 additions & 1 deletion Examples/MAX32520/Library_Use/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <stdint.h>
#include "mxc_delay.h"
#include "led.h"
#include "pb.h"

#include "gpiolib.h"

Expand Down
5 changes: 4 additions & 1 deletion Examples/MAX32520/SPI_MasterSlave/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@
#include "mxc_device.h"
#include "mxc_pins.h"
#include "nvic_table.h"
#include "pb.h"
#include "spi.h"
#include "mxc_delay.h"

#ifndef BOARD_MAX32520FTHR
#include "pb.h"
#endif //BOARD_MAX32520FTHR

/***** Definitions *****/
#define DATA_LEN 1024 // Words
#define DATA_SIZE 8
Expand Down
16 changes: 12 additions & 4 deletions Examples/MAX32665/Hello_World/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
/**
* @file main.c
* @brief Hello World!
*
* @details This example uses the UART to print to a terminal and flashes an LED(P1.14).
* @details This example uses the UART to print to a terminal and flashes an LED.
*/

/***** Includes *****/
Expand All @@ -51,10 +50,19 @@
/***** Globals *****/

/***** Functions *****/
volatile uint8_t testVar = 1;

// *****************************************************************************
int main(void)
{
testVar = 2;
int count = 0;

printf("Hello World!\n");

while (1) {
LED_On(0);
MXC_Delay(500000);
LED_Off(0);
MXC_Delay(500000);
printf("count = %d\n", count++);
}
}
44 changes: 0 additions & 44 deletions Libraries/Boards/MAX32520/BCB/Include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
*/

#include <stdio.h>
#include "spixf.h"

#ifndef _BOARD_H
#define _BOARD_H
Expand Down Expand Up @@ -85,49 +84,6 @@ int Console_Init(void);
*/
int Console_PrepForSleep(void);

/**
* \brief Initialize the PMIC to output correct voltages
* \returns #E_NO_ERROR if everything is successful
*/
// int MAX77650_Init(void);

/**
* \brief Initialize the SPI peripheral to use for MX25
* \returns #E_NO_ERROR if everything is successful
*/
int MX25_Board_Init(void);

/**
* \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
*/

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);

/**
* \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
*/
int MX25_Clock(unsigned len, unsigned deassert);
;

#ifdef __cplusplus
}
#endif
Expand Down
58 changes: 2 additions & 56 deletions Libraries/Boards/MAX32520/BCB/Source/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@
mxc_uart_regs_t *ConsoleUart = MXC_UART_GET_UART(CONSOLE_UART);
extern uint32_t SystemCoreClock;

const mxc_gpio_cfg_t pb_pin[] = {
{ MXC_GPIO0, MXC_GPIO_PIN_16, MXC_GPIO_FUNC_IN, MXC_GPIO_PAD_PULL_UP, MXC_GPIO_VSSEL_VDDIO },
};
const mxc_gpio_cfg_t pb_pin[] = {};
const unsigned int num_pbs = (sizeof(pb_pin) / sizeof(mxc_gpio_cfg_t));

const mxc_gpio_cfg_t led_pin[] = {
{ MXC_GPIO2, MXC_GPIO_PIN_17, MXC_GPIO_FUNC_OUT, MXC_GPIO_PAD_NONE, MXC_GPIO_VSSEL_VDDIO },
};
const mxc_gpio_cfg_t led_pin[] = {};
const unsigned int num_leds = (sizeof(led_pin) / sizeof(mxc_gpio_cfg_t));

/***** File Scope Variables *****/
Expand Down Expand Up @@ -87,13 +83,6 @@ void mxc_assert(const char *expr, const char *file, int line)
while (1) {}
}

/******************************************************************************/
/*
void SystemCoreClockUpdate(void)
{
SystemCoreClock = RO_FREQ;
}
*/
/******************************************************************************/
int Board_Init(void)
{
Expand Down Expand Up @@ -142,46 +131,3 @@ void NMI_Handler(void)
{
__NOP();
}

/******************************************************************************/
int MX25_Board_Init(void)
{
int err;
err = MXC_SPIXF_Init(0x0B, MX25_BAUD);

if (err == E_NO_ERROR) {
MXC_SPIXF_Enable();
}

return err;
}

/******************************************************************************/
int MX25_Board_Read(uint8_t *read, unsigned len, unsigned deassert, mxc_spixf_width_t width)
{
mxc_spixf_req_t req = { deassert, 0, NULL, read, width, len, 0, 0, NULL };

if (MXC_SPIXF_Transaction(&req) != len) {
return E_COMM_ERR;
}

return E_NO_ERROR;
}

/******************************************************************************/
int MX25_Board_Write(const uint8_t *write, unsigned len, unsigned deassert, mxc_spixf_width_t width)
{
mxc_spixf_req_t req = { deassert, 0, write, NULL, width, len, 0, 0, NULL };

if (MXC_SPIXF_Transaction(&req) != len) {
return E_COMM_ERR;
}

return E_NO_ERROR;
}

/******************************************************************************/
int MX25_Clock(unsigned len, unsigned deassert)
{
return MXC_SPIXF_Clocks(len, deassert);
}
82 changes: 0 additions & 82 deletions Libraries/Boards/MAX32520/BCB/Source/rom_stub.c

This file was deleted.

13 changes: 7 additions & 6 deletions Libraries/Boards/MAX32520/BCB/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ endif
SRCS += board.c
SRCS += stdio.c
SRCS += led.c
SRCS += mx25.c
SRCS += pb.c
SRCS += rom_stub.c
SRCS += touchscreen.c
#SRCS += LPM012A260A.c

MISC_DRIVERS_DIR=$(LIBS_DIR)/MiscDrivers

# Where to find BSP source files
VPATH += $(BOARD_DIR)/Source
VPATH += $(BOARD_DIR)/../Source
VPATH += $(MISC_DRIVERS_DIR)
VPATH += $(MISC_DRIVERS_DIR)/LED
VPATH += $(MISC_DRIVERS_DIR)/PushButton

# Where to find BSP header files
IPATH += $(BOARD_DIR)/Include
IPATH += $(BOARD_DIR)/../Include
IPATH += $(MISC_DRIVERS_DIR)
IPATH += $(MISC_DRIVERS_DIR)/LED
IPATH += $(MISC_DRIVERS_DIR)/PushButton
10 changes: 10 additions & 0 deletions Libraries/Boards/MAX32520/EvKit_V1/Source/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ void mxc_assert(const char *expr, const char *file, int line)
while (1) {}
}

/******************************************************************************/
/**
* NOTE: This weak definition is included to support Push Button interrupts in
* case the user does not define this interrupt handler in their application.
**/
__weak void GPIO1_IRQHandler(void)
{
MXC_GPIO_Handler(MXC_GPIO_GET_IDX(MXC_GPIO1));
}

/******************************************************************************/
int Board_Init(void)
{
Expand Down
Loading