device/class/bitbang.h header reference
[Devices support library module]

The source code of this header can be browsed online.

Description  

Purpose  

This class allows generation and sampling of a digital signal on an IO line. The waveform is defined by an array containing duration of high and low levels of the signal.

The hardware may support start of operation on a trigger. The input line used as a trigger may be either the signal input line or an alternate input line.

Drivers which implement this class must check for a DEV_RES_IOMUX resource named io. When the trigger feature is implemented, an other such resource named trig must be present.

Members  

Types  

Functions  

Macros  

Members detail  

#define DEV_BITBANG_CANCEL(n)  

This macro is declared in device/class/bitbang.h source file, line 200.

See also dev_bitbang_cancel_t.

#define DEV_BITBANG_REQUEST(n)  

This macro is declared in device/class/bitbang.h source file, line 194.

See also dev_bitbang_request_t.

#define DRIVER_BITBANG_METHODS(prefix)  

This macro is declared in device/class/bitbang.h source file, line 213.

See also struct driver_bitbang_s.

#define __DEVICE_BITBANG_H__  

This macro is declared in device/class/bitbang.h source file, line 48.

typedef error_t (dev_bitbang_cancel_t)(const struct device_bitbang_s *accessor, struct dev_bitbang_rq_s *rq)   

This typedef is declared in device/class/bitbang.h source file, line 204.

This declaration involves expansion of the DEV_BITBANG_CANCEL macro.

typedef void (dev_bitbang_request_t)(const struct device_bitbang_s *accessor, struct dev_bitbang_rq_s *rq)   

This typedef is declared in device/class/bitbang.h source file, line 198.

This declaration involves expansion of the DEV_BITBANG_REQUEST macro.

void dev_bitbang_rq_done(struct dev_bitbang_rq_s *rq)  

This function is declared in device/class/bitbang.h source file, line 192.

This function invokes or schedules execution of the bitbang request callback associated to the request. For use in device drivers.

struct dev_bitbang_rq_s * dev_bitbang_rq_from_kr(struct kroutine_s *kr)  

This function is declared in device/class/bitbang.h source file, line 192.

This function retrieves a pointer to the request when in the request completion callback routine.

struct dev_bitbang_rq_s * dev_bitbang_rq_head(dev_request_queue_root_t *q)  

This function is declared in device/class/bitbang.h source file, line 192.

This function returns the oldest bitbang request in the given queue. A NULL pointer is returned if the queue is empty. For use in device drivers.

void dev_bitbang_rq_init(struct dev_bitbang_rq_s *rq, kroutine_exec_t *exec)  

This function is declared in device/class/bitbang.h source file, line 192.

This function initializes the given bitbang request callback. This must be used before submitting the request to a driver.

This is available when CONFIG_MUTEK_KROUTINE_SCHED is defined.

void dev_bitbang_rq_init_immediate(struct dev_bitbang_rq_s *rq, kroutine_exec_t *exec)  

This function is declared in device/class/bitbang.h source file, line 192.

This function initializes the given bitbang request callback. This must be used before submitting the request to a driver.

void dev_bitbang_rq_init_queue(struct dev_bitbang_rq_s *rq, kroutine_exec_t *exec, struct kroutine_queue_s *queue)  

This function is declared in device/class/bitbang.h source file, line 192.

This function initializes the given bitbang request callback. This must be used before submitting the request to a driver.

This is available when CONFIG_MUTEK_KROUTINE_QUEUE is defined.

void dev_bitbang_rq_init_seq(struct dev_bitbang_rq_s *rq, kroutine_exec_t *exec, struct kroutine_sequence_s *seq)  

This function is declared in device/class/bitbang.h source file, line 192.

This function initializes the given bitbang request callback. This must be used before submitting the request to a driver.

This is available when CONFIG_MUTEK_KROUTINE_SCHED is defined.

struct dev_bitbang_rq_s * dev_bitbang_rq_pop(dev_request_queue_root_t *q)  

This function is declared in device/class/bitbang.h source file, line 192.

This function removes and return the oldest bitbang request in the queue. A NULL pointer is returned if the queue is empty. For use in device drivers.

void dev_bitbang_rq_pushback(dev_request_queue_root_t *q, struct dev_bitbang_rq_s *rq)  

This function is declared in device/class/bitbang.h source file, line 192.

This function insert a new bitbang request at the end of the given queue. For use in device drivers.

void dev_bitbang_rq_remove(dev_request_queue_root_t *q, struct dev_bitbang_rq_s *rq)  

This function is declared in device/class/bitbang.h source file, line 192.

This function removes the specified bitbang request from the queue. For use in device drivers.

enum dev_bitbang_rq_rtype_e  

This enum is declared in device/class/bitbang.h source file, line 87.

This enum specifies the various bigbang operations.

