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

Add TMPM4GR Platform #15353

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
463 changes: 463 additions & 0 deletions targets/TARGET_TOSHIBA/TARGET_TMPM4GR/Periph_driver/inc/txz_adc.h

Large diffs are not rendered by default.

132 changes: 132 additions & 0 deletions targets/TARGET_TOSHIBA/TARGET_TMPM4GR/Periph_driver/inc/txz_adc_ch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/**
*******************************************************************************
* @file txz_adc_ch.h
* @brief This file provides all the functions prototypes for ADC driver. \n
* Channel Class.
* @version V1.0.0
*
* DO NOT USE THIS SOFTWARE WITHOUT THE SOFTWARE LICENSE AGREEMENT.
*
* Copyright(C) Toshiba Electronic Device Solutions Corporation 2021
*******************************************************************************
*/
/*------------------------------------------------------------------------------*/
/* Define to prevent recursive inclusion */
/*------------------------------------------------------------------------------*/
#ifndef __ADC_CH_H
#define __ADC_CH_H

#ifdef __cplusplus
extern "C" {
#endif

/*------------------------------------------------------------------------------*/
/* Includes */
/*------------------------------------------------------------------------------*/
#include "txz_driver_def.h"

/**
* @addtogroup Periph_Driver Peripheral Driver
* @{
*/

/**
* @defgroup ADC ADC
* @brief ADC Driver.
* @{
*/
/*------------------------------------------------------------------------------*/
/* Macro Definition */
/*------------------------------------------------------------------------------*/
/**
* @defgroup ADC_Exported_define ADC Exported Define
* @{
*/

/* no define */

/**
* @}
*/ /* End of group ADC_Exported_define */

/*------------------------------------------------------------------------------*/
/* Enumerated Type Definition */
/*------------------------------------------------------------------------------*/
/**
* @defgroup ADC_Exported_define ADC Exported Define
* @{
*/

/* no define */

/**
* @}
*/ /* End of group ADC_Exported_define */

/*------------------------------------------------------------------------------*/
/* Structure Definition */
/*------------------------------------------------------------------------------*/
/**
* @defgroup ADC_Exported_typedef ADC Exported Typedef
* @{
*/

/*----------------------------------*/
/*! @struct adc_ch_initial_setting_t
* @brief Initialize Setting.
*/
/*----------------------------------*/
typedef struct {
uint32_t interrupt; /*!< Interrupt Enable/Disable.
: Use @ref adc_dma_int_t. */
uint32_t type; /*!< Conversion Type.
: Use @ref adc_conversion_t. */
uint32_t ain; /*!< AIN. */
} adc_ch_initial_setting_t;

/*----------------------------------*/
/*! @struct adc_ch_t
* @brief ADC handle structure definition.
*/
/*----------------------------------*/
typedef struct {
__IO uint32_t *p_tset; /*!< ADxTSETn Address. */
__I uint32_t *p_reg; /*!< ADxREGx Address. */
adc_ch_initial_setting_t init; /*!< Initial setting. */
} adc_ch_t;

/**
* @}
*/ /* End of group ADC_Exported_typedef */

/*------------------------------------------------------------------------------*/
/* Functions */
/*------------------------------------------------------------------------------*/
/**
* @defgroup ADC_Exported_functions ADC Exported Functions
* @{
*/
uint32_t get_conversion_data(uint32_t reg);
TXZ_Result adc_ch_init(adc_ch_t *p_obj);
TXZ_Result adc_ch_deinit(adc_ch_t *p_obj);
TXZ_Result adc_ch_int_enable(adc_ch_t *p_obj);
TXZ_Result adc_ch_int_disable(adc_ch_t *p_obj);
TXZ_Result adc_ch_get_value(adc_ch_t *p_obj, uint32_t *p_value);
/**
* @}
*/ /* End of group ADC_Exported_functions */

/**
* @}
*/ /* End of group ADC */

/**
* @}
*/ /* End of group Periph_Driver */

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __ADC_CH_H */


Loading