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

The source code of this header can be browsed online.

Description [link] 

Purpose [link] 

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.

Drivers which implement this class must check for a DEV_RES_IOMUX resource named io.

Members [link] 

Types [link] 

Functions [link] 

Macros [link] 

Members detail [link] 

#define DEV_BITBANG_CANCEL(n) [link] 

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

See also dev_bitbang_cancel_t.

#define DEV_BITBANG_REQUEST(n) [link] 

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

See also dev_bitbang_request_t.

#define DRIVER_BITBANG_METHODS(prefix) [link] 

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

See also struct driver_bitbang_s.

#define __DEVICE_BITBANG_H__ [link] 

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

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

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

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) [link] 

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

This declaration involves expansion of the DEV_BITBANG_REQUEST macro.

void dev_bitbang_rq_done(struct dev_bitbang_rq_s *rq) [link] 

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

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) [link] 

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

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) [link] 

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

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) [link] 

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

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) [link] 

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

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) [link] 

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

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) [link] 

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

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) [link] 

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

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) [link] 

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

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) [link] 

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

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

enum dev_bitbang_rq_rtype_e [link] 

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

This enum specifies the various bigbang operations.

IdentifierDescription
DEV_BITBANG_WRITEA waveform is generated by inverting the output count+1 times. When count>0, the array of samples specifies the delays between the edges.
DEV_BITBANG_WRITE_RISEThis performs as DEV_BITBANG_WRITE, forcing the output high at the end.
DEV_BITBANG_WRITE_FALLThis performs as DEV_BITBANG_WRITE, forcing the output low at the end.
DEV_BITBANG_READA signal is recorded. The waveform of the signal is stored in the array of samples. The samples reflect the edges duration.

struct dev_bitbang_rq_s [link] 

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

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_pin_driving_e drive_start;When different from DEV_PIN_DISABLED, the driving mode of the pin is changed to the specified value before execution of the request.
enum dev_pin_driving_e drive_stop;When different from DEV_PIN_DISABLED, the driving mode of the pin is changed to the specified value after execution of the request.
enum dev_bitbang_word_width_e width;This specifies the type of integer used in the array of samples.
size_t count;Number of samples in the array. This must initialy be set to the size of the samples array. When the request type is DEV_BITBANG_READ, this field is updated by the driver with the actual number of samples stored. When write requests are used, a zero count is allowed.
void * samples;The waveform of the signal is defined by the content of this array. Each value in this array specifies a delay between two edges.
uint32_t read_timeout;DEV_BITBANG_READ requests are 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 samples and timeout.

struct dev_request_s * dev_bitbang_rq_s_base(struct dev_bitbang_rq_s *x) [link] 

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

struct dev_bitbang_rq_s * dev_bitbang_rq_s_cast(struct dev_request_s *x) [link] 

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

typedef uint16_t dev_bitbang_sample_delay_t [link] 

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

error_t dev_bitbang_wait_rq(const struct device_bitbang_s *acc, struct dev_bitbang_rq_s *rq) [link] 

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

This function use the scheduler api to put current context in wait state during the request. This can only be called from a scheduler context.

This is available when CONFIG_MUTEK_CONTEXT_SCHED is defined.

enum dev_bitbang_word_width_e [link] 

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

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

IdentifierDescription
DEV_BITBANG_8BITSSamples are stored as uint8_t
DEV_BITBANG_16BITSSamples are stored as uint16_t
DEV_BITBANG_32BITSSamples are stored as uint32_t

struct device_bitbang_s [link] 

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

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) [link] 

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

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) [link] 

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

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

struct driver_bitbang_s [link] 

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

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

See also DRIVER_CLASS_BITBANG and struct driver_class_s.

Valid XHTML 1.0 StrictGenerated by diaxen on Thu Aug 4 15:44:05 2022 using MkDoc