⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_pwm.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
📖 第 1 页 / 共 3 页
字号:
 * Both @a CSL_pwmInit() and @a CSL_pwmOpen() must be called successfully
 * in that order before @a CSL_pwmClose() can be called.
 *
 * @b Example:
 * @verbatim


   CSL_PwmHandle hPwm;
   ...
   CSL_pwmClose(hPwm);
   @endverbatim
 *
 * @return returns the status of the operation (see @a CSL_Status)
 * ============================================================================
 */
CSL_Status  CSL_pwmClose (
    CSL_PwmHandle         hPwm
);


/** ============================================================================
 *   @n@b   CSL_pwmHwSetup
 *
 *   @b Description
 *   @n This function initializes the device registers with the appropriate values
 *  provided through the HwSetup Data structure. This function needs to be
 *  called only if the HwSetup Structure was not previously passed through the
 *  Open call. After the Setup is completed, the serial device is ready for
 *  data transfer. For information passed through the HwSetup Data structure
 *  refer @a CSL_PwmHwSetup.
 *
 *   @b Arguments
 *
 *   @verbatim
            hPwm           Handle to the PWMS instance

            setup           Pointer to hardware setup structure
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Hardware setup successful
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVPARAMS  - Hardware structure is not
 *                                                properly initialized
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The specified instance will be setup according to value passed
 *
 *   @b Modifies
 *   @n Hardware registers for the specified instance
 *
 *  <b> Usage Constraints:
 *  Both @a CSL_emifInit() and @a CSL_emifOpen() must be called
 *  successfully in that order before this function can be called. The user
 *  has to allocate space for & fill in the main setup structure appropriately
 *  before calling this function
 *
 * @b Example:
 * @verbatim
     CSL_PwmHandle hPwm;
     CSL_PwmHwSetup hwSetup = CSL_PWM_HWSETUP_DEFAULTS;
     CSL_emifHwSetup(hPwm, &hwSetup);
  @endverbatim
 *
 * @return Returns the status of the setup operation
 * ============================================================================
 */
CSL_Status CSL_pwmHwSetup (
    CSL_PwmHandle         hPwm,
    CSL_PwmHwSetup        *setup
);


/** ============================================================================
 *   @n@b   CSL_pwmGetHwSetup
 *
 *   @b Description
 *   @n This function gets the current setup of the PWM. The status is
 *  returned through @a CSL_PwmHwSetup. The obtaining of status
 *  is the reverse operation of @a CSL_pwmHwSetup() function.
 *
 *
 *  @b Arguments
 *
 *   @verbatim
            hPwm           Handle to the PWMS instance

            setup           Pointer to hardware setup structure
     @endverbatim
 *
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Hardware setup successful
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The hardware set up structure will be populated with values from
 *       the registers
 *
 *   @b Modifies
 *   @n None
 *
 *  <b> Usage Constraints:
 *  Both @a CSL_pwmInit() and @a CSL_pwmOpen() must be called successfully
 *  in that order before @a CSL_pwmGetHwSetup() can be called.
 *
 * @b Example:
 * @verbatim
      CSL_PwmHandle hPwm;
      CSL_Status status;
      CSL_PwmHwSetup *mysetup;
       ...
      status = CSL_pwmGetHwSetup(hPwm, &mysetup);
   @endverbatim
 *
 * @return returns the status of the operation (see @a CSL_Status)
 * ============================================================================
 */
CSL_Status CSL_pwmGetHwSetup (
    CSL_PwmHandle         hPwm,
    CSL_PwmHwSetup        *setup
);


/** ============================================================================
 *   @n@b   CSL_pwmHwControl
 *
 *   @b Description
 *   @n Control operations for the PWM.  For a particular control operation, the
 *  pointer to the corresponding data type needs to be passed as argument
 *  HwControl function Call. All the arguments (Structure elements included)
 *  passed to  the HwControl function are inputs. For the list of commands
 *  supported and argument type that can be @a void* casted & passed with a
 *  particular command refer to @a CSL_PwmHwControlCmd.
 *
 *   @b Arguments
 *   @verbatim
            hPwm         Handle to the PWM instance

            cmd          Operation to be performed on the PWM

            arg          Argument specific to the command

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK            - Command execution successful.
 *   @li                    CSL_ESYS_BADHANDLE - Invalid handle
 *   @li                    CSL_ESYS_INVCMD    - Invalid command
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Registers of the PWM instance are configured according to the command
 *       and the command arguments. The command determines which registers are
 *       modified.
 *
 *   @b Modifies
 *   @n Registers determined by the command
 *
 *  <b> Usage Constraints:
 *  Both @a CSL_pwmInit() and @a CSL_pwmOpen() must be called successfully
 *  in that order before @a CSL_pwmHwControl() can be called. For the
 *  argument type that can be @a void* casted & passed with a particular command
 *  refer to @a CSL_PwmHwControlCmd
 *
 * @b Example:
 * @verbatim
       CSL_PwmHandle hPwm;
       CSL_Status status;
       ...
       status = CSL_pwmHwControl(hPwm,
                                  CSL_PWM_CMD_START,
                                  &command);
   @endverbatim
 *
 *  @return returns the status of the operation (see @a CSL_Status)
 * ============================================================================
 */
