HPM SDK
HPMicro Software Development Kit
hpm_enc_pos_drv.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef HPM_ENC_POS_COMMON_H
9 #define HPM_ENC_POS_COMMON_H
10 
11 #include "hpm_common.h"
12 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
31 float encoder_position_to_deg(uint32_t pos);
32 
39 uint32_t encoder_deg_to_position(float deg);
40 
47 float encoder_position_to_rad(uint32_t pos);
48 
55 uint32_t encoder_rad_to_position(float rad);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
65 #endif /* HPM_ENC_POS_COMMON_H */
float encoder_position_to_rad(uint32_t pos)
caculate radian of angle from pos
Definition: hpm_enc_pos_drv.c:34
uint32_t encoder_rad_to_position(float rad)
caculate posistion from radian of angle
Definition: hpm_enc_pos_drv.c:43
float encoder_position_to_deg(uint32_t pos)
caculate degree of angle from pos
Definition: hpm_enc_pos_drv.c:11
uint32_t encoder_deg_to_position(float deg)
caculate posistion from degree of angle
Definition: hpm_enc_pos_drv.c:20