Data Structures | |
struct | count_notify |
struct | Count_Struct |
Defines | |
#define | NOE 0 |
#define | RISEE 1 |
#define | FALLE 2 |
#define | ANYE 3 |
#define | ARELOAD 2 |
#define | ASTOP 4 |
Typedefs | |
typedef void(* | count_callback )(int counter, void *privatedata) |
Functions | |
int | IOCPWMem (int Duty, int ioc, unsigned long frequency) |
void | IOCstart (taskdata ioc) |
void | IOCstop (taskdata ioc) |
int | IOC_IC (int ict, u8 trigger, u16 reload, u8 flags) |
int | IC_CallbackZ (int ic, count_callback callback, void *privatedata) |
int | IC_Callback_off (int ic) |
u16 | CountStart (int counter) |
u16 | ReadCounter (int counter) |
int | startcounter (int ic) |
int | stopcounter (int ic) |
|
automatic reload of threshold value |
|
automatic stop when counter hits zero |
|
IC edges |
|
callback type for the counter callback These counter callbacks can be registered to happen when a counter hits zero.
|
|
Return the value last loaded into a counter This is either the starting value or the value reloaded after a zero crossing(which could be 0xffff or the reload value depending on the flags) This can be useful for computing how many counts have elapsed in situations where the reload value may vary.
|
|
Remove an IC callback
|
|
Install a zero cross callback on an IC(ICT configured as a counter)
|
|
turn an ICT into a counter This function is technically misnamed, ICT_IC would make more sense. IOC_IC configures an ICT as a 16 bit down counter with several different options This function has a higher level, the init modules function, Counter_Ipac, which stores all the configuration data sent to it in global variables. This function only configures a counter it does not turn it on, for that use startcounter
|
|
PWM emulation This function turns the specified ICT into a PWM Typically it is used to emulate PWMs between 1 and 10KHz at varying duty cycles. This is a software PWM so maximum frequencies and duty cycles vary with system load, however low KHz frequencies should support all duty cycles in almost any system load This function does not start the ICT, just configures it. IOCstart must be used for that.
|
|
starts the IOC (PWM'd ICT) that has been pre-configured by IOCPWMem
|
|
stops an IOC thats currently running
|
|
Read the current value of a counter This reads the current value of the counter
|
|
Turn on an IC
|
|
Turn off an IC Counters that are turned off will not lose their configuration and can be turned back on at any time with startcounter
|