Improve psoc6csp doxygen comments

pull/11516/head
Kyle Kearney 2019-09-17 17:00:17 -07:00
parent a0b657295f
commit 8aa449c662
33 changed files with 348 additions and 971 deletions

View File

@ -22,18 +22,6 @@
* limitations under the License.
*******************************************************************************/
/**
* \addtogroup group_abstraction_resource Resource abstraction
* \ingroup group_abstraction
* \{
* Basic abstraction layer for dealing with resources.
*
* \defgroup group_abstraction_resource_macros Macros
* \defgroup group_abstraction_resource_enums Enums
* \defgroup group_abstraction_resource_data_structures Data Structures
* \defgroup group_abstraction_resource_functions Functions
*/
#pragma once
#include <stdint.h>
@ -44,10 +32,12 @@
extern "C" {
#endif
/**
* \addtogroup group_abstraction_resource_macros
* \{
*/
/**
* \addtogroup group_abstraction_resource Resource Abstraction
* \{
*
* Basic abstraction layer for dealing with resources.
*/
/** Error code for when the specified resource operation is not valid. */
#define CY_RSLT_RSC_ERROR_UNSUPPORTED (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_RESOURCE, 0))
@ -62,13 +52,6 @@ extern "C" {
/** Error code for when the specified resource can not be read. */
#define CY_RSLT_RSC_ERROR_READ (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_RESOURCE, 5))
/** \} group_abstraction_resource_macros */
/**
* \addtogroup group_abstraction_resource_enums
* \{
*/
/** Different types of memory that the resources can be stored in. */
typedef enum
{
@ -77,15 +60,7 @@ typedef enum
CY_RESOURCE_IN_EXTERNAL_STORAGE /**< resource location in external storage */
} cy_resource_location_t;
/** \} group_abstraction_resource_enums */
/**
* \addtogroup group_abstraction_resource_data_structures
* \{
*/
/** Filesystem handle */
/** Filesystem handle */
typedef struct
{
unsigned long offset; /**< Offset to the start of the resource */
@ -99,19 +74,12 @@ typedef struct
unsigned long size; /**< resource size */
union
{
cy_filesystem_resource_handle_t fs; /** < filesystem resource handle */
const uint8_t* mem_data; /** < memory resource handle */
void* external_storage_context; /** < external storage context */
} val;
cy_filesystem_resource_handle_t fs; /**< handle for resource in filesystem */
const uint8_t* mem_data; /**< handle for resource in internal memory */
void* external_storage_context; /**< handle for resource in external storage */
} val; /**< low-level handle (type varies depending on resource storage location) */
} cy_resource_handle_t;
/** \} group_abstraction_resource_data_structures */
/**
* \addtogroup group_abstraction_resource_functions
* \{
*/
/**
* \brief return the block size for the resource
* \param handle handle to a resource
@ -147,7 +115,8 @@ cy_rslt_t cy_resource_get_block_count(const cy_resource_handle_t *handle, uint32
cy_rslt_t cy_resource_read(const cy_resource_handle_t *handle, uint32_t blockno, uint8_t **buffer, uint32_t *size);
/**
* \brief optimized version of read for resources stored in memory (\see CY_RESOURCE_IN_MEMORY)
* \brief optimized version of read for resources stored in memory
* \see CY_RESOURCE_IN_MEMORY
* \param handle the handle to the resource
* \param buffer pointer to receive buffer address from resource. This does NOT need to be freed.
* \param size location to receive the size of the block read
@ -155,8 +124,6 @@ cy_rslt_t cy_resource_read(const cy_resource_handle_t *handle, uint32_t blockno,
*/
cy_rslt_t cy_resource_readonly_memory(const cy_resource_handle_t *handle, const uint8_t **buffer, uint32_t *size);
/** \} group_abstraction_resource_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -33,50 +33,14 @@
#include <stdint.h>
#include <stdbool.h>
/*
* Note, cyabs_rtos_impl.h above is included and is the implementation of some basic
* types for the abstraction layer. The types expected to be defined are.
*
* cy_thread_t : typedef from underlying RTOS thread type
* cy_thread_arg_t : typedef from the RTOS type that is passed to the
* entry function of a thread.
* cy_mutex_t : typedef from the underlying RTOS mutex type
* cy_event_t : typedef from the underlying RTOS event type
* cy_queue_t : typedef from the underlying RTOS queue type
* cy_timer_callback_arg_t : typedef from the RTOS type that is passed
* : to the timer callback function
* cy_timer_t : typedef from the underlying RTOS timer type
* cy_time_t : count of time in milliseconds
* cy_rtos_error_t : typedef from the underlying RTOS error type
*
* The enum cy_thread_priority_t needs to have the following priority values defined
* and mapped to RTOS specific values:
* CY_RTOS_PRIORITY_MIN
* CY_RTOS_PRIORITY_LOW
* CY_RTOS_PRIORITY_BELOWNORMAL
* CY_RTOS_PRIORITY_NORMAL
* CY_RTOS_PRIORITY_ABOVENORMAL
* CY_RTOS_PRIORITY_HIGH
* CY_RTOS_PRIORITY_REALTIME
* CY_RTOS_PRIORITY_MAX
*
* Finally, the following macros need to be defined for memory allocations:
* CY_RTOS_MIN_STACK_SIZE
* CY_RTOS_ALIGNMENT
* CY_RTOS_ALIGNMENT_MASK
*/
/**
* \addtogroup group_abstraction_rtos RTOS abstraction
* \ingroup group_abstraction
* \{
* Basic abstraction layer for dealing with RTOSes.
*
* \defgroup group_abstraction_rtos_macros Macros
* \defgroup group_abstraction_rtos_enums Enums
* \defgroup group_abstraction_rtos_data_structures Data Structures
* \defgroup group_abstraction_rtos_functions Functions
* \defgroup group_abstraction_rtos_common Common
* \defgroup group_abstraction_rtos_mutex Mutex
* \defgroup group_abstraction_rtos_queue Queue
* \defgroup group_abstraction_rtos_semaphore Semaphore
* \defgroup group_abstraction_rtos_threads Threading
* \defgroup group_abstraction_rtos_time Time
* \defgroup group_abstraction_rtos_timer Timer
*/
#ifdef __cplusplus
@ -86,10 +50,10 @@ extern "C"
/*********************************************** CONSTANTS **********************************************/
/**
* \addtogroup group_abstraction_rtos_macros
* \{
*/
/**
* \ingroup group_abstraction_rtos_common
* \{
*/
/** Used with RTOS calls that require a timeout. This implies the call will never timeout. */
#define CY_RTOS_NEVER_TIMEOUT ( (uint32_t)0xffffffffUL )
@ -100,31 +64,35 @@ extern "C"
// underlying errors to these. If the errors are special cases, the the error CY_RTOS_GENERAL_ERROR can be
// returns and cy_rtos_last_error() used to retrieve the RTOS specific error message.
//
/** Requested operationd did not complete in the specified time */
/** Requested operation did not complete in the specified time */
#define CY_RTOS_TIMEOUT CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 0)
/** The RTOS could not allocate memory for the specified operation */
#define CY_RTOS_NO_MEMORY CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 1)
/** An error occured in the RTOS */
#define CY_RTOS_GENERAL_ERROR CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 2)
/** A bad argument was passed into the APIs */
#define CY_RTOS_BAD_PARAM CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 5)
/** \} group_abstraction_rtos_common */
/**
* \ingroup group_abstraction_rtos_queue
* \{
*/
/** The Queue is already full and can't accept any more items at this time */
#define CY_RTOS_QUEUE_FULL CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 3)
/** The Queue is empty and has nothing to remove */
#define CY_RTOS_QUEUE_EMPTY CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 4)
/** A bad argument was passed into the APIs */
#define CY_RTOS_BAD_PARAM CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 5)
/** \} group_abstraction_rtos_macros */
/** \} group_abstraction_rtos_queue */
/*********************************************** TYPES **********************************************/
/**
* \addtogroup group_abstraction_rtos_enums
* \{
*/
/**
* The state a thread can be in
*
* \ingroup group_abstraction_rtos_threads
*/
typedef enum cy_thread_state
{
@ -138,6 +106,8 @@ typedef enum cy_thread_state
/**
* The type of timer
*
* \ingroup group_abstraction_rtos_timer
*/
typedef enum cy_timer_trigger_type
{
@ -147,34 +117,22 @@ typedef enum cy_timer_trigger_type
cy_timer_type_once = CY_TIMER_TYPE_ONCE, /**< \deprecated replaced by CY_TIMER_TYPE_ONCE */
} cy_timer_trigger_type_t ;
/** \} group_abstraction_rtos_enums */
/**
* \addtogroup group_abstraction_rtos_data_structures
* \{
*/
/**
* The type of a function that is the entry point for a thread
*
* @param[in] arg the argument passed from the thread create call to the entry function
*
* \ingroup group_abstraction_rtos_threads
*/
typedef void (*cy_thread_entry_fn_t)(cy_thread_arg_t arg) ;
/**
* The callback function to be called by a timeer
* The callback function to be called by a timer
*
* \ingroup group_abstraction_rtos_timer
*/
typedef void (*cy_timer_callback_t)(cy_timer_callback_arg_t arg);
/** \} group_abstraction_rtos_data_structures */
/**
* \addtogroup group_abstraction_rtos_functions
* \{
*/
/**
* Return the last error from the RTOS.
*
@ -185,11 +143,18 @@ typedef void (*cy_timer_callback_t)(cy_timer_callback_arg_t arg);
* from the last RTOS abstraction layer that returned CY_RTOS_GENERAL_ERROR.
*
* @return RTOS specific error code.
*
* \ingroup group_abstraction_rtos_common
*/
extern cy_rtos_error_t cy_rtos_last_error();
/*********************************************** Threads **********************************************/
/*
*
* \ingroup group_abstraction_rtos_threads
* \{
*/
/** Create a thread with specific thread argument.
*
@ -281,8 +246,15 @@ extern cy_rslt_t cy_rtos_get_thread_state(cy_thread_t *thread, cy_thread_state_t
*/
extern cy_rslt_t cy_rtos_join_thread(cy_thread_t *thread);
/** \} group_abstraction_rtos_threads */
/*********************************************** Mutexes **********************************************/
/**
* \ingroup group_abstraction_rtos_mutex
* \{
*/
/** Create a mutex.
*
* This is basically a binary mutex which can be used to synchronize between threads
@ -334,8 +306,15 @@ extern cy_rslt_t cy_rtos_set_mutex(cy_mutex_t *mutex);
*/
extern cy_rslt_t cy_rtos_deinit_mutex(cy_mutex_t *mutex);
/** \} group_abstraction_rtos_mutex */
/*********************************************** Semaphores **********************************************/
/**
* \ingroup group_abstraction_rtos_semaphore
* \{
*/
/**
* Create a semaphore
*
@ -388,8 +367,15 @@ extern cy_rslt_t cy_rtos_set_semaphore(cy_semaphore_t *semaphore, bool in_isr);
*/
extern cy_rslt_t cy_rtos_deinit_semaphore(cy_semaphore_t *semaphore);
/** \} group_abstraction_rtos_semaphore */
/*********************************************** Events **********************************************/
/**
* \ingroup group_abstraction_rtos_event
* \{
*/
/** Create an event.
*
* This is an event which can be used to signal a set of threads
@ -467,8 +453,15 @@ extern cy_rslt_t cy_rtos_waitbits_event(cy_event_t *event, uint32_t *bits, bool
*/
extern cy_rslt_t cy_rtos_deinit_event(cy_event_t *event);
/** \} group_abstraction_rtos_event */
/*********************************************** Queues **********************************************/
/**
* \ingroup group_abstraction_rtos_queue
* \{
*/
/** Create a queue.
*
* This is a queue of data where entries are placed on the back of the queue
@ -561,8 +554,15 @@ extern cy_rslt_t cy_rtos_reset_queue(cy_queue_t *queue);
*/
extern cy_rslt_t cy_rtos_deinit_queue(cy_queue_t *queue);
/** \} group_abstraction_rtos_queue */
/*********************************************** Timers **********************************************/
/**
* \ingroup group_abstraction_rtos_timer
* \{
*/
/** Create a new timer.
*
* This function intializes a timer object. @note The timer is
@ -617,8 +617,15 @@ extern cy_rslt_t cy_rtos_is_running_timer(cy_timer_t *timer, bool *state);
*/
extern cy_rslt_t cy_rtos_deinit_timer(cy_timer_t *timer);
/** \} group_abstraction_rtos_timer */
/*********************************************** Time **********************************************/
/**
* \ingroup group_abstraction_rtos_time
* \{
*/
/** Gets time in milliseconds since RTOS start.
*
* @note Since this is only 32 bits, it will roll over every 49 days, 17 hours, 2 mins, 47.296 seconds
@ -642,9 +649,7 @@ extern cy_rslt_t cy_rtos_get_time(cy_time_t *tval);
*/
extern cy_rslt_t cy_rtos_delay_milliseconds(cy_time_t num_ms);
/** \} group_abstraction_rtos_functions */
/** @} */
/** \} group_abstraction_rtos_timer */
#ifdef __cplusplus
} /* extern "C" */

View File

@ -32,7 +32,9 @@
* information about whether something succeeded or details about any issues
* that were detected.
*
* \defgroup group_result_macros Macros
* \defgroup group_result_fields Fields
* \defgroup group_result_modules Modules
* \defgroup group_result_severity Severity
*/
#pragma once
@ -43,11 +45,13 @@
extern "C" {
#endif
/**
* \addtogroup group_result_macros
* \{
*/
/** Provides the result of an operation as a structured bitfield */
typedef uint32_t cy_rslt_t;
/** Result value indicating success */
#define CY_RSLT_SUCCESS ((cy_rslt_t)0x00000000U)
/** \cond INTERNAL */
/** Mask for the bit at position "x" */
#define CY_BIT_MASK(x) ((1U << (x)) - 1U)
@ -71,14 +75,13 @@ extern "C" {
/** Mask for the result type */
#define CY_RSLT_TYPE_MASK CY_BIT_MASK(CY_RSLT_TYPE_WIDTH)
/** Informational-only result status */
#define CY_RSLT_TYPE_INFO (0U)
/** Warning result */
#define CY_RSLT_TYPE_WARNING (1U)
/** Error result */
#define CY_RSLT_TYPE_ERROR (2U)
/** Fatal error result */
#define CY_RSLT_TYPE_FATAL (3U)
/** \endcond */
/**
* \addtogroup group_result_fields
* \{
* Utlity macros for constructing result values and extracting individual fields from existing results.
*/
/** Get the value of the result code field */
#define CY_RSLT_GET_CODE(x) (((x) >> CY_RSLT_CODE_POSITION) & CY_RSLT_CODE_MASK)
@ -87,45 +90,60 @@ extern "C" {
/** Get the value of the module identifier field */
#define CY_RSLT_GET_MODULE(x) (((x) >> CY_RSLT_MODULE_POSITION) & CY_RSLT_MODULE_MASK)
/**** DRIVER Module codes: 0x0000 - 0x00FF ****/
/** Base identifier for peripheral driver library */
#define CY_RSLT_MODULE_DRIVERS_PDL_BASE (0x0000U)
/** Base identifier for peripheral driver library */
#define CY_RSLT_MODULE_DRIVERS_WHD_BASE (0x0080U)
/**** ABSTRACTION Module codes: 0x0100 - 0x01FF ****/
/** Base identifier for chip support modules */
#define CY_RSLT_MODULE_ABSTRACTION_HAL_BASE (0x0100U)
/** Base identifier for board support modules */
#define CY_RSLT_MODULE_ABSTRACTION_BSP (0x0180U)
/** Base identifier for file system modules */
#define CY_RSLT_MODULE_ABSTRACTION_FS (0x0181U)
/** Base identifier for resource abstraction modules */
#define CY_RSLT_MODULE_ABSTRACTION_RESOURCE (0x0182U)
/** Base identifier for rtos abstraction modules */
#define CY_RSLT_MODULE_ABSTRACTION_OS (0x0183U)
/** Base identifier for environment abstraction modules */
#define CY_RSLT_MODULE_ABSTRACTION_ENV (0x0184U)
/** Middleware Module codes: 0x0200 - 0x02FF */
#define CY_RSLT_MODULE_MIDDLEWARE_BASE (0x0200U)
/** Provides the result of an operation as a structured bitfield */
typedef uint32_t cy_rslt_t;
/** Result value indicating success */
#define CY_RSLT_SUCCESS ((cy_rslt_t)0x00000000U)
/** Create a result value from the specified type, module, and result code */
#define CY_RSLT_CREATE(type, module, code) \
((((module) & CY_RSLT_MODULE_MASK) << CY_RSLT_MODULE_POSITION) | \
(((code) & CY_RSLT_CODE_MASK) << CY_RSLT_CODE_POSITION) | \
(((type) & CY_RSLT_TYPE_MASK) << CY_RSLT_TYPE_POSITION))
/** \} group_result_macros */
/** \} group_result_fields */
/**
* \addtogroup group_result_severity
* \{
*/
/** Informational-only result */
#define CY_RSLT_TYPE_INFO (0U)
/** Warning result */
#define CY_RSLT_TYPE_WARNING (1U)
/** Error result */
#define CY_RSLT_TYPE_ERROR (2U)
/** Fatal error result */
#define CY_RSLT_TYPE_FATAL (3U)
/** \} group_result_severity */
/**
* \addtogroup group_result_modules
* \{
* Defines codes to identify the module from which an error originated.
* For some large libraries, a range of module codes is defined here;
* see the library documentation for values corresonding to individual modules.
*/
/**** DRIVER Module codes: 0x0000 - 0x00FF ****/
/** Base identifier for peripheral driver library modules (0x0000 - 0x007F) */
#define CY_RSLT_MODULE_DRIVERS_PDL_BASE (0x0000U)
/** Base identifier for wireless host driver library modules (0x0080 - 0x00FF) */
#define CY_RSLT_MODULE_DRIVERS_WHD_BASE (0x0080U)
/** Base identifier for HAL modules (0x0100 - 0x017F) */
#define CY_RSLT_MODULE_ABSTRACTION_HAL_BASE (0x0100U)
/** Module identifier for board support package */
#define CY_RSLT_MODULE_ABSTRACTION_BSP (0x0180U)
/** Module identifier for file system abstraction */
#define CY_RSLT_MODULE_ABSTRACTION_FS (0x0181U)
/** Module identifier for resource abstraction */
#define CY_RSLT_MODULE_ABSTRACTION_RESOURCE (0x0182U)
/** Module identifier for rtos abstraction */
#define CY_RSLT_MODULE_ABSTRACTION_OS (0x0183U)
/** Base identifier for environment abstraction modules (0x0184 - 0x01FF) */
#define CY_RSLT_MODULE_ABSTRACTION_ENV (0x0184U)
/** Base identifier for Middleware module codes (0x0200 - 0x02FF) */
#define CY_RSLT_MODULE_MIDDLEWARE_BASE (0x0200U)
/** \} group_result_modules */
#ifdef __cplusplus
}

View File

@ -35,11 +35,7 @@
*******************************************************************************/
/**
* \addtogroup group_hal
* \{
* TODO: high-level HAL description
* update hal/include/cyhal.h to change this text
* \} group_hal
* \defgroup group_hal HAL Drivers
*/
#pragma once
@ -68,6 +64,3 @@
#include "cyhal_uart.h"
#include "cyhal_usb_dev.h"
#include "cyhal_wdt.h"
/** \} group_hal */

View File

@ -31,11 +31,8 @@
* \{
* High level interface for interacting with the Cypress ADC.
*
* \defgroup group_hal_adc_macros Macros
* \defgroup group_hal_adc_functions ADC Functions
* \defgroup group_hal_adc_channel_functions ADC Channel Functions
* \defgroup group_hal_adc_data_structures Data Structures
* \defgroup group_hal_adc_enums Enumerated Types
*/
#pragma once
@ -50,11 +47,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_adc_macros
* \{
*/
/** Maximum value that the ADC can return */
#define CYHAL_ADC_MAX_VALUE 0xFFFF
@ -67,8 +59,6 @@ extern "C" {
/** No channels available */
#define CYHAL_ADC_RSLT_NO_CHANNELS (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_ADC, 3))
/** \} group_hal_adc_macros */
/**
* \addtogroup group_hal_adc_functions

View File

@ -31,10 +31,6 @@
* \{
* High level interface for interacting with the Cypress CRC.
*
* \defgroup group_hal_crc_macros Macros
* \defgroup group_hal_crc_functions Functions
* \defgroup group_hal_crc_data_structures Data Structures
* \defgroup group_hal_crc_enums Enumerated Types
*/
#pragma once
@ -49,23 +45,10 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_crc_macros
* \{
*/
/** Invalid argument */
#define CYHAL_CRC_RSLT_ERR_BAD_ARGUMENT (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_CRC, 0))
/** \} group_hal_crc_macros */
/**
* \addtogroup group_hal_crc_data_structures
* \{
*/
/** CRC algorithm parameters */
/** @brief CRC algorithm parameters */
typedef struct
{
uint32_t width; //!< Bit width of the CRC
@ -82,14 +65,6 @@ typedef struct
bool remReverse; //!< If 1, the remainder is reversed. If 0, it is not.
} crc_algorithm_t;
/** \} group_hal_crc_data_structures */
/**
* \addtogroup group_hal_crc_functions
* \{
*/
/** Initialize the CRC generator. This function reserves the CRYPTO block for CRC calculations.
*
* @param[out] obj The CRC generator object
@ -131,8 +106,6 @@ cy_rslt_t cyhal_crc_compute(const cyhal_crc_t *obj, const uint8_t *data, size_t
*/
cy_rslt_t cyhal_crc_finish(const cyhal_crc_t *obj, uint32_t *crc);
/** \} group_hal_crc_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -31,10 +31,6 @@
* \{
* High level interface for interacting with the Cypress DAC.
*
* \defgroup group_hal_dac_macros Macros
* \defgroup group_hal_dac_functions Functions
* \defgroup group_hal_dac_data_structures Data Structures
* \defgroup group_hal_dac_enums Enumerated Types
*/
#pragma once
@ -49,24 +45,11 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_dac_macros
* \{
*/
/** Bad argument */
#define CYHAL_DAC_RSLT_BAD_ARGUMENT (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_DAC, 0))
/** Failed to initialize DAC */
#define CYHAL_DAC_RSLT_FAILED_INIT (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_DAC, 1))
/** \} group_hal_adc_macros */
/**
* \addtogroup group_hal_dac_functions
* \{
*/
/** Initialize the DAC peripheral
*
* Configures the pin used by dac.
@ -102,8 +85,6 @@ void cyhal_dac_write(const cyhal_dac_t *obj, uint16_t value);
*/
uint16_t cyhal_dac_read(cyhal_dac_t *obj);
/** \} group_hal_dac_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* Flash HAL high-level description
*
* \defgroup group_hal_flash_macros Macros
* \defgroup group_hal_flash_functions Functions
* \defgroup group_hal_flash_data_structures Data Structures
* \defgroup group_hal_flash_enums Enumerated Types
*/
@ -50,22 +45,10 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_flash_macros
* \{
*/
/** Invalid argument */
#define CYHAL_FLASH_RSLT_ERR_ADDRESS (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_FLASH, 0))
/** \} group_hal_flash_macros */
/**
* \addtogroup group_hal_flash_data_structures
* \{
*/
/** Information about a single block of flash memory */
/** @brief Information about a single block of flash memory */
typedef struct
{
uint32_t start_address; //!< Start address of the memory
@ -75,25 +58,17 @@ typedef struct
uint8_t erase_value; //!< The flash erase value
} cyhal_flash_block_info_t;
/** Information about all of the blocks of flash memory */
/** @brief Information about all of the blocks of flash memory */
typedef struct
{
uint8_t block_count; //!< The number of distinct flash blocks
const cyhal_flash_block_info_t *blocks; //!< Array of the distinct flash blocks
} cyhal_flash_info_t;
/** \} group_hal_flash_data_structures */
/*******************************************************************************
* Functions
*******************************************************************************/
/**
* \addtogroup group_hal_flash_functions
* \{
*/
/** Initialize the flash_t object for access to flash through the HAL
*
* @param[out] obj The flash object
@ -215,10 +190,6 @@ cy_rslt_t cyhal_flash_start_program(cyhal_flash_t *obj, uint32_t address, const
*/
bool cyhal_flash_is_operation_complete(cyhal_flash_t *obj);
/** \} group_hal_flash_functions */
/** \} group_hal_flash_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress GPIO.
*
* \defgroup group_hal_gpio_macros Macros
* \defgroup group_hal_gpio_functions Functions
* \defgroup group_hal_gpio_data_structures Data Structures
* \defgroup group_hal_gpio_enums Enumerated Types
*/
#pragma once
@ -52,22 +47,9 @@ extern "C" {
* Defines
*******************************************************************************/
/**
* \addtogroup group_hal_gpio_macros
* \{
*/
/** Integer representation of no connect pin (required to exist in all BSPs) */
#define CYHAL_NC_PIN_VALUE ((cyhal_gpio_t)0xFFFFFFFF)
/** \} group_hal_gpio_macros */
/**
* \addtogroup group_hal_gpio_enums
* \{
*/
/*******************************************************************************
* Enumerations
*******************************************************************************/
@ -99,25 +81,9 @@ typedef enum {
CYHAL_GPIO_DRIVE_PULLUPDOWN, /**< Pull-up and pull-down resistors */
} cyhal_gpio_drive_mode_t;
/** \} group_hal_gpio_enums */
/**
* \addtogroup group_hal_gpio_data_structures
* \{
*/
/** GPIO callback function type */
typedef void (*cyhal_gpio_event_callback_t)(void *callback_arg, cyhal_gpio_event_t event);
/** \} group_hal_gpio_data_structures */
/**
* \addtogroup group_hal_gpio_functions
* \{
*/
/*******************************************************************************
* Functions
*******************************************************************************/
@ -186,8 +152,6 @@ void cyhal_gpio_register_callback(cyhal_gpio_t pin, cyhal_gpio_event_callback_t
*/
void cyhal_gpio_enable_event(cyhal_gpio_t pin, cyhal_gpio_event_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_gpio_functions */
/*******************************************************************************
* Backward compatibility macro. The following code is DEPRECATED and must
* not be used in new projects

View File

@ -23,15 +23,9 @@
*******************************************************************************/
/**
* \addtogroup group_hal_hw_resources PSoC 6 Hardware Resources
* \addtogroup group_hal_psoc6_hw_types
* \ingroup group_hal_psoc6
* \{
* Struct definitions for configuration resources in the PDL.
*
* \defgroup group_hal_hw_resources_macros Macros
* \defgroup group_hal_hw_resources_functions Functions
* \defgroup group_hal_hw_resources_data_structures Data Structures
* \defgroup group_hal_hw_resources_enums Enumerated Types
*/
#pragma once
@ -40,11 +34,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_hw_resources_enums
* \{
*/
/* NOTE: Any changes made to this enum must also be made to the hardware manager resource tracking */
/** Resource types that the hardware manager supports */
typedef enum
@ -74,15 +63,9 @@ typedef enum
CYHAL_RSC_INVALID, /*!< Placeholder for invalid type */
} cyhal_resource_t;
/** \} group_hal_hw_resources_enums */
/**
* \addtogroup group_hal_hw_resources_data_structures
* \{
*/
/** Represents a particular instance of a resource on the chip */
/**
* @brief Represents a particular instance of a resource on the chip
*/
typedef struct
{
cyhal_resource_t type; //!< The resource block type
@ -91,12 +74,10 @@ typedef struct
* The channel number, if the resource type defines multiple channels
* per block instance. Otherwise, 0 */
uint8_t channel_num;
} cyhal_resource_inst_t;
/** \} group_hal_hw_resources_data_structures */
} cyhal_resource_inst_t;
#if defined(__cplusplus)
}
#endif /* __cplusplus */
/** \} group_hal_hw_resources */
/** \} group_hal_psoc6_hw_types */

View File

@ -23,13 +23,11 @@
*******************************************************************************/
/**
* \addtogroup group_hal_hw_types PSoC 6 Hardware Types
* \addtogroup group_hal_psoc6_hw_types Implementation-defined types
* \ingroup group_hal_psoc6
* \{
* Struct definitions for configuration resources in the PDL.
*
* \defgroup group_hal_hw_types_macros Macros
* \defgroup group_hal_hw_types_data_structures Data Structures
* Aliases for types which are part of the public HAL interface but whose representations are
* need to vary per HAL implementation
*/
#pragma once
@ -47,16 +45,16 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_hw_types_macros
* \{
*/
/** Default priority for interrupts */
#ifndef CYHAL_ISR_PRIORITY_DEFAULT
/** Default priority for interrupts */
#define CYHAL_ISR_PRIORITY_DEFAULT (7)
#endif
/**
* \cond INTERNAL
*/
#define CYHAL_CRC_IMPL_HEADER "cyhal_crc_impl.h" //!< Implementation specific header for CRC
#define CYHAL_GPIO_IMPL_HEADER "cyhal_gpio_impl.h" //!< Implementation specific header for GPIO
#define CYHAL_PWM_IMPL_HEADER "cyhal_pwm_impl.h" //!< Implementation specific header for PWM
@ -64,33 +62,50 @@ extern "C" {
#define CYHAL_TIMER_IMPL_HEADER "cyhal_timer_impl.h" //!< Implementation specific header for Timer
#define CYHAL_TRNG_IMPL_HEADER "cyhal_trng_impl.h" //!< Implementation specific header for TRNG
/** \} group_hal_hw_types_macros */
/** \endcond */
/**
* \addtogroup group_hal_hw_types_data_structures
* \{
*/
typedef uint32_t cyhal_source_t; //!< Routable signal source
typedef uint32_t cyhal_dest_t; //!< Routable signal destination
/** Callbacks for Sleep and Deepsleep APIs */
#define cyhal_system_callback_t cy_stc_syspm_callback_t
/** Available clock divider types */
typedef cy_en_divider_types_t cyhal_clock_divider_types_t;
/** Clock divider object */
/** Divider for CM4, CM0 and Peri clock. Supports values between [1, 256] */
typedef uint16_t cyhal_system_divider_t;
/** Enum for clock type to configure. HFCLKs are configured using different APIs and does not using this enum */
typedef enum
{
CYHAL_SYSTEM_CLOCK_CM4,
CYHAL_SYSTEM_CLOCK_CM0,
CYHAL_SYSTEM_CLOCK_PERI,
} cyhal_system_clock_t;
/** @brief Clock divider object */
typedef struct {
cyhal_clock_divider_types_t div_type;
uint8_t div_num;
} cyhal_clock_divider_t;
/** Event callback data object */
/** @brief Event callback data object */
typedef struct {
cy_israddress callback;
void* callback_arg;
} cyhal_event_callback_data_t;
/**
* \addtogroup group_hal_psoc6_hw_types_handle Instance Handles
* \{
* Structs which retain data which needs to persist across HAL API calls. From the perspective of the
* generic HAL interface, these are opaque; the contents are specific to this implementation.
*/
/** ADC object */
/** @brief ADC object */
typedef struct {
#ifdef CY_IP_MXS40PASS_SAR
SAR_Type* base;
@ -105,7 +120,7 @@ typedef struct {
#endif
} cyhal_adc_t;
/** ADC channel object */
/** @brief ADC channel object */
typedef struct {
#ifdef CY_IP_MXS40PASS_SAR
cyhal_adc_t* adc;
@ -116,7 +131,7 @@ typedef struct {
#endif
} cyhal_adc_channel_t;
/** Comparator object */
/** @brief Comparator object */
typedef struct {
#if defined(CY_IP_MXLPCOMP_INSTANCES) || defined(PASS_NR_CTBS)
/* TODO: define */
@ -126,7 +141,7 @@ typedef struct {
#endif
} cyhal_comp_t;
/** CRC object */
/** @brief CRC object */
typedef struct {
#if defined(CY_IP_MXCRYPTO_INSTANCES) || defined(CPUSS_CRYPTO_PRESENT)
CRYPTO_Type* base;
@ -135,7 +150,7 @@ typedef struct {
#endif
} cyhal_crc_t;
/** DAC object */
/** @brief DAC object */
typedef struct {
#ifdef CY_IP_MXS40PASS_CTDAC
CTDAC_Type* base;
@ -146,7 +161,7 @@ typedef struct {
#endif
} cyhal_dac_t;
/** DMA object */
/** @brief DMA object */
typedef struct {
#if defined(CY_IP_M4CPUSS_DMAC_INSTANCES) || defined(CY_IP_M4CPUSS_DMA_INSTANCES)
cyhal_resource_inst_t resource;
@ -155,12 +170,12 @@ typedef struct {
#endif
} cyhal_dma_t;
/** Flash object */
/** @brief Flash object */
typedef struct {
void *empty;
} cyhal_flash_t;
/** I2C object */
/** @brief I2C object */
typedef struct {
#ifdef CY_IP_MXSCB
CySCB_Type* base;
@ -184,7 +199,7 @@ typedef struct {
#endif
} cyhal_i2c_t;
/** I2S object */
/** @brief I2S object */
typedef struct {
#ifdef CY_IP_MXAUDIOSS_INSTANCES
/* TODO: define */
@ -194,7 +209,7 @@ typedef struct {
#endif
} cyhal_i2s_t;
/** LPTIMER object */
/** @brief LPTIMER object */
typedef struct {
#ifdef CY_IP_MXS40SRSS_MCWDT_INSTANCES
MCWDT_STRUCT_Type *base;
@ -205,7 +220,7 @@ typedef struct {
#endif
} cyhal_lptimer_t;
/** OpAmp object */
/** @brief OpAmp object */
typedef struct {
#ifdef PASS_NR_CTBS
/* TODO: define */
@ -215,7 +230,7 @@ typedef struct {
#endif
} cyhal_opamp_t;
/** PDM-PCM object */
/** @brief PDM-PCM object */
typedef struct {
#ifdef CY_IP_MXAUDIOSS_INSTANCES
/* TODO: define */
@ -225,7 +240,7 @@ typedef struct {
#endif
} cyhal_pdm_pcm_t;
/** PWM object */
/** @brief PWM object */
typedef struct {
#ifdef CY_IP_MXTCPWM
TCPWM_Type* base;
@ -240,7 +255,7 @@ typedef struct {
#endif
} cyhal_pwm_t;
/** SMIF object */
/** @brief SMIF object */
typedef struct {
#ifdef CY_IP_MXSMIF
SMIF_Type* base;
@ -260,7 +275,7 @@ typedef struct {
#endif /* ifdef CY_IP_MXSMIF */
} cyhal_qspi_t;
/** RNG object */
/** @brief RNG object */
typedef struct {
#if defined(CY_IP_MXCRYPTO_INSTANCES) || defined(CPUSS_CRYPTO_PRESENT)
CRYPTO_Type* base;
@ -268,12 +283,12 @@ typedef struct {
#endif
} cyhal_trng_t;
/** RTC object */
/** @brief RTC object */
typedef struct {
uint8_t placeholder;
} cyhal_rtc_t;
/** SDHC object */
/** @brief SDHC object */
typedef struct {
#ifdef CY_IP_MXSDHC
SDHC_Type* base;
@ -298,7 +313,7 @@ typedef struct {
#endif
} cyhal_sdhc_t;
/** SDIO object */
/** @brief SDIO object */
typedef struct {
#if defined(CY_IP_MXSDHC)
SDHC_Type* base;
@ -346,7 +361,7 @@ typedef struct {
#endif /* defined(CY_IP_MXSDHC) */
} cyhal_sdio_t;
/** SPI object */
/** @brief SPI object */
typedef struct {
#ifdef CY_IP_MXSCB
CySCB_Type* base;
@ -377,21 +392,7 @@ typedef struct {
#endif
} cyhal_spi_t;
/** Callbacks for Sleep and Deepsleep APIs */
#define cyhal_system_callback_t cy_stc_syspm_callback_t
/** Enum for clock type to configure. HFCLKs are configured using different APIs and does not using this enum */
typedef enum
{
CYHAL_SYSTEM_CLOCK_CM4,
CYHAL_SYSTEM_CLOCK_CM0,
CYHAL_SYSTEM_CLOCK_PERI,
} cyhal_system_clock_t;
/** Divider for CM4, CM0 and Peri clock. Supports values between [1, 256] */
typedef uint16_t cyhal_system_divider_t;
/** Timer object */
/** @brief Timer object */
typedef struct {
#ifdef CY_IP_MXTCPWM
TCPWM_Type* base;
@ -409,7 +410,7 @@ typedef struct {
#endif
} cyhal_timer_t;
/** UART object */
/** @brief UART object */
typedef struct {
#ifdef CY_IP_MXSCB
CySCB_Type* base;
@ -433,7 +434,7 @@ typedef struct {
#endif
} cyhal_uart_t;
/** USB Device object */
/** @brief USB Device object */
typedef struct {
#ifdef CY_IP_MXUSBFS
USBFS_Type* base;
@ -451,15 +452,15 @@ typedef struct {
#endif
} cyhal_usb_dev_t;
/** WDT object */
/** @brief WDT object */
typedef struct {
uint8_t placeholder;
} cyhal_wdt_t;
/** \} group_hal_hw_types_data_structures */
/** \} group_hal_psoc6_hw_types_handles */
#if defined(__cplusplus)
}
#endif /* __cplusplus */
/** \} group_hal_hw_types */
/** \} group_hal_psoc6_hw_types */

View File

@ -29,10 +29,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress Hardware Manager.
*
* \defgroup group_hal_hwmgr_macros Macros
* \defgroup group_hal_hwmgr_functions Functions
* \defgroup group_hal_hwmgr_data_structures Data Structures
*/
#pragma once
@ -47,11 +43,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_hwmgr_macros
* \{
*/
/** The requested resource type is invalid */
#define CYHAL_HWMGR_RSLT_ERR_INVALID (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_CHIP_HWMGR, 0))
/** The requested resource is already in use */
@ -62,14 +53,6 @@ extern "C" {
/** Attempt to free a resource that was not used */
#define CYHAL_HWMGR_RSLT_WARN_UNUSED (CY_RSLT_CREATE(CY_RSLT_TYPE_WARNING, CYHAL_RSLT_MODULE_CHIP_HWMGR, 50))
/** \} group_hal_hwmgr_macros */
/**
* \addtogroup group_hal_hwmgr_functions
* \{
*/
/** Initializes the hardware manager to keep track of what resources are being used.
*
* @return The status of the init request
@ -119,8 +102,6 @@ cy_rslt_t cyhal_hwmgr_allocate_clock(cyhal_clock_divider_t* obj, cyhal_clock_div
*/
void cyhal_hwmgr_free_clock(cyhal_clock_divider_t* obj);
/** \} group_hal_hwmgr_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -30,11 +30,9 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress I2C.
*
* \defgroup group_hal_i2c_macros Macros
* \defgroup group_hal_i2c_functions Functions
* \defgroup group_hal_i2c_data_structures Data Structures
* \defgroup group_hal_i2c_enums Enumerated Types
*
* \defgroup group_hal_i2c_master Master
* \defgroup group_hal_i2c_slave Slave
*/
#pragma once
@ -49,11 +47,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_i2c_macros
* \{
*/
/** The requested resource type is invalid */
#define CYHAL_I2C_RSLT_ERR_INVALID_PIN (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_I2C, 0))
/** Can not reach desired data rate */
@ -61,14 +54,6 @@ extern "C" {
/** Address size is not correct, should be 1 or two */
#define CYHAL_I2C_RSLT_ERR_INVALID_ADDRESS_SIZE (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_I2C, 2))
/** \} group_hal_i2c_macros */
/**
* \addtogroup group_hal_i2c_enums
* \{
*/
/** Enum to enable/disable/report interrupt cause flags. */
typedef enum
{
@ -86,18 +71,10 @@ typedef enum
CYHAL_I2C_MASTER_ERR_EVENT = 1 << 20, /* Indicates the I2C hardware has detected an error. */
} cyhal_i2c_event_t;
/** \} group_hal_i2c_enums */
/**
* \addtogroup group_hal_i2c_data_structures
* \{
*/
/** Handler for I2C events */
typedef void (*cyhal_i2c_event_callback_t)(void *callback_arg, cyhal_i2c_event_t event);
/** Initial I2C configuration */
/** @brief Initial I2C configuration */
typedef struct
{
bool is_slave; /* I2C mode, is the device a master or slave */
@ -105,14 +82,6 @@ typedef struct
uint32_t frequencyhal_hz; /* Frequency that the I2C bus runs at */
} cyhal_i2c_cfg_t;
/** \} group_hal_i2c_data_structures */
/**
* \addtogroup group_hal_i2c_functions
* \{
*/
/** Initialize the I2C peripheral, and configures its specifieds pins. By default
* it is setup as a Master running at 400kHz. This can be changed by calling
* cyhal_i2c_configure().
@ -141,6 +110,11 @@ void cyhal_i2c_free(cyhal_i2c_t *obj);
*/
cy_rslt_t cyhal_i2c_configure(cyhal_i2c_t *obj, const cyhal_i2c_cfg_t *cfg);
/**
* \addtogroup group_hal_i2c_master
* \{
*/
/**
* I2C master write
*
@ -169,6 +143,13 @@ cy_rslt_t cyhal_i2c_master_write(cyhal_i2c_t *obj, uint16_t dev_addr, const uint
*/
cy_rslt_t cyhal_i2c_master_read(cyhal_i2c_t *obj, uint16_t dev_addr, uint8_t *data, uint16_t size, uint32_t timeout, bool send_stop);
/** \} group_hal_i2c_master */
/**
* \addtogroup group_hal_i2c_slave
* \{
*/
/**
* I2C slave config write buffer
* The user needs to setup a new buffer every time (i.e. call slave_send and slave_recv every time the buffer has been used up)
@ -193,6 +174,13 @@ cy_rslt_t cyhal_i2c_slave_config_write_buff(cyhal_i2c_t *obj, const uint8_t *dat
*/
cy_rslt_t cyhal_i2c_slave_config_read_buff(cyhal_i2c_t *obj, uint8_t *data, uint16_t size);
/** \} group_hal_i2c_slave */
/**
* \addtogroup group_hal_i2c_master
* \{
*/
/** Perform an i2c write using a block of data stored at the specified memory location
*
* @param[in] obj The I2C object
@ -231,6 +219,8 @@ cy_rslt_t cyhal_i2c_master_mem_read(cyhal_i2c_t *obj, uint16_t address, uint16_t
*/
cy_rslt_t cyhal_i2c_master_transfer_async(cyhal_i2c_t *obj, uint16_t address, const void *tx, size_t tx_size, void *rx, size_t rx_size);
/** \} group_hal_i2c_master */
/** Abort asynchronous transfer
*
* This function does not perform any check - that should happen in upper layers.
@ -256,8 +246,6 @@ void cyhal_i2c_register_callback(cyhal_i2c_t *obj, cyhal_i2c_event_callback_t ca
*/
void cyhal_i2c_enable_event(cyhal_i2c_t *obj, cyhal_i2c_event_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_i2c_functions */
/*******************************************************************************
* Backward compatibility macro. The following code is DEPRECATED and must
* not be used in new projects

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress digital routing.
*
* \defgroup group_hal_interconnect_macros Macros
* \defgroup group_hal_interconnect_functions Functions
* \defgroup group_hal_interconnect_data_structures Data Structures
* \defgroup group_hal_interconnect_enums Enumerated Types
*/
#pragma once
@ -49,11 +44,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_interconnect_macros
* \{
*/
/** No connection is available */
#define CYHAL_CONNECT_RSLT_NO_CONNECTION (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_INTERCONNECT, 0))
/** The connections source and destination are already connected */
@ -64,14 +54,6 @@ extern "C" {
/** Indicates that a mux output does not continue to another mux */
#define CYHAL_INTERCONNECT_MUX_NOT_CONTINUATION 0xFF
/** \} group_hal_interconnect_macros */
/**
* \addtogroup group_hal_interconnect_functions
* \{
*/
/** Connect a pin to a peripheral terminal. This will route a direct connect from the pin to the peripheral.
* Any previous direct connection from the pin will be overriden.
* @param[in] pin_connection Details about the pin and its target connection
@ -95,8 +77,6 @@ cy_rslt_t cyhal_disconnect_pin(cyhal_gpio_t pin);
*/
cy_rslt_t cyhal_connect_trigger(cyhal_source_t source, cyhal_dest_t dest);
/** \} group_hal_interconnect_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress LPTIMER.
*
* \defgroup group_hal_lptimer_macros Macros
* \defgroup group_hal_lptimer_functions Functions
* \defgroup group_hal_lptimer_data_structures Data Structures
* \defgroup group_hal_lptimer_enums Enumerated Types
*/
#pragma once
@ -48,35 +43,14 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_lptimer_enums
* \{
*/
/** LPTIMER interrupt triggers */
typedef enum {
CYHAL_LPTIMER_COMPARE_MATCH,
} cyhal_lptimer_event_t;
/** \} group_hal_lptimer_enums */
/**
* \addtogroup group_hal_lptimer_data_structures
* \{
*/
/** Handler for LPTIMER interrupts */
typedef void (*cyhal_lptimer_event_callback_t)(void *callback_arg, cyhal_lptimer_event_t event);
/** \} group_hal_lptimer_data_structures */
/**
* \addtogroup group_hal_lptimer_functions
* \{
*/
/** Initialize the LPTIMER
*
* Initialize or re-initialize the LPTIMER. This resets all the
@ -168,8 +142,6 @@ void cyhal_lptimer_enable_event(cyhal_lptimer_t *obj, cyhal_lptimer_event_t even
*/
void cyhal_lptimer_irq_trigger(cyhal_lptimer_t *obj);
/** \} group_hal_lptimer_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -24,12 +24,8 @@
*******************************************************************************/
/**
* \addtogroup group_hal_modules Driver Modules
* \ingroup group_hal
* \{
* Enum definition for all HAL resource modules.
*
* \defgroup group_hal_modules_enums Enumerated Types
*/
#pragma once
@ -40,12 +36,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_modules_enums
* \{
*/
/** Enum to in indicate which module an errors occurred in. */
enum cyhal_rslt_module_chip
{
@ -76,10 +66,8 @@ enum cyhal_rslt_module_chip
CYHAL_RSLT_MODULE_WDT, //!< An error occurred in WDT module
};
/** \} group_hal_modules_enums */
#if defined(__cplusplus)
}
#endif /* __cplusplus */
/** \} group_hal_modules */
/** \} group_hal */

View File

@ -23,15 +23,10 @@
*******************************************************************************/
/**
* \addtogroup group_hal_pin_package PSoC 6 Pin Packages
* \addtogroup group_hal_psoc6_pin_package Pins
* \ingroup group_hal_psoc6
* \{
* Definitions for the pinout for each supported device
*
* \defgroup group_hal_pin_package_macros Macros
* \defgroup group_hal_pin_package_functions Functions
* \defgroup group_hal_pin_package_data_structures Data Structures
* \defgroup group_hal_pin_package_enums Enumerated Types
*/
#pragma once
@ -42,11 +37,6 @@
extern "C" {
#endif /* __cplusplus */
/**
* \addtogroup group_hal_pin_package_enums
* \{
*/
/** Port names */
typedef enum {
CYHAL_PORT_0 = 0x0,
@ -67,25 +57,19 @@ typedef enum {
CYHAL_PORT_15 = 0xF,
} cyhal_port_t;
/** \} group_hal_pin_package_enums */
/**
* \addtogroup group_hal_pin_package_data_structures
* \{
*/
/** GPIO pin configuration object */
/** Bitfield representing the configuration of a GPIO (hsiom selection and mode).
* Use the CY_GPIO_CFG_GET_MODE and CY_GPIO_CFG_GET_HSIOM to extract the
* individual field values.
*/
typedef uint16_t cyhal_gpio_mapping_cfg_t; // 8bit hsiom, 8bit mode
/** \} group_hal_pin_package_data_structures */
/** Extract the GPIO mode setting from a cyhal_gpio_mapping_cfg_t */
#define CY_GPIO_CFG_GET_MODE(x) ((uint8_t)((x) & 0xFF))
/** Extract the HSIOM selection from a cyhal_gpio_mapping_cfg_t */
#define CY_GPIO_CFG_GET_HSIOM(x) ((en_hsiom_sel_t)(((x) >> 8) & 0xFF))
/** \cond INTERNAL */
#define CY_GPIO_CFG_CREATE(hsiom, mode) ((cyhal_gpio_mapping_cfg_t)(((hsiom) << 8) + (mode)))
#define CY_GPIO_CFG_GET_MODE(x) ((uint8_t)((x) & 0xFF))
#define CY_GPIO_CFG_GET_HSIOM(x) ((en_hsiom_sel_t)(((x) >> 8) & 0xFF))
#define CYHAL_PIN_OUT_FUNCTION(hsiom) CY_GPIO_CFG_CREATE(hsiom, CY_GPIO_DM_STRONG_IN_OFF)
#define CYHAL_PIN_OUT_BUF_FUNCTION(hsiom) CY_GPIO_CFG_CREATE(hsiom, CY_GPIO_DM_STRONG)

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress PWM.
*
* \defgroup group_hal_pwm_macros Macros
* \defgroup group_hal_pwm_functions Functions
* \defgroup group_hal_pwm_data_structures Data Structures
* \defgroup group_hal_pwm_enums Enumerated Types
*/
#pragma once
@ -48,11 +43,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_pwm_macros
* \{
*/
/** Bad argument */
#define CYHAL_PWM_RSLT_BAD_ARGUMENT (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_PWM, 0))
/** Failed to initialize PWM clock */
@ -60,14 +50,6 @@ extern "C" {
/** Failed to initialize PWM */
#define CYHAL_PWM_RSLT_FAILED_INIT (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_PWM, 2))
/** \} group_hal_pwm_macros */
/**
* \addtogroup group_hal_pwm_enums
* \{
*/
/** PWM interrupt triggers */
typedef enum {
CYHAL_PWM_IRQ_NONE = 0,
@ -76,25 +58,9 @@ typedef enum {
CYHAL_PWM_IRQ_ALL = (1 << 2) - 1,
} cyhal_pwm_event_t;
/** \} group_hal_pwm_enums */
/**
* \addtogroup group_hal_pwm_data_structures
* \{
*/
/** Handler for PWM interrupts */
typedef void(*cyhal_pwm_event_callback_t)(void *callback_arg, cyhal_pwm_event_t event);
/** \} group_hal_pwm_data_structures */
/**
* \addtogroup group_hal_pwm_functions
* \{
*/
/** Initialize the PWM out peripheral and configure the pin
*
* @param[out] obj The PWM object to initialize
@ -159,8 +125,6 @@ void cyhal_pwm_register_callback(cyhal_pwm_t *obj, cyhal_pwm_event_callback_t ca
*/
void cyhal_pwm_enable_event(cyhal_pwm_t *obj, cyhal_pwm_event_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_pwm_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress Quad-SPI.
*
* \defgroup group_hal_qspi_macros Macros
* \defgroup group_hal_qspi_functions Functions
* \defgroup group_hal_qspi_data_structures Data Structures
* \defgroup group_hal_qspi_enums Enumerated Types
*/
#pragma once
@ -49,11 +44,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_qspi_enums
* \{
*/
/** QSPI Bus width
*
* Some parts of commands provide variable bus width
@ -80,27 +70,12 @@ typedef enum {
CYHAL_QSPI_IRQ_RECEIVE_DONE = 1 << 1, /**< Async receive done. >*/
} cyhal_qspi_event_t;
/** \} group_hal_qspi_enums */
/**
* \addtogroup group_hal_qspi_macros
* \{
*/
#define CYHAL_QSPI_RSLT_ERR_BUS_WIDTH (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_QSPI, 0)) /**< Bus width Error. >*/
#define CYHAL_QSPI_RSLT_ERR_PIN (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_QSPI, 1)) /**< Pin related Error. >*/
#define CYHAL_QSPI_RSLT_ERR_DATA_SEL (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_QSPI, 2)) /**< Data select Error. >*/
#define CYHAL_QSPI_RSLT_ERR_INSTANCE (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_QSPI, 3)) /**< QSPI instance related Error. >*/
/** \} group_hal_qspi_macros */
/**
* \addtogroup group_hal_qspi_data_structures
* \{
*/
/** QSPI command settings */
/** @brief QSPI command settings */
typedef struct cyhal_qspi_command {
struct {
cyhal_qspi_bus_width_t bus_width; /**< Bus width for the instruction >*/
@ -128,14 +103,6 @@ typedef struct cyhal_qspi_command {
/** Handler for QSPI callbacks */
typedef void (*cyhal_qspi_event_callback_t)(void *callback_arg, cyhal_qspi_event_t event);
/** \} group_hal_qspi_data_structures */
/**
* \addtogroup group_hal_qspi_functions
* \{
*/
/** Initialize QSPI peripheral.
*
* It should initialize QSPI pins (io0-io7, sclk and ssel), set frequency, clock polarity and phase mode.
@ -256,8 +223,6 @@ void cyhal_qspi_register_callback(cyhal_qspi_t *obj, cyhal_qspi_event_callback_t
*/
void cyhal_qspi_enable_event(cyhal_qspi_t *obj, cyhal_qspi_event_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_qspi_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress RTC.
*
* \defgroup group_hal_rtc_macros Macros
* \defgroup group_hal_rtc_functions Functions
* \defgroup group_hal_rtc_data_structures Data Structures
* \defgroup group_hal_rtc_enums Enumerated Types
*/
#pragma once
@ -53,25 +48,12 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_rtc_enums
* \{
*/
/** RTC interrupt triggers */
typedef enum {
CYHAL_RTC_ALARM,
} cyhal_rtc_event_t;
/** \} group_hal_rtc_enums */
/**
* \addtogroup group_hal_rtc_data_structures
* \{
*/
/** Defines which fields should be active for the alarm. */
/** @brief Defines which fields should be active for the alarm. */
typedef struct
{
uint8_t en_sec : 1; /** !< Enable match of seconds */
@ -85,14 +67,6 @@ typedef struct
/** Handler for RTC events */
typedef void (*cyhal_rtc_event_callback_t)(void *callback_arg, cyhal_rtc_event_t event);
/** \} group_hal_rtc_data_structures */
/**
* \addtogroup group_hal_rtc_functions
* \{
*/
/** Initialize the RTC peripheral
*
* Powerup the RTC in preparation for access. This function must be called
@ -167,8 +141,6 @@ void cyhal_rtc_register_callback(cyhal_rtc_t *obj, cyhal_rtc_event_callback_t ca
*/
void cyhal_rtc_enable_event(cyhal_rtc_t *obj, cyhal_rtc_event_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_rtc_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -23,16 +23,10 @@
*******************************************************************************/
/**
* \addtogroup group_hal_scb_common PSoC 6 SCB Common Functionality
* \addtogroup group_hal_psoc6_scb_common SCB Common Functionality
* \ingroup group_hal_psoc6
* \{
* Code shared between the SCB resources (UART, I2C, and SPI).
*
* \defgroup group_hal_scb_common_macros Macros
* \defgroup group_hal_scb_common_constants Constants
* \defgroup group_hal_scb_common_functions Functions
* \defgroup group_hal_scb_common_data_structures Data Structures
* \defgroup group_hal_scb_common_enums Enumerated Types
*/
#pragma once
@ -45,11 +39,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_scb_common_constants
* \{
*/
/** The start address of the SCB blocks */
extern CySCB_Type* const CYHAL_SCB_BASE_ADDRESSES[CY_IP_MXSCB_INSTANCES];
/** The interrupt number of the SCB blocks. */
@ -58,13 +47,6 @@ extern const IRQn_Type CYHAL_SCB_IRQ_N[CY_IP_MXSCB_INSTANCES];
/** The configuration structs for the resource in use on each SCB block (e.g. cyhal_i2c_t) */
extern void *cyhal_scb_config_structs[CY_IP_MXSCB_INSTANCES];
/** \} group_hal_scb_common_constants */
/**
* \addtogroup group_hal_scb_common_functions
* \{
*/
/** Get the SCB block corresponding to an IRQn.
*
@ -84,10 +66,8 @@ __STATIC_INLINE void *cyhal_scb_get_irq_obj(void)
return cyhal_scb_config_structs[block];
}
/** \} group_hal_scb_common_functions */
#if defined(__cplusplus)
}
#endif
/** \} group_hal_scb_common */
/** \} group_hal_psoc6_scb_common */

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress SDHC.
*
* \defgroup group_hal_sdhc_macros Macros
* \defgroup group_hal_sdhc_functions Functions
* \defgroup group_hal_sdhc_data_structures Data Structures
* \defgroup group_hal_sdhc_enums Enumerated Types
*/
#pragma once
@ -48,21 +43,8 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_sdhc_macros
* \{
*/
#define CYHAL_SDHC_RSLT_ERR_PIN (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_SDHC, 0)) /**< Pin related Error. >*/
/** \} group_hal_sdhc_macros */
/**
* \addtogroup group_hal_sdhc_enums
* \{
*/
/** Card types */
typedef enum
{
@ -95,28 +77,12 @@ typedef enum {
CYHAL_SDHC_ALL_INTERRUPTS = 0xFFFF, //!> Is used to enable/disable all interrupts
} cyhal_sdhc_event_t;
/** \} group_hal_sdhc_enums */
/**
* \addtogroup group_hal_sdhc_macros
* \{
*/
#define CYHAL_SDHC_RSLT_ERR_PIN (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_SDHC, 0)) /**< Pin related Error. >*/
/** \} group_hal_sdhc_macros */
/**
* \addtogroup group_hal_sdhc_data_structures
* \{
*/
/** Handler for SDHC interrupts */
typedef void (*cyhal_sdhc_event_callback_t)(void *callback_arg, cyhal_sdhc_event_t event);
/** Defines configuration options for the SDHC block */
/** @brief Defines configuration options for the SDHC block */
typedef struct
{
bool enableLedControl; //!< Drive one IO to indicate when the card is being accessed
@ -125,14 +91,6 @@ typedef struct
uint8_t busWidth; //!< The desired bus width
} cyhal_sdhc_config_t;
/** \} group_hal_sdhc_data_structures */
/**
* \addtogroup group_hal_sdhc_functions
* \{
*/
/** Initialize the SDHC peripheral
*
* @param[out] obj The SDHC object
@ -261,8 +219,6 @@ void cyhal_sdhc_register_callback(cyhal_sdhc_t *obj, cyhal_sdhc_event_callback_t
*/
void cyhal_sdhc_enable_event(cyhal_sdhc_t *obj, cyhal_sdhc_event_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_sdhc_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -31,10 +31,6 @@
* \{
* High level interface for interacting with the Cypress SDIO interface.
*
* \defgroup group_hal_sdio_macros Macros
* \defgroup group_hal_sdio_functions Functions
* \defgroup group_hal_sdio_data_structures Data Structures
* \defgroup group_hal_sdio_enums Enumerated Types
*/
#pragma once
@ -48,11 +44,10 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_sdio_macros
* \{
*/
* \addtogroup group_hal_sdio_errors Error Codes
* \{
*/
#define CYHAL_SDIO_RET_NO_ERRORS (0x00) /**< No error*/
#define CYHAL_SDIO_RET_NO_SP_ERRORS (0x01) /**< Non-specific error code*/
@ -96,12 +91,7 @@ extern "C" {
CYHAL_RSLT_MODULE_SDIO, \
CYHAL_SDIO_CANCELED)
/** \} group_hal_sdio_macros */
/**
* \addtogroup group_hal_sdio_enums
* \{
*/
/** \} group_hal_sdio_errors */
/** Commands that can be issued */
typedef enum
@ -149,15 +139,7 @@ typedef enum {
CYHAL_SDIO_ALL_INTERRUPTS = 0x0E1FF, //!> Is used to enable/disable all interrupts events
} cyhal_sdio_event_t;
/** \} group_hal_sdio_enums */
/**
* \addtogroup group_hal_sdio_data_structures
* \{
*/
/** SDIO controller initial configuration */
/** @brief SDIO controller initial configuration */
typedef struct
{
uint32_t frequencyhal_hz; //!< Clock frequency, in hertz
@ -167,14 +149,6 @@ typedef struct
/** Callback for SDIO events */
typedef void (*cyhal_sdio_event_callback_t)(void *callback_arg, cyhal_sdio_event_t event);
/** \} group_hal_sdio_data_structures */
/**
* \addtogroup group_hal_sdio_functions
* \{
*/
/** Initialize the SDIO peripheral
*
* @param[out] obj The SDIO object
@ -270,8 +244,6 @@ void cyhal_sdio_register_callback(cyhal_sdio_t *obj, cyhal_sdio_event_callback_t
*/
void cyhal_sdio_enable_event(cyhal_sdio_t *obj, cyhal_sdio_event_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_sdio_functions */
/*******************************************************************************
* Backward compatibility macro. The following code is DEPRECATED and must
* not be used in new projects

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress SPI.
*
* \defgroup group_hal_spi_macros Macros
* \defgroup group_hal_spi_functions Functions
* \defgroup group_hal_spi_data_structures Data Structures
* \defgroup group_hal_spi_enums Enumerated Types
*/
#pragma once
@ -50,11 +45,6 @@ extern "C" {
#endif
/**
* \addtogroup group_hal_spi_macros
* \{
*/
/** Bad argument */
#define CYHAL_SPI_RSLT_BAD_ARGUMENT (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_SPI, 0))
/** Failed to initialize SPI clock */
@ -70,8 +60,6 @@ extern "C" {
/** The requested resource type is invalid */
#define CYHAL_SPI_RSLT_ERR_INVALID_PIN (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_SPI, 7))
/** \} group_hal_spi_macros */
/** Compatibility define for cyhal_spi_set_frequency. */
#define cyhal_spi_frequency cyhal_spi_set_frequency
@ -109,7 +97,7 @@ typedef enum
CYHAL_SPI_MODE_11_LSB,
} cyhal_spi_mode_t;
/** Initial SPI configuration. */
/** @brief Initial SPI configuration. */
typedef struct
{
cyhal_spi_mode_t mode; //!< The operating mode
@ -251,8 +239,6 @@ void cyhal_spi_enable_event(cyhal_spi_t *obj, cyhal_spi_event_t event, uint8_t i
typedef cyhal_spi_event_t cyhal_spi_irq_event_t;
/** \endcond */
/** \} group_hal_spi_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -31,11 +31,6 @@
* \{
* High level interface for interacting with the Cypress power management
* and system clock configuration.
*
* \defgroup group_hal_system_macros Macros
* \defgroup group_hal_system_functions Functions
* \defgroup group_hal_system_data_structures Data Structures
* \defgroup group_hal_system_enums Enumerated Types
*/
#pragma once
@ -50,11 +45,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_system_macros
* \{
*/
/** An error occurred in System module */
#define CYHAL_SYSTEM_RSLT_ERROR (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_SYSTEM , 0))
/** An error occurred in System module */
@ -66,14 +56,6 @@ extern "C" {
/** An error occurred in System module */
#define CYHAL_SYSTEM_RSLT_NO_VALID_DIVIDER (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_SYSTEM , 4))
/** \} group_hal_system_macros */
/**
* \addtogroup group_hal_system_functions
* \{
*/
/** Enter a critical section
*
* Disables interrupts and returns a value indicating whether the interrupts were previously
@ -156,8 +138,6 @@ cy_rslt_t cyhal_system_clock_set_frequency(uint8_t clock, uint32_t frequency_hz)
*/
cy_rslt_t cyhal_system_clock_set_divider(cyhal_system_clock_t clock, cyhal_system_divider_t divider);
/** \} group_hal_system_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -23,16 +23,10 @@
*******************************************************************************/
/**
* \addtogroup group_hal_tcpwm_common PSoC 6 TCPWM Common Functionality
* \addtogroup group_hal_psoc6_tcpwm_common TCPWM Common Functionality
* \ingroup group_hal_psoc6
* \{
* Code shared between the Cypress Timer / Counter and PWM.
*
* \defgroup group_hal_tcpwm_common_macros Macros
* \defgroup group_hal_tcpwm_common_constants Constants
* \defgroup group_hal_tcpwm_common_functions Functions
* \defgroup group_hal_tcpwm_common_data_structures Data Structures
* \defgroup group_hal_tcpwm_common_enums Enumerated Types
*/
#pragma once
@ -41,11 +35,6 @@
#include <stdbool.h>
#include "cyhal_hw_types.h"
/**
* \addtogroup group_hal_tcpwm_common_data_structures
* \{
*/
/** Handler for TCPWM interrupts */
typedef void(*cyhal_tcpwm_event_callback_t)(void *callback_arg, int event);
@ -59,25 +48,9 @@ typedef struct {
uint8_t isr_offset; //!< TCPWM base IRQn (channel 0 IRQn)
} cyhal_tcpwm_data_t;
/** \} group_hal_tcpwm_common_data_structures */
/**
* \addtogroup group_hal_tcpwm_common_constants
* \{
*/
/** Contains data about all of the TCPWMs */
extern const cyhal_tcpwm_data_t CYHAL_TCPWM_DATA[CY_IP_MXTCPWM_INSTANCES];
/** \} group_hal_tcpwm_common_constants */
/**
* \addtogroup group_hal_tcpwm_common_functions
* \{
*/
/** Initialize a timer/counter or PWM object's callback data.
*
* @param[in] resource The timer/counter or PWM resource
@ -103,6 +76,4 @@ void cyhal_tcpwm_register_callback(cyhal_resource_inst_t *resource, cy_israddres
*/
void cyhal_tcpwm_enable_event(TCPWM_Type *type, cyhal_resource_inst_t *resource, uint32_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_tcpwm_common_functions */
/** \} group_hal_tcpwm_common */
/** \} group_hal_psoc6_tcpwm_common */

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress Timer.
*
* \defgroup group_hal_timer_macros Macros
* \defgroup group_hal_timer_functions Functions
* \defgroup group_hal_timer_data_structures Data Structures
* \defgroup group_hal_timer_enums Enumerated Types
*/
#pragma once
@ -49,11 +44,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_timer_enums
* \{
*/
/** Timer directions */
typedef enum
{
@ -70,15 +60,7 @@ typedef enum {
CYHAL_TIMER_IRQ_ALL = (1 << 2) - 1,
} cyhal_timer_event_t;
/** \} group_hal_timer_enums */
/**
* \addtogroup group_hal_timer_data_structures
* \{
*/
/** Describes the current configuration of a timer/counter */
/** @brief Describes the current configuration of a timer/counter */
typedef struct
{
/**
@ -97,14 +79,6 @@ typedef struct
/** Handler for timer events */
typedef void(*cyhal_timer_event_callback_t)(void *callback_arg, cyhal_timer_event_t event);
/** \} group_hal_timer_data_structures */
/**
* \addtogroup group_hal_timer_macros
* \{
*/
/** Bad argument. eg: null pointer */
#define CYHAL_TIMER_RSLT_ERR_BAD_ARGUMENT (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_TIMER, 0))
/** Failed to initialize Timer clock */
@ -117,14 +91,6 @@ typedef void(*cyhal_timer_event_callback_t)(void *callback_arg, cyhal_timer_even
/** Default timer frequency, used when an existing clock divider is not provided to init */
#define CYHAL_TIMER_DEFAULT_FREQ (1000000u)
/** \} group_hal_timer_macros */
/**
* \addtogroup group_hal_timer_functions
* \{
*/
/** Initialize the timer/counter peripheral and configure the pin.
*
* @param[out] obj The timer/counter object to initialize
@ -189,8 +155,6 @@ void cyhal_timer_register_callback(cyhal_timer_t *obj, cyhal_timer_event_callbac
*/
void cyhal_timer_enable_event(cyhal_timer_t *obj, cyhal_timer_event_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_timer_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress TRNG.
*
* \defgroup group_hal_trng_macros Macros
* \defgroup group_hal_trng_functions Functions
* \defgroup group_hal_trng_data_structures Data Structures
* \defgroup group_hal_trng_enums Enumerated Types
*/
#pragma once
@ -56,11 +51,6 @@ extern "C" {
*/
#define CYHAL_TRNG_RSLT_ERR_HW (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_TRNG, 1))
/**
* \addtogroup group_hal_trng_functions
* \{
*/
/** Initialize the random number generator.
*
* @param[out] obj The random number generator object
@ -81,8 +71,6 @@ void cyhal_trng_free(cyhal_trng_t *obj);
*/
uint32_t cyhal_trng_generate(const cyhal_trng_t *obj);
/** \} group_hal_trng_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress UART.
*
* \defgroup group_hal_uart_macros Macros
* \defgroup group_hal_uart_functions Functions
* \defgroup group_hal_uart_data_structures Data Structures
* \defgroup group_hal_uart_enums Enumerated Types
*/
#pragma once
@ -49,11 +44,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_uart_macros
* \{
*/
/** The requested resource type is invalid */
#define CYHAL_UART_RSLT_ERR_INVALID_PIN (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_UART, 0))
/** Failed to configure power management callback */
@ -66,13 +56,6 @@ extern "C" {
#define CYHAL_UART_DEFAULT_BAUD 115200
/** The maximum allowable difference between baud requested and actual baud **/
#define CYHAL_UART_MAX_BAUD_PERCENT_DIFFERENCE 10
/** \} group_hal_uart_macros */
/**
* \addtogroup group_hal_uart_enums
* \{
*/
/** UART Parity */
typedef enum
@ -96,15 +79,7 @@ typedef enum
CYHAL_UART_IRQ_TX_EMPTY = 1 << 8, //!< The tx hardware buffer is empty
} cyhal_uart_event_t;
/** \} group_hal_uart_enums */
/**
* \addtogroup group_hal_uart_data_structures
* \{
*/
/** Initial UART configuration */
/** @brief Initial UART configuration */
typedef struct
{
uint32_t data_bits; //!< The number of start bits
@ -117,14 +92,6 @@ typedef struct
/** UART callback function type */
typedef void (*cyhal_uart_event_callback_t)(void *callback_arg, cyhal_uart_event_t event);
/** \} group_hal_uart_data_structures */
/**
* \addtogroup group_hal_uart_functions
* \{
*/
/** Initialize the uart peripheral. It sets the default parameters for uart
* peripheral, and configures its specifieds pins.
*
@ -305,9 +272,6 @@ void cyhal_uart_register_callback(cyhal_uart_t *obj, cyhal_uart_event_callback_t
*/
void cyhal_uart_enable_event(cyhal_uart_t *obj, cyhal_uart_event_t event, uint8_t intrPriority, bool enable);
/** \} group_hal_uart_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -30,11 +30,7 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress USB Device.
*
* \defgroup group_hal_usb_dev_macros Macros
* \defgroup group_hal_usb_dev_functions Functions
* \defgroup group_hal_usb_dev_data_structures Data Structures
* \defgroup group_hal_usb_dev_enums Enumerated Types
*
*/
#pragma once
@ -49,11 +45,6 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_usb_dev_macros
* \{
*/
/** The usb error */
#define CYHAL_USB_DEV_RSLT_ERR (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_USB, 0))
@ -63,6 +54,11 @@ extern "C" {
/** The configuration of USB clock failed */
#define CYHAL_USB_DEV_RSLT_ERR_CLK_CFG (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_USB, 2))
/**
* \addtogroup group_hal_usb_dev_endpoint Endpoint
* \{
* APIs relating to endpoint management
*/
/** Returns true if endpoint direction is IN */
#define CYHAL_USB_DEV_IS_IN_EP(endpoint) (0U != (0x80U & (uint32_t) (endpoint)))
@ -72,14 +68,6 @@ extern "C" {
/** Returns endpoint index (type uint32_t) */
#define CYHAL_USB_DEV_GET_EP_IDX(endpoint) (CYHAL_USB_DEV_GET_EP_NUM(endpoint) - 1U)
/** \} group_hal_usb_dev_macros */
/**
* \addtogroup group_hal_usb_dev_enums
* \{
*/
/** USB Device Endpoints types */
typedef enum
{
@ -89,6 +77,8 @@ typedef enum
CYHAL_USB_DEV_EP_TYPE_INT = 3
} cyhal_usb_dev_ep_type_t;
/** \} group_hal_usb_dev_endpoint */
/** Service Callback Events */
typedef enum
{
@ -98,21 +88,21 @@ typedef enum
CYHAL_USB_DEV_EVENT_EP0_OUT, /**< Callback hooked to endpoint 0 OUT packet interrupt */
} cyhal_usb_dev_event_t;
/** \} group_hal_usb_dev_enums */
/**
* \addtogroup group_hal_usb_dev_data_structures
* \{
*/
/** USB endpoint address (it consists from endpoint number and direction) */
/**
* USB endpoint address (consists from endpoint number and direction)
*
* \ingroup group_hal_usb_dev_endpoint
*/
typedef uint8_t cyhal_usb_dev_ep_t;
/** Callback handler for USB Device interrupt */
typedef void (*cyhal_usb_dev_irq_callback_t)(void);
/** Callback handler for the transfer completion event for data endpoints (not applicable for endpoint 0)*/
/**
* Callback handler for the transfer completion event for data endpoints (not applicable for endpoint 0)
*
* \ingroup group_hal_usb_dev_endpoint
*/
typedef void (* cyhal_usb_dev_endpoint_callback_t)(cyhal_usb_dev_ep_t endpoint);
/** Callback handler for the events for USB Device */
@ -121,14 +111,6 @@ typedef void (*cyhal_usb_dev_event_callback_t)(void);
/** Callback handler for the events for USB Device */
typedef void (*cyhal_usb_dev_sof_callback_t)(uint32_t frame_number);
/** \} group_hal_usb_dev_data_structures */
/**
* \addtogroup group_hal_usb_dev_functions
* \{
*/
/**
* Initialize this USBPhy instance.
*
@ -208,6 +190,12 @@ typedef void (*cyhal_usb_dev_sof_callback_t)(uint32_t frame_number);
*/
void cyhal_usb_dev_set_address(cyhal_usb_dev_t *obj, uint8_t address);
/**
* \addtogroup group_hal_usb_dev_ep0 EP0
* \{
* APIs relating specifically to management of endpoint zero
*/
/**
* Get wMaxPacketSize of endpoint 0.
* The endpoint 0 has dedicated buffer.
@ -266,6 +254,13 @@ uint32_t cyhal_usb_dev_ep0_get_max_packet(cyhal_usb_dev_t *obj);
*/
void cyhal_usb_dev_ep0_stall(cyhal_usb_dev_t *obj);
/** \} group_hal_usb_dev_ep0 */
/**
* \addtogroup group_hal_usb_dev_endpoint
* \{
*/
/**
* Configure an endpoint.
*
@ -385,6 +380,8 @@ cy_rslt_t cyhal_usb_dev_endpoint_add(cyhal_usb_dev_t *obj, bool alloc, bool enab
*/
cy_rslt_t cyhal_usb_dev_endpoint_abort(cyhal_usb_dev_t *obj, cyhal_usb_dev_ep_t endpoint);
/** \} group_hal_usb_dev_endpoint */
/** The USB Device callback handler registration
*
* @param[in,out] obj The usb device object
@ -415,6 +412,8 @@ void cyhal_usb_dev_process_irq(cyhal_usb_dev_t *obj);
* @param[in,out] obj The usb device object
* @param[in] endpoint Endpoint to registers handler
* @param[in] callback The callback handler which will be invoked when the endpoint comp
*
* \ingroup group_hal_usb_dev_endpoint
*/
void cyhal_usb_dev_register_endpoint_callback(cyhal_usb_dev_t *obj, cyhal_usb_dev_ep_t endpoint, cyhal_usb_dev_endpoint_callback_t callback);
@ -435,8 +434,6 @@ void cyhal_usb_dev_register_event_callback(cyhal_usb_dev_t *obj, cyhal_usb_dev_e
*/
void cyhal_usb_dev_register_sof_callback( cyhal_usb_dev_t *obj, cyhal_usb_dev_sof_callback_t callback);
/** \} group_hal_usb_dev_functions */
#if defined(__cplusplus)
}
#endif

View File

@ -23,15 +23,8 @@
*******************************************************************************/
/**
* \addtogroup group_hal_utils PSoC 6 Utility Functions
* \ingroup group_hal_psoc6
* \addtogroup group_hal_psoc6 PSoC 6 Implementation
* \{
* Utility functions for working with the PSoC 6 HAL implementation.
*
* \defgroup group_hal_utils_macros Macros
* \defgroup group_hal_utils_functions Functions
* \defgroup group_hal_utils_data_structures Data Structures
* \defgroup group_hal_utils_enums Enumerated Types
*/
#pragma once
@ -43,17 +36,25 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_psoc6_interrupts Interrupts
* \{
*/
#define CYHAL_IRQN_OFFSET 16 /**< Offset for implementation-defined ISR type numbers (IRQ0 = 16) */
#define CYHAL_GET_CURRENT_IRQN() ((IRQn_Type) (__get_IPSR() - CYHAL_IRQN_OFFSET)) /**< Macro to get the IRQn of the current ISR */
/** \} group_hal_psoc6_interrupts */
/**
* \addtogroup group_hal_utils_macros
* \addtogroup group_hal_psoc6_pin_package
* \{
*/
#define CYHAL_GET_PIN(pin) ((uint8_t)(pin & 0xFFFFUL)) /**< Macro to extract the pin number */
#define CYHAL_GET_PORT(pin) ((uint8_t)((uint32_t)(pin >> 16) & 0xFFUL)) /**< Macro to extract the port number */
#define CYHAL_IRQN_OFFSET 16 /**< Offset for implementation-defined ISR type numbers (IRQ0 = 16) */
#define CYHAL_GET_CURRENT_IRQN() ((IRQn_Type) (__get_IPSR() - CYHAL_IRQN_OFFSET)) /**< Macro to get the IRQn of the current ISR */
/** Looks up the resource block that connects to the specified pins from the provided resource pin mapping table.
* This is a convinience utility for cyhal_utils_get_resource() if the mappings is an array of known size.
*
@ -63,25 +64,6 @@ extern "C" {
*/
#define CY_UTILS_GET_RESOURCE(pin, mappings) cyhal_utils_get_resource(pin, mappings, sizeof(mappings)/sizeof(cyhal_resource_pin_mapping_t))
/** \} group_hal_utils_macros */
/**
* \addtogroup group_hal_utils_functions
* \{
*/
/** Calculate the peri clock divider value that need to be set to reach frequency closest to the input frequency
*
* @param[in] frequency The desired frequency
* @param[in] frac_bits The number of fractional bits that the divider has
* @return The calculate divider value to set, NOTE a divider value of x divide the frequency by (x+1)
*/
static inline uint32_t cyhal_divider_value(uint32_t frequency, uint32_t frac_bits)
{
return ((Cy_SysClk_ClkPeriGetFrequency() * (1 << frac_bits)) + (frequency / 2)) / frequency - 1;
}
/** Converts the provided gpio pin to a resource instance object
*
* @param[in] pin The pin to get a resource object for
@ -108,10 +90,29 @@ const cyhal_resource_pin_mapping_t *cyhal_utils_get_resource(cyhal_gpio_t pin, c
*/
void cyhal_utils_disconnect_and_free(cyhal_gpio_t pin);
/** \} group_hal_utils_functions */
/** \} group_hal_psoc6_pin_package */
/**
* \addtogroup group_hal_psoc6_clocks Clocks
* \{
*/
/** Calculate the peri clock divider value that need to be set to reach frequency closest to the input frequency
*
* @param[in] frequency The desired frequency
* @param[in] frac_bits The number of fractional bits that the divider has
* @return The calculate divider value to set, NOTE a divider value of x divide the frequency by (x+1)
*/
static inline uint32_t cyhal_divider_value(uint32_t frequency, uint32_t frac_bits)
{
return ((Cy_SysClk_ClkPeriGetFrequency() * (1 << frac_bits)) + (frequency / 2)) / frequency - 1;
}
/** \} group_hal_psoc6_clocks */
#if defined(__cplusplus)
}
#endif
/** \} group_hal_utils */
/** \} group_hal_psoc6_utils */
/** \} group_hal_psoc6 */

View File

@ -30,11 +30,6 @@
* \ingroup group_hal
* \{
* High level interface for interacting with the Cypress WDT.
*
* \defgroup group_hal_wdt_macros Macros
* \defgroup group_hal_wdt_functions Functions
* \defgroup group_hal_wdt_data_structures Data Structures
* \defgroup group_hal_wdt_enums Enumerated Types
*/
#pragma once
@ -46,24 +41,11 @@
extern "C" {
#endif
/**
* \addtogroup group_hal_wdt_macros
* \{
*/
/** WDT timeout out of range */
#define CY_RSLT_WDT_INVALID_TIMEOUT (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_WDT, 0))
/** WDT already initialized */
#define CY_RSLT_WDT_ALREADY_INITIALIZED (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_WDT, 1))
/** \} group_hal_wdt_macros */
/**
* \addtogroup group_hal_wdt_functions
* \{
*/
/** Initialize and start the WDT
*
* Initialize or re-initialize the WDT.
@ -130,8 +112,6 @@ uint32_t cyhal_wdt_get_timeout_ms(cyhal_wdt_t *obj);
*/
uint32_t cyhal_wdt_get_max_timeout_ms(void);
/** \} group_hal_wdt_functions */
#if defined(__cplusplus)
}
#endif
@ -140,4 +120,4 @@ uint32_t cyhal_wdt_get_max_timeout_ms(void);
#include CYHAL_WDT_IMPL_HEADER
#endif /* CYHAL_WDT_IMPL_HEADER */
/** \} group_hal_wdt */
/** \} group_hal_wdt */

View File

@ -27,8 +27,8 @@
*******************************************************************************/
/**
* \addtogroup group_hal_psoc6_wdt PSoC 6 WDT (Watchdog Timer)
* \ingroup group_hal_psoc6
* \addtogroup group_hal_psoc6_wdt (WDT) Watchdog Timer
* \ingroup group_hal_psoc6
* \{
* The PSoC 6 WDT is only capable of supporting certain timeout ranges below its maximum timeout of 6000ms.
* As a result, any unsupported timeouts given to the HAL WDT are rounded up to the nearest supported value.
@ -80,7 +80,7 @@
* <td>4</td>
* </tr>
* </table>
* \} group_hal_psoc6
* \} group_hal_psoc6_wdt
*/
#include <stdbool.h>