![]() |
Synergy Software Package User's Manual
|
Driver for the Data Operation Circuit (DOC). More...
Data Structures | |
| struct | doc_instance_ctrl_t |
Functions | |
| ssp_err_t | R_DOC_Open (doc_ctrl_t *const p_api_ctrl, doc_cfg_t const *const p_cfg) |
| Configure the Data Operation Circuit (DOC) in comparison, addition or subtraction mode. Implements doc_api_t::open. More... | |
| ssp_err_t | R_DOC_Close (doc_ctrl_t *const p_api_ctrl) |
| Close the module driver. Enable module stop mode. Implements doc_api_t::close. More... | |
| ssp_err_t | R_DOC_StatusGet (doc_ctrl_t *const p_api_ctrl, doc_status_t *p_status) |
| Return the comparison/addition/subtraction status. Implements doc_api_t::statusGet. More... | |
| ssp_err_t | R_DOC_StatusClear (doc_ctrl_t *const p_api_ctrl) |
| Clear the DOPCF status flag at the hardware layer. This flag indicates the result of a DOC operation. Implements doc_api_t::statusClear. More... | |
| ssp_err_t | R_DOC_Write (doc_ctrl_t *const p_api_ctrl, doc_data_t *const p_data) |
| Write to the DODIR and DODSR registers. Implements doc_api_t::write,. More... | |
| ssp_err_t | R_DOC_InputRegisterWrite (doc_ctrl_t *const p_api_ctrl, doc_size_t data) |
| Write to the DODIR register. Implements doc_api_t::inputRegisterWrite,. More... | |
| ssp_err_t | R_DOC_VersionGet (ssp_version_t *const p_version) |
| Return DOC HAL driver version. Implements doc_api_t::versionGet. More... | |
Driver for the Data Operation Circuit (DOC).
This module implements the DOC Interface using the Data Operation Circuit (DOC).
| ssp_err_t R_DOC_Close | ( | doc_ctrl_t *const | p_api_ctrl | ) |
Close the module driver. Enable module stop mode. Implements doc_api_t::close.
To close the DOC it must have been opened via the open API. When opened a control structure of type doc_ctrl_t is passed to the open API. The same control structure must be passed to the close API.
| SSP_SUCCESS | Module successfully closed. |
| SSP_ERR_NOT_OPEN | Driver not open. |
| SSP_ERR_ASSERTION | Pointer pointing to NULL. |
Validate the parameter and check if the module is initialized
Disable the IRQ in the NVIC in case it has been left enabled.
Clear DOPCF in DOCR
Mark driver as closed.
Unlock the DOC Hardware Resource
| ssp_err_t R_DOC_InputRegisterWrite | ( | doc_ctrl_t *const | p_api_ctrl, |
| doc_size_t | data | ||
| ) |
Write to the DODIR register. Implements doc_api_t::inputRegisterWrite,.
Writes to the DODIR register only.
| SSP_SUCCESS | Value successfully written to the DODIR register. |
| SSP_ERR_NOT_OPEN | Driver not open. |
| SSP_ERR_ASSERTION | One or more pointers point to NULL. |
Validate the parameter and check if the module is intialized
Writes the user supplied data to the DODIR register for data operation in Comparison, Addition and subtraction modes
| ssp_err_t R_DOC_Open | ( | doc_ctrl_t *const | p_api_ctrl, |
| doc_cfg_t const *const | p_cfg | ||
| ) |
Configure the Data Operation Circuit (DOC) in comparison, addition or subtraction mode. Implements doc_api_t::open.
If callback is not NULL in the configuration structure the DOC IRQ will be enabled.
| SSP_SUCCESS | DOC successfully configured. |
| SSP_ERR_IN_USE | Module already open. |
| SSP_ERR_ASSERTION | One or more pointers point to NULL. |
| SSP_ERR_INVALID_ARGUMENT | ISR is not enabled. Enable the ISR in bsp_irq_cfg.h. |
| SSP_ERR_HW_LOCKED | DOC resource is locked. |
Validate the parameters and check if the module is initialized
Make sure the DOC exists on this part.
Lock the DOC Hardware Resource
Configure the DOC via DOCR register.
If callback parameter is not NULL configure the IRQ
Mark driver as open by initializing it to "DOCO" in its ASCII equivalent.
| ssp_err_t R_DOC_StatusClear | ( | doc_ctrl_t *const | p_api_ctrl | ) |
Clear the DOPCF status flag at the hardware layer. This flag indicates the result of a DOC operation. Implements doc_api_t::statusClear.
| SSP_SUCCESS | Interrupt successfully cleared. |
| SSP_ERR_NOT_OPEN | Driver not open. |
| SSP_ERR_ASSERTION | Pointer pointing to NULL. |
Validate the parameter and check if the module is initialized
Clear the hardware status flag
| ssp_err_t R_DOC_StatusGet | ( | doc_ctrl_t *const | p_api_ctrl, |
| doc_status_t * | p_status | ||
| ) |
Return the comparison/addition/subtraction status. Implements doc_api_t::statusGet.
The status is read from the Data Operation Circuit Flag (DOPCF).
| SSP_SUCCESS | Status successfully read. |
| SSP_ERR_NOT_OPEN | Driver not open. |
| SSP_ERR_ASSERTION | One or more pointers point to NULL. |
Validate the parameters and check if the module is intialized
Read the comparison or addition or subtraction status from the register and store in the user supplied location
| ssp_err_t R_DOC_VersionGet | ( | ssp_version_t *const | p_version | ) |
Return DOC HAL driver version. Implements doc_api_t::versionGet.
| SSP_SUCCESS | Version information successfully read. |
| SSP_ERR_ASSERTION | Pointer pointing to NULL. |
Validate the parameter
Store the version id from version data structure to the user supplied location
| ssp_err_t R_DOC_Write | ( | doc_ctrl_t *const | p_api_ctrl, |
| doc_data_t *const | p_data | ||
| ) |
Write to the DODIR and DODSR registers. Implements doc_api_t::write,.
In comparison mode the 16-bit reference data is written to the DODSR register and the data for the comparison written to the DODIR. In addition mode the initial data is written to the DODSR and the data to be added to the DODIR. In subtraction mode the initial data is written to the DODSR and the data to be subtracted to the DODIR.
When changing both the DODSR and DODIR the DODSR should be updated first.
| SSP_SUCCESS | Values successfully written to the registers. |
| SSP_ERR_NOT_OPEN | Driver not open. |
| SSP_ERR_ASSERTION | One or more pointers point to NULL. |
Validate the parameters and check if the module is initialized
Writes the user supplied data to the DODIR(DOC Data Input Register) and DODSR(DOC Data Setting Register) registers