upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _cjq4435_context |
Functions | |
cjq4435_context | cjq4435_init (int pin) |
void | cjq4435_close (cjq4435_context dev) |
upm_result_t | cjq4435_set_period_us (const cjq4435_context dev, int us) |
upm_result_t | cjq4435_set_period_ms (const cjq4435_context dev, int us) |
upm_result_t | cjq4435_set_period_seconds (const cjq4435_context dev, float seconds) |
upm_result_t | cjq4435_enable (const cjq4435_context dev, bool enable) |
upm_result_t | cjq4435_set_duty_cycle (const cjq4435_context dev, float dutyCycle) |
void | cjq4435_on (const cjq4435_context dev) |
void | cjq4435_off (const cjq4435_context dev) |
Typedefs | |
typedef struct _cjq4435_context * | cjq4435_context |
cjq4435_context cjq4435_init | ( | int | pin | ) |
CJQ4435 initializer
pin | Digital pin to use; this pin must be PWM-capable |
void cjq4435_close | ( | cjq4435_context | dev | ) |
CJQ4435 destructor
dev | Device context |
upm_result_t cjq4435_set_period_us | ( | const cjq4435_context | dev, |
int | us | ||
) |
Sets a period in microseconds
dev | Device context |
us | Period in microseconds |
upm_result_t cjq4435_set_period_ms | ( | const cjq4435_context | dev, |
int | us | ||
) |
Sets a period in milliseconds
dev | Device context |
ms | Period in milliseconds |
upm_result_t cjq4435_set_period_seconds | ( | const cjq4435_context | dev, |
float | seconds | ||
) |
Sets a period in seconds
dev | Device context |
seconds | Period in seconds |
upm_result_t cjq4435_enable | ( | const cjq4435_context | dev, |
bool | enable | ||
) |
Enables output
dev | Device context |
enable | Enables PWM output if true, disables otherwise |
upm_result_t cjq4435_set_duty_cycle | ( | const cjq4435_context | dev, |
float | dutyCycle | ||
) |
Sets a duty cycle. Duty cycle is a floating-point number between 0.0 (always off) and 1.0 (always on). It represents a proportion of time, per period, during which the output is driven high.
dev | Device context |
dutyCycle | Duty cycle to use |
void cjq4435_on | ( | const cjq4435_context | dev | ) |
Shortcut to turn the output to continuous on (high)
dev | Device context |
void cjq4435_off | ( | const cjq4435_context | dev | ) |
Shortcut to turn the output to continuous off (low)
dev | Device context |
typedef struct _cjq4435_context * cjq4435_context |
Device context