IdentifierDescription
DEV_BITBANG_WRThe bitbang pin is configured as output and a signal is generated immediately. The pin is configured back as input when finished.
DEV_BITBANG_WR_ALT_RISINGThe alternate trig pin is monitored for rising edge, then the bitbang pin is configured as output and a signal is generated. The pin is configured back as input when finished.
DEV_BITBANG_WR_ALT_FALLINGThe alternate trig pin is monitored for falling edge, then the bitbang pin is configured as output and a signal is generated. The pin is configured back as input when finished.
DEV_BITBANG_WR_ALT_ANYEDGEThe alternate trig pin is monitored for rising or falling edge, then the bitbang pin is configured as output and a signal is generated. The pin is configured back as input when finished.
DEV_BITBANG_RDA signal is acquired immediately. The waveform of the signal is stored in the array of symbols.
DEV_BITBANG_RD_RISINGA signal is acquired when a rising edge is detected on the signal pin. The waveform of the signal is stored in the array of symbols.
DEV_BITBANG_RD_FALLINGA signal is acquired when a falling edge is detected on the signal pin. The waveform of the signal is stored in the array of symbols.
DEV_BITBANG_RD_ANYEDGEA signal is acquired when a rising or falling edge is detected on the signal pin. The waveform of the signal is stored in the array of symbols.
DEV_BITBANG_RD_ALT_RISINGA signal is acquired when a rising edge is detected on the alternate trig pin. The waveform of the signal is stored in the array of symbols.
DEV_BITBANG_RD_ALT_FALLINGA signal is acquired when a falling edge is detected on the alternate trig pin. The waveform of the signal is stored in the array of symbols.
DEV_BITBANG_RD_ALT_ANYEDGEA signal is acquired when a rising or falling edge is detected on the alternate trig pin. The waveform of the signal is stored in the array of symbols.

struct dev_bitbang_rq_s  

This struct is declared in device/class/bitbang.h source file, line 149.

FieldDescription
union <anonymous> {
struct dev_request_s base;
typeof(struct dev_request_s::error) error;
typeof(struct dev_request_s::pvdata) pvdata;
};
enum dev_bitbang_rq_rtype_e type;This variable specifies the operation to perform
enum dev_bitbang_sym_width_e sym_width;This specifies the type of integer used in the symbols array.
uint16_t count;Number of symbols in the array. This must initialy be set to the size of the symbols array. When the request type is a read, this field is updated by the driver with the actual number of symbols stored.
void * symbols;Array of symbols. The waveform of the signal is defined by the content of this array.
Each value in this array specifies the duration of a level. Values at even indices in the array specifies the duration of the logic low levels of the signal whereas values at odd indices specifies the duration of the logic high levels. The value of the first entry may be 0 indicating a null duration.
uint32_t trig_timeout;A request waiting for a trigger is ended when no edge is detected for the specified duration. No timeout is used when this field is 0.
uint32_t read_timeout;A running read request is ended when no change is detected for the specified duration. No timeout is used when this field is 0.
struct dev_freq_s unit;This defines the base time unit used for symbol duration.

struct dev_request_s * dev_bitbang_rq_s_base(struct dev_bitbang_rq_s *x)  

struct dev_bitbang_rq_s * dev_bitbang_rq_s_cast(struct dev_request_s *x)  

enum dev_bitbang_sym_width_e  

This enum is declared in device/class/bitbang.h source file, line 139.

This enum specifies the integer type used to store symbols for a bitbang request.

IdentifierDescription
DEV_BITBANG_8BITSSymbols are stored as uint8_t
DEV_BITBANG_16BITSSymbols are stored as uint16_t
DEV_BITBANG_32BITSSymbols are stored as uint32_t

typedef uint16_t dev_bitbang_symbol_delay_t  

This typedef is declared in device/class/bitbang.h source file, line 63.

struct device_bitbang_s  

This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 19 in device/class/bitbang.h source file, line 211.

This struct is the device accessor object type for the bitbang device class. This accessor must be initialized by calling the device_get_accessor function.

See also DRIVER_CLASS_BITBANG, struct device_accessor_s and Device accessor.

FieldDescription
union <anonymous> {
struct device_accessor_s base;
struct <anonymous> {
struct device_s * dev;
struct driver_bitbang_s * api;
uint_fast8_t number;
};
};

struct device_accessor_s * device_bitbang_s_base(struct device_bitbang_s *x)  

This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 40 in device/class/bitbang.h source file, line 211.

This function casts a bitbang device accessor to a generic device accessor

struct device_bitbang_s * device_bitbang_s_cast(struct device_accessor_s *x)  

This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 33 in device/class/bitbang.h source file, line 211.

This function casts a generic device accessor to a bitbang device accessor

struct driver_bitbang_s  

This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 5 in device/class/bitbang.h source file, line 211.

This struct is the driver API descriptor for the bitbang device class.

See also DRIVER_CLASS_BITBANG and struct driver_class_s.

#define _DEV_BITBANG_READ  

This macro is declared in device/class/bitbang.h source file, line 67.

This macro is for internal use only.

#define _DEV_BITBANG_TRIG_ALTERNATE  

This macro is declared in device/class/bitbang.h source file, line 82.

trig on an alternate pin instead of using the pin used for signal acquisition.

This macro is for internal use only.

#define _DEV_BITBANG_TRIG_ANYEDGE  

This macro is declared in device/class/bitbang.h source file, line 78.

start on any edge

This macro is for internal use only.

#define _DEV_BITBANG_TRIG_FALLING  

This macro is declared in device/class/bitbang.h source file, line 76.

start on falling edge

This macro is for internal use only.

#define _DEV_BITBANG_TRIG_IMMEDIATE  

This macro is declared in device/class/bitbang.h source file, line 72.

start immediately

This macro is for internal use only.

#define _DEV_BITBANG_TRIG_RISING  

This macro is declared in device/class/bitbang.h source file, line 74.

start on rising edge

This macro is for internal use only.

#define _DEV_BITBANG_WRITE  

This macro is declared in device/class/bitbang.h source file, line 69.

This macro is for internal use only.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:37 2018 using MkDoc