Data Structures | |
| union | enc_state_t |
Functions | |
| s32 | MIOS32_ENC_Init (u32 mode) |
| s32 | MIOS32_ENC_ConfigSet (u32 encoder, mios32_enc_config_t config) |
| mios32_enc_config_t | MIOS32_ENC_ConfigGet (u32 encoder) |
| s32 | MIOS32_ENC_StateSet (u32 encoder, u8 new_state) |
| s32 | MIOS32_ENC_StateGet (u32 encoder) |
| s32 | MIOS32_ENC_UpdateStates (void) |
| s32 | MIOS32_ENC_Handler (void *_callback) |
Variables | |
| mios32_enc_config_t | enc_config [MIOS32_ENC_NUM_MAX] |
| enc_state_t | enc_state [MIOS32_ENC_NUM_MAX] |
| mios32_enc_config_t MIOS32_ENC_ConfigGet | ( | u32 | encoder | ) |
Returns encoder configuration
| [in] | encoder | encoder number (0..MIOS32_ENC_NUM_MAX-1) |
enc_config.cfg.speed encoder speed mode (NORMAL/FAST/SLOW)
enc_config.cfg.speed_par speed parameter (0-7)
enc_config.cfg.sr shift register (1-16) or application control (0) for the case that encoders are directly connected to GPIO pins
enc_config.cfg.pos pin position of first pin (0, 2, 4 or 6)
| s32 MIOS32_ENC_ConfigSet | ( | u32 | encoder, | |
| mios32_enc_config_t | config | |||
| ) |
Configures Encoder
| [in] | encoder | encoder number (0..MIOS32_ENC_NUM_MAX-1) |
| [in] | config | a structure with following members:
|
| s32 MIOS32_ENC_Handler | ( | void * | _callback | ) |
Initializes encoder driver
| [in] | mode | currently only mode 0 supported |
This function is only intented for debugging purposes - it returns the current state of the given encoder.
| [in] | encoder | encoder number (0..MIOS32_ENC_NUM_MAX-1) |
This function can be called from an application to update the state of an encoder that isn't connected to the SRIO chain (in this case, the appr. enc_config.cfg.sr field has to be set to 0!)
Usage examples can be found in following tutorials: 014b_enc_j5_relative and 015b_enc_j5_absolute
| [in] | encoder | encoder number (0..MIOS32_ENC_NUM_MAX-1) |
| [in] | new_state | two bits with the new encoder pin values |
| s32 MIOS32_ENC_UpdateStates | ( | void | ) |
This function has to be called after a SRIO scan to update encoder states
| mios32_enc_config_t enc_config[MIOS32_ENC_NUM_MAX] |
| enc_state_t enc_state[MIOS32_ENC_NUM_MAX] |
1.4.7