Ok, yes I tried seeing if there was a driver missing or something with the on board USB-C port but came up with nothing. So currently, there isn't a way to use the onboard USB-C to pull the data into the NECTO Studio and display.
I followed this guide in purchasing the items and setting up the hardware:
https://learn.sparkfun.com/tutorials/mi ... e-assembly
This is my step up:
MicroMod MikroBUS -
https://www.sparkfun.com/products/18710
Micromod STM32 Processor -
https://www.sparkfun.com/products/17713
Mikroe Terminal Click -
https://www.sparkfun.com/products/18961
Mikroe LDC1000 Click -
https://www.sparkfun.com/products/18825
Sparkfun Serial Basic Board -
https://www.sparkfun.com/products/15096
Whenever I used the serial basic board, I hooked it up accordingly to the link at the top to the Terminal Click. The Code is below, I haven't made any changes to it from when I downloaded it from the Packages section within Necto Studio. I did attempt to define these USB_UART_RX USB_UART_TX variables in the log.h file once but wasn't sure what pins to define it as so I might of done it incorrectly. So I reverted back to it original file and decided to troubleshoot using the weather example in the link. When I flashed the example in the link (weather click) I was able to get it to print to the UART terminal. I looked through the code it uses and never found where it defined the UART pins, they appeared to be identical to me.
~~~~~ Code - Main.c ~~~~
/*!
* \file
* \brief Ldc1000 Click example
*
* # Description
* This example showcases how to initialize and configure the logger and click modules and
* read and display proximity and impendance data.
*
* The demo application is composed of two sections :
*
* ## Application Init
* This function initializes and configures the logger and click modules. Configuration data
* is written to the: rp maximum/minimum, sensor frequency, LDC/Clock/Power registers.
*
* ## Application Task
* This function reads and displays proximity and impendance data every 10th of a second.
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "ldc1000.h"
// ------------------------------------------------------------------ VARIABLES
static ldc1000_t ldc1000;
static log_t logger;
static uint16_t old_proximity;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( )
{
log_cfg_t log_cfg;
ldc1000_cfg_t cfg;
old_proximity = 0;
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
ldc1000_cfg_setup( &cfg );
LDC1000_MAP_MIKROBUS( cfg, MIKROBUS_1 );
ldc1000_init( &ldc1000, &cfg );
Delay_ms( 100 );
ldc1000_default_cfg( &ldc1000 );
Delay_ms( 100 );
}
void application_task ( )
{
uint16_t proximity;
float inductance;
proximity = ldc1000_get_proximity_data( &ldc1000 );
inductance = ldc1000_get_inductance_data( &ldc1000 );
if ( ( ( proximity - old_proximity ) > LDC1000_SENSITIVITY ) &&
( ( old_proximity - proximity ) > LDC1000_SENSITIVITY ) )
{
log_printf( &logger, " * Proximity: %d \r\n", proximity );
log_printf( &logger, " * Impendance: %f uH\r\n", inductance );
old_proximity = proximity;
log_printf( &logger, "--------------------\r\n" );
Delay_ms( 100 );
}
}
void main ( )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END
~~~~ Code: log.h ~~~~
/****************************************************************************
**
** Copyright (C) 2022 MikroElektronika d.o.o.
** Contact:
https://www.mikroe.com/contact
**
** This file is part of the mikroSDK package
**
** Commercial License Usage
**
** Licensees holding valid commercial NECTO compilers AI licenses may use this
** file in accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The MikroElektronika Company.
** For licensing terms and conditions see
**
https://www.mikroe.com/legal/software-license-agreement.
** For further information use the contact form at
**
https://www.mikroe.com/contact.
**
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used for
** non-commercial projects under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation:
https://www.gnu.org/licenses/lgpl-3.0.html.
**
** 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,
** OF MERCHANTABILITY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
** TO THE WARRANTIES FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 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.
**
****************************************************************************/
/*!
* \file log.h
*/
#ifndef _API_LOG_LOG_H_
#define _API_LOG_LOG_H_
#ifdef __cplusplus
extern "C"{
#endif
#include "generic_pointer.h"
#include "drv_uart.h"
#include <stdarg.h>
/*! \addtogroup apigroup
* @{
*/
/*! \addtogroup loggroup Logger Library
* @{
*/
/*!
* \brief Log level values
*/
typedef enum
{
LOG_LEVEL_DEBUG = 0x00,
LOG_LEVEL_INFO = 0x01,
LOG_LEVEL_WARNING = 0x02,
LOG_LEVEL_ERROR = 0x03,
LOG_LEVEL_FATAL = 0x04,
} log_level_t;
/*!
* \brief LOG context structure.
*/
typedef struct
{
uart_t uart;
log_level_t log_level;
} log_t;
/*!
* \brief LOG init configuration structure.
*/
typedef struct
{
hal_pin_name_t rx_pin;
hal_pin_name_t tx_pin;
uint32_t baud;
log_level_t level;
} log_cfg_t;
/*!
* \brief LOG MAP to the USB UART configuration
* NOTE If USB_UART_RX and USB_UART_TX are not defined
* (defined as HAL_PIN_NC) define them manually.
* Pins are defined as Pxy where:
* - `x` represents port name ( A, B, C ... )
* - `y` represents pin ( 1,2,3...15...31 )
* Example:
* #define USB_UART_RX PA14
* #define USB_UART_TX PC0
*/
#define LOG_MAP_USB_UART(cfg) \
cfg.rx_pin = USB_UART_RX; \
cfg.tx_pin = USB_UART_TX; \
cfg.baud = 115200; \
cfg.level = LOG_LEVEL_DEBUG;
/*!
* \brief LOG MAP to the MikroBUS configuration
*/
#define LOG_MAP_MIKROBUS(cfg, mikrobus) \
cfg.rx_pin = MIKROBUS(mikrobus, MIKROBUS_RX); \
cfg.tx_pin = MIKROBUS(mikrobus, MIKROBUS_TX); \
cfg.baud = 115200; \
cfg.level = LOG_LEVEL_DEBUG;
/**
* @brief Initializes LOG module.
*
* Initializes LOG driver. This function needs to be
* called before other driver functions.
*
* @param[in] log LOG context object.
* @param[in] cfg LOG configuration structure.
*/
void log_init ( log_t *log, log_cfg_t *cfg );
/**
* @brief Printf function.
*
* This function uses to be a print message on the UART.
*
* @param[in] log LOG context object.
* @param[in] *f pointer to the string
* @param[in] ... Other parameters
*/
void log_printf ( log_t *log, const code char * __generic_ptr f,... );
/**
* @brief Discards all characters from the output and input buffer.
*
* @param[in] log LOG context object.
*/
void log_clear ( log_t *log );
/**
* @brief Reads at most \p size bytes of data from the device into \p buffer.
*
* @param[in] log LOG context object.
* @param[out] rx_data_buf Array to place read data in.
* @param[in] max_len Maximal length
*
* @return err_t Returns the number of bytes that were actually read,
* or -1 if an error occurred or no data read.
*/
int8_t log_read ( log_t *log, uint8_t *rx_data_buf, uint8_t max_len );
/**
* @brief INFO printf function.
*
* This function uses to be a print message on the UART.
* This function uses the prefix [INFO] and check for log level
*
* @param[in] log LOG context object.
* @param[in] *f pointer to the string
* @param[in] ... Other parameters
*/
void log_info ( log_t *log, const code char * __generic_ptr f,... );
/**
* @brief ERROR printf function.
*
* This function uses to be a print message on the UART.
* This function uses the prefix [ERROR] and check for log level
*
* @param[in] log LOG context object.
* @param[in] *f pointer to the string
* @param[in] ... Other parameters
*/
void log_error ( log_t *log, const code char * __generic_ptr f,... );
/**
* @brief FATAL printf function.
*
* This function uses to be a print message on the UART.
* This function uses the prefix [FATAL] and check for log level
*
* @param[in] log LOG context object.
* @param[in] *f pointer to the string
* @param[in] ... Other parameters
*/
void log_fatal ( log_t *log, const code char * __generic_ptr f,... );
/**
* @brief DEBUG printf function.
*
* This function uses to be a print message on the UART.
* This function uses the prefix [DEBUG] and check for log level
*
* @param[in] log LOG context object.
* @param[in] *f pointer to the string
* @param[in] ... Other parameters
*/
void log_debug ( log_t *log, const code char * __generic_ptr f,... );
/**
* @brief WARNING printf function.
*
* This function uses to be a print message on the UART.
* This function uses the prefix [WARNING] and check for log level
*
* @param[in] log LOG context object.
* @param[in] *f pointer to the string
* @param[in] ... Other parameters
*/
void log_warning ( log_t *log, const code char * __generic_ptr f,... );
/**
* @brief Printf function with a variable prefix.
*
* This function uses to be a print message on the UART.
* This function uses a variable prefix.
*
* @param[in] log LOG context object.
* @param[in] prefix Prefix.
* @param[in] *f pointer to the string
* @param[in] ... Other parameters
*/
void log_log ( log_t *log, char * prefix, const code char * __generic_ptr f, ... );
/*! @} */ // loggroup
/*! @} */ // apigroup
#ifdef __cplusplus
}
#endif
#endif // _API_LOG_LOG_H_
// ------------------------------------------------------------------------- END