CSL_Status CSL_pwmHwControl (
    CSL_PwmHandle         hPwm,
    CSL_PwmHwControlCmd   cmd,
    void                  *arg
);

/** ============================================================================
 *   @n@b   CSL_pwmGetHwStatus
 *
 *   @b Description
 *   @n This function is used to read the current device configuration, status flags
 *  and the value present associated registers. Following table details the
 *  various status queries supported and the associated data structure to record
 *  the response. User should allocate memory for the said data type and pass
 *  its pointer as an unadorned void* argument to the status query call. For
 *  details about the various status queries supported and the associated data
 *  structure to record the response, refer to @a CSL_PwmHwStatusQuery
 *
 *   @b Arguments
 *   @verbatim
            hPwm           Handle to the PWM instance

            query           Query to be performed

            response        Pointer to buffer to return the data requested by
                            the query passed
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK            - Successful completion of the
 *                                               query
 *
 *   @li                    CSL_ESYS_BADHANDLE - Invalid handle
 *
 *   @li                    CSL_ESYS_INVQUERY  - Query command not supported
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *       Data requested by the query is returned through the variable "response"
 *
 *   @b Modifies
 *   @n  The input arguement "response" is modified
 *
 *  <b> Usage Constraints:
 *  Both @a CSL_pwmInit() and @a CSL_pwmOpen() must be called successfully
 *  in that order before @a CSL_pwmGetHwStatus() can be called. For the
 *  argument type that can be @a void* casted & passed with a particular command
 *  refer to @a CSL_PwmHwStatusQuery
 *
 *  @b Example:
 *  @verbatim
       CSL_PwmHandle hPwm;
       CSL_Status    status;
       Uint32        *response;
        ...
       status = CSL_pwmGetHwStatus(hPwm,
                            CSL_PWM_QUERY_OUTPUT_STATUS,
                                   &response);
    @endverbatim
 *
 * ============================================================================
 */
CSL_Status CSL_pwmGetHwStatus (
    CSL_PwmHandle         hPwm,
    CSL_PwmHwStatusQuery  query,
    void                   *response
);


/** ============================================================================
 *   @n@b   CSL_pwmGetBaseAddress
 *
 *   @b Description
 *   @n The get base address call will give the PWM current
 *  current instance base address
 *
 *   @n@b CSL_pwmGetBaseAddress
 *
 *
 *   @b Arguments
 *   @verbatim
            hPwm           Pointer to the peripheral data object of the
                            PWM instance

            pwmNum         Specifies the instance of the external memory
                            interface for which the base address is requested

            pPwmParam      Module specific parameters.

            pBaseAddress    Pointer to the base address structure to return the
                            base address details.
     @endverbatim
 *
 *   <b> Return Value   CSL_Status
 *   @li                    CSL_OK            Open call is successful
 *   @li                    CSL_ESYS_FAIL     The PWM
 *                                            instance is not available.
 *
 *   <b> Pre Condition
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Base address structure is populated
 *
 *   @b Modifies
 *   @n    None
 *
 *   @b Example
 *   @verbatim
        CSL_Status          status;
        CSL_PwmBaseAddress  baseAddress;

       ...

       status = CSL_pwmGetBaseAddress(CSL_PWM, NULL, &baseAddress);

    @endverbatim
 *
 * ============================================================================
 */
CSL_Status CSL_pwmGetBaseAddress (
    CSL_InstNum            pwmNum,
    CSL_PwmParam          *pPwmParam,
    CSL_PwmBaseAddress    *pBaseAddress
);


/** ============================================================================
 *   @n@b CSL_pwmHwSetupRaw
 *
 *   @b Description
 *   @n This function initializes the device registers with the register-values
 *      provided through the config data structure.
 *
 *   @b Arguments
 *   @verbatim
            hPwm            Handle to the pulse width modulation instance

            config          Pointer to the config structure containing the
                            device register values
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Configuration successful
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVPARAMS  - Configuration structure
 *                                                pointer is not properly
 *                                                 initialized
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The registers of the specified pulse width modulation instance will be setup
 *       according to the values passed through the config structure
 *
 *   @b Modifies
 *   @n Hardware registers of the specified pulse width modulation instance
 *
 *   @b Example
 *   @verbatim
        CSL_PwmHandle           hPwm;
        CSL_PwmConfig           config = CSL_PWM_CONFIG_DEFAULTS;
        CSL_Status              status;

        ...

        status = CSL_pwmHwSetupRaw (hPwm, &config);

        ...

     @endverbatim
 * ===========================================================================
 */
CSL_Status  CSL_pwmHwSetupRaw (
    CSL_PwmHandle        hPwm,
    CSL_PwmConfig        *config
);


#